Skip to content

Don't take "Create Article" menuitem for an article edit#16756

Merged
rdeutz merged 3 commits intojoomla:stagingfrom
Bakual:FixingContentRouterEdit
Jun 23, 2017
Merged

Don't take "Create Article" menuitem for an article edit#16756
rdeutz merged 3 commits intojoomla:stagingfrom
Bakual:FixingContentRouterEdit

Conversation

@Bakual
Copy link
Contributor

@Bakual Bakual commented Jun 18, 2017

Pull Request for Issue #12687 and #16612 .

Summary of Changes

This adjusts the ContentRouter so it only takes the "Create Article" menuitem for new articles, not when editing an existing article. I adjusted the Viewconfiguration for that and added &a_id=0 to the URL for the view in the controller.
Please note that most of the change are only within com_content, but there is one change in the menu rule which may affect other extensions. But only if they use those new JComponentRouterView stuff and I think the change should be fine. If you come into that part of the code and don't have a key set in the menuitem, it will not be stored into the needles array and never be used for the URL. So that looked wrong anyway.

Testing Instructions

  • Create at least two articles. Have a menuitem pointing to one of them and a menuitem pointing to the category.
  • Create a menuitem "Create Article". For better testing you can adjust the settings within that menuitem (eg the title or the standardcategory) so the view is distinguishable easy from a regular edit.
  • Now try the article edit links (in the category list and/or the single article view) and that "Create Article" link

Expected result

  • The "Create Article" menuitem should be used for any "New Article" links. Test for example the "New" button in the category list
  • The edit links should not use the "Create Article" menuitem. Instead it should be based on the article menuitem or the category one. Whatever fits best.

Actual result

Any edit links use the "Create Article" menuitem

Documentation Changes Required

Don't think there is any doc at all for this router stuff.

@bayareajenn
Copy link

I just tested this on a client dev site that had the exact problem described. The new files work perfectly and resolve the issue. How many more people do you need to test (or sites) before it can be included with the next release? Let me know and I'll try to find people.

@alikon
Copy link
Contributor

alikon commented Jun 20, 2017

hi jenn,
They need at least 2 successfull tests to be evaluated as ReadyToCommit and then is up to maintainers to commit / and decide milestone.
so please mark your successfull test on https://issues.joomla.org/tracker/joomla-cms/16756 so you'll need to find just another 1 to test

@bayareajenn
Copy link

I just tested this on a client dev site that had the exact problem described. The new files work perfectly and resolve the issue.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16756.

@bayareajenn
Copy link

I have tested this item ✅ successfully on c25284a

I just tested this on a client dev site that had the exact problem described. The new files work perfectly and resolve the issue. I get a little confused in here but all good, right?!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16756.

@bayareajenn
Copy link

Hi Nicola,
Thank you! You're so great walking me through these things. :) :) I can't wait to see you in November!
jenn

@jim-porter
Copy link

I was having this problem with a production site and tested this solution. It successfully resolved the problem. Jenn thanks for letting me know about this solution.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16756.

@bayareajenn
Copy link

@jim-porter at the top of https://issues.joomla.org/tracker/joomla-cms/16756 login and mark that you've tested successfully. Can you see where it has Successful: 1 bayareajenn at the top of the page? We need you to say you tested successfully too! Thank you for testing this Jim!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16756.

@jim-porter
Copy link

I have tested this item ✅ successfully on c25284a

I had this problem with a production site and tested this solution. The test was successful and fully resolved the problem.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16756.

@bayareajenn
Copy link

@Bakual is it to late to get this issue in with 3.7.3?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16756.

@ghost
Copy link

ghost commented Jun 22, 2017

RTC after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 22, 2017
@ghost
Copy link

ghost commented Jun 22, 2017

@bayareajenn hopefully @rdeutz as Release Leader can make this Decision (but yesterday "Release Candidate 1" was going out).

@bayareajenn
Copy link

@franz-wohlkoenig I know. I saw the announcement earlier. I tried to get more testers yesterday but it didn't work out. We'll see what @rdeutz says and if it's not meant to be, it's not meant to be. Thanks!

@rdeutz rdeutz self-assigned this Jun 22, 2017
@infograf768
Copy link
Member

This patch is real great!

@rdeutz
Copy link
Contributor

rdeutz commented Jun 22, 2017

Was not in time for the RC release, I will do my own test and then decide if I merge it into 3.7.3.

@rdeutz rdeutz added this to the Joomla 3.7.3 milestone Jun 23, 2017
@rdeutz rdeutz merged commit 0750c48 into joomla:staging Jun 23, 2017
@joomla-cms-bot joomla-cms-bot added PR-staging and removed RTC This Pull Request is Ready To Commit labels Jun 23, 2017
@bayareajenn
Copy link

Thank you, @rdeutz !

@jsfernando
Copy link

I was also having the same issue in Article Editing, switching category. I askedo here proposed and it worked!

@netamity
Copy link

netamity commented Jul 5, 2017

Unfortunately this broke my 'Add article' menu link. The &a_id=0 caused a redirect to the non-SEF url of the current page. Very strange. Commenting out the
$form->setKey('a_id');
fixed the issue. I don't have any Edit menu links on my sites, so I think I should be ok.
Registered for the joomlacode bug reporting and awaiting approval in order to report.

@ghost
Copy link

ghost commented Jul 5, 2017

@netamity can you please open a new Issue? Thanks.

@mbabker
Copy link
Contributor

mbabker commented Jul 5, 2017

Registered for the joomlacode bug reporting and awaiting approval in order to report.

JoomlaCode is not used for bug reports anymore (and hasn't been for years). Filing issues here on GitHub (or https://issues.joomla.org/ which is just a wrapper for GitHub mainly) is the way to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

Comments