? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
20 May 2021

Pull Request for Issue #33936.

Summary of Changes

As explained in #33936 , the ordering value of each article record displayed in Articles management screen is having wrong value, thus it will make re-ordering articles not working as expected. This PR just fixes that issue

Testing Instructions

  1. Modify this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/tmpl/articles/default.php#L378 on your Joomla installation to:
<?php echo (int) $item->id . ':' . $item->ordering; ?>
  1. Access to Content -> Articles:
  • Here is what is displayed before patch. You will see that there is no ordering value displayed (empty) unless the article is featured article.

before_patch

  • After patch, the ordering value is displayed (next to article ID)

after_patch

avatar joomdonation joomdonation - open - 20 May 2021
avatar joomdonation joomdonation - change - 20 May 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2021
Category Administration com_content
avatar richard67
richard67 - comment - 20 May 2021

@joomdonation Maybe it helps if you share with us your code modification for debugging this, i.e. showing the ordering with the ID like you did. Just by code review it's not really clear, and in a real test drag and drop ordering seems to work without this PR.

avatar joomdonation
joomdonation - comment - 20 May 2021

@richard67 Modify this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/tmpl/articles/default.php#L378 to:

<?php echo (int) $item->id . ':' . $item->ordering; ?>

You will see ordering value displayed next to ID of article like in my screenshot.

For drag and drop re-ordering, I think it works now because your installation has not had this PR #33937 applied yet (that correct logic of re-ordering items).

avatar joomdonation
joomdonation - comment - 20 May 2021

Technical, you can look at this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/src/Model/ArticlesModel.php#L276. It gets the ordering value from #__content_frontpage table, so in most case (unless the article you are viewing is featured article), the ordering value in Articles management would be null (because there is no related records in #__content_frontpage table).

On articles management (view articles), it should have ordering value from #__content table. However, due to the bug in correct code (left join with #__content_frontpage table), it always uses ordering from #__content_frontpage table, so it is wrong.

Hope that gives some more information.

avatar richard67 richard67 - test_item - 20 May 2021 - Tested successfully
avatar richard67
richard67 - comment - 20 May 2021

I have tested this item successfully on 0a8bb0f


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

avatar richard67
richard67 - comment - 20 May 2021

@joomdonation Maybe you should add that to the testing instructions for easier getting a 2nd tester, and mention that it's related to odering unfeatured articles.

avatar joomdonation joomdonation - change - 20 May 2021
The description was changed
avatar joomdonation joomdonation - edited - 20 May 2021
avatar joomdonation
joomdonation - comment - 20 May 2021

@richard67 Done. Hope it is easier to understand and test now.

avatar richard67
richard67 - comment - 20 May 2021

@joomdonation Yes, much better now.

avatar Abernyte-Git Abernyte-Git - test_item - 20 May 2021 - Tested successfully
avatar Abernyte-Git
Abernyte-Git - comment - 20 May 2021

I have tested this item successfully on 0a8bb0f


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

avatar Abernyte-Git
Abernyte-Git - comment - 20 May 2021

I have tested this item successfully on 0a8bb0f


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

avatar richard67 richard67 - change - 20 May 2021
Status Pending Ready to Commit
Labels Added: ?
avatar richard67
richard67 - comment - 20 May 2021

RTC


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

avatar rdeutz rdeutz - change - 20 May 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-05-20 17:51:38
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 20 May 2021
avatar rdeutz rdeutz - merge - 20 May 2021

Add a Comment

Login with GitHub to post a comment