404 Error when changing article settings [solved]

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
BillyBobBongo
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Feb 24, 2012 3:12 pm

404 Error when changing article settings [solved]

Post by BillyBobBongo » Fri Feb 24, 2012 3:28 pm

Right, I'm new to Joomla and have been working on setting up a brand new site using Joomla 2.5.

I'm having a major issue when I try to change the attributes (e.g. show publish date, show author) of an already published article. when I try to 'Save' or 'Save and Close' I find myself looking at a 404 page. I've deleted the entire install of Joomla and added it back afresh, but is still does this. This problem doesn't seem to be anything to do with anything other that the Joomla installation.

I've also set up a local version and this error doesn't occur. After turning on debugging I see that it's actually this query that's causing the issue.

Code: Select all

SELECT c.*, 
  CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as slug,COUNT(i.`id`) AS numitems 
  FROM jml_categories as c 
  LEFT JOIN jml_categories AS s 
  ON (s.lft <= c.lft 
  AND s.rgt >= c.rgt) OR (s.lft > c.lft 
  AND s.rgt < c.rgt) 
  LEFT JOIN  (SELECT cat.id as id 
  FROM jml_categories AS cat JOIN jml_categories AS parent 
  ON cat.lft BETWEEN parent.lft 
  AND parent.rgt 
  WHERE parent.extension = 'com_content' 
  AND parent.published != 1 
  GROUP BY cat.id) AS badcats 
  ON badcats.id = c.id 
  LEFT JOIN `jml_content` AS i 
  ON i.`catid` = c.id 
  AND i.state = 1 
  WHERE (c.extension='com_content' OR c.extension='system') 
  AND c.published = 1 
  AND s.id=1 
  AND badcats.id is null 
  GROUP BY c.id, c.asset_id, c.access, c.alias, c.checked_out, c.checked_out_time, c.created_time, c.created_user_id, c.description, c.extension, c.hits, c.language, c.level,  c.lft, c.metadata, c.metadesc, c.metakey, c.modified_time, c.note, c.params, c.parent_id, c.path, c.published, c.rgt, c.title, c.modified_user_id 
  ORDER BY c.lft
Which in returns this error if I try to run it in MySQL

Code: Select all

#1064 you have an error in your sql syntax; check the manual that corresponds to your MySQl server version for the right syntax to use near WHEN CHAR_LENGTH(c.alias) then CONCAT_WS(':',c.id,c.alias) else c.id end as sl
The procedure followed each time to create and test the install was thus:

1. Install Joomla
2. Create News Category (Title News, Alias news)
3. Add news item to Main Menu
4. Create article and relate it to News category
5. Check article to ensure publication
6. Edit settings to hide publication date and hide author.
7. Clicking 'Save' or 'Save and Close' results in 404 page (Category not found)

Can anyone perhaps shed some light on to why this is occurring and how it can be resolved. Is it something to do with how my server is setup? Any help would be greatly appreciated.

If it helps at all the site is hosted with asmallorange and is running MySQL server version 5.1.52-cll / client version 4.1.22 .
Last edited by BillyBobBongo on Sat Feb 25, 2012 11:59 am, edited 1 time in total.

BYGino
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 178
Joined: Fri Apr 20, 2007 9:41 pm
Location: Scotland
Contact:

Re: 404 Error when changing article settings

Post by BYGino » Fri Feb 24, 2012 8:04 pm

Sounds strange, the only thing I can think of is it's something to do with the Cache, either server or browser side. Do you have a test site up I can see this happening on?

EDIT: Or it could be something to do with your redirects

BillyBobBongo
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Feb 24, 2012 3:12 pm

Re: 404 Error when changing article settings

Post by BillyBobBongo » Fri Feb 24, 2012 8:45 pm

Cache! You my friend are on to something.

If I 404 the site when altering an article my site the template, css etc etc don't load and the site shows 404s when you try to open pages or the admin panel. However, if I jump to another browser it's all there and working fine.

I've reduced the cache time to just one minute and the site is returning from this 'mental fit' and you can get at the pages again. It therefore has to be cache related.

I've tried out all three of the available cache settings in the Joomla admin, but regrettably none solve the issue when editing the article. At least however I'm a step closer to understanding what's going on. Thank you for your brainwave.

I do indeed have a test site (dev.tequilatown.net), I like to push all the buttons before I commit ;)

BYGino
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 178
Joined: Fri Apr 20, 2007 9:41 pm
Location: Scotland
Contact:

Re: 404 Error when changing article settings

Post by BYGino » Fri Feb 24, 2012 8:52 pm

Yip, definitely seems to be cache related then if it works in another browser. Changing the settings in Joomla however won't really make much difference as that is the server side caching. it's actually best to have this off while still working on the site.

It seems more like the browser is caching the link so when you click it it's trying to link to a page that probably no longer exists on the server (URL redirects do strange things but that's for a later time)

Clear your browser cache every time you make a change or even better, while you're developing, turn off caching completely.

P.S> It all works fine for me.

BillyBobBongo
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Feb 24, 2012 3:12 pm

Re: 404 Error when changing article settings

Post by BillyBobBongo » Sat Feb 25, 2012 11:51 am

Thought I'd close up this thread with the solution to my problem. After going on the hunt as to why 'cache' might be causing this issue I stumbled upon the possible solution of getting my hosts to turn off mod_security. Low and behold...no more 404's when changing article settings.

Thanks BYGino for taking the time to help me with these issues and getting me pointed in the right direction.

BYGino
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 178
Joined: Fri Apr 20, 2007 9:41 pm
Location: Scotland
Contact:

Re: 404 Error when changing article settings

Post by BYGino » Sat Feb 25, 2012 11:57 am

No problem. Have fun with Joomla!

Just remember to mark the thread as solved too.


Locked

Return to “General Questions/New to Joomla! 2.5”