?
Referenced as Pull Request for: # 6640
avatar JAVesey
JAVesey
31 Mar 2015

Steps to reproduce the issue

Login to front-end with account with permission to edit articles.
Edit article or just click "Save"

Expected result

Article is saved with advisory notice

Actual result

The following warning is displayed:
"Warning
Alias already existed so a number was added at the end. If you want to change the alias, please contact a site administrator"

Article edits are saved (advisory notice displays okay) but "-2" is added to the end of the original alias.

Editing the article's alias in the back-end allows restoration of the original alias.

System information (as much as possible)

Joomla 3.4.1
Protostar Template
php 5.3.27
JCK Suite editor

Additional comments

Seems to be reproducible by others, as discussed in Forums here:
http://forum.joomla.org/viewtopic.php?f=706&t=881506

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar JAVesey JAVesey - open - 31 Mar 2015
avatar JAVesey JAVesey - change - 31 Mar 2015
Labels Removed: ?
avatar brianteeman
brianteeman - comment - 31 Mar 2015

I can only replicate this when the menu type is featured articles. Everything is fine when editing a single article or a blog category

avatar proweb
proweb - comment - 31 Mar 2015

Confirm, Brian right it's bug for featured articles.

avatar sovainfo
sovainfo - comment - 31 Mar 2015

Confirmed this, indeed on the featured menu item. With muliple edits the odd number edit produces the message, the even number edits don't. Only the first time the alias is changed to -2.

No problem in J336, problem with J340 and j341.

avatar JAVesey
JAVesey - comment - 31 Mar 2015

Thank you guys, I confirm all the the above. Sorry I wasn't more specific :-(


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6620.
avatar zero-24 zero-24 - change - 1 Apr 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 1 Apr 2015
Status New Confirmed
avatar zero-24 zero-24 - change - 1 Apr 2015
Category Front End
avatar dneukirchen
dneukirchen - comment - 1 Apr 2015

#4316
The "isNew-Check" in line 507 of ContentModelArticle fails, because (int) $input->get('id') returns 0 when editing an article from featured view.

Perhaps we could use $data['"id"] instead of $input->get("id") to solve this problem.

But i didnt spent a lot of time debugging/testing this and i didnt find the reason why this happens only every 2nd save attempt and only when the menu type is featured.
I will look into this in more detail tomorrow.

avatar infograf768
infograf768 - comment - 2 Apr 2015

I confirm that changing to
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $data['id'] == 0)
solves the issue here.

avatar dneukirchen
dneukirchen - comment - 3 Apr 2015

In my opinion, there is no good reason to use input->get("id") rather than $data["id"] coming from the controller.

When you edit an article from the featured view, $input->get("id") is null and the "isNew-Check" fails.

When you edit from a category blog view $input->get("id") holds the categoryId and not the articleId... so even if it does not lead to errors in that case... its still the wrong value and could lead to errors and bugs in the future.

So if no one has any objection, i would create the pr to fix this.

P.S. The same applies to $input->getInt('id') at line 487.

avatar dneukirchen dneukirchen - reference | - 3 Apr 15
avatar zero-24
zero-24 - comment - 3 Apr 2015

Thanks @dneukirchen i'm closing here as we have a PR #6640

avatar zero-24 zero-24 - change - 3 Apr 2015
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2015-04-03 09:37:59
avatar zero-24 zero-24 - close - 3 Apr 2015
avatar zero-24 zero-24 - close - 3 Apr 2015

Add a Comment

Login with GitHub to post a comment