? PR-4.3-dev Pending

User tests: Successful: 0 Unsuccessful: 0

avatar Hackwar
Hackwar
31 Oct 2022

Summary of Changes

This is the result of a codereview of the tag view from com_tags. There are several changes in here, which fix broken behavior in this one view and clean up code. I'm doing my best to document everything in here... This is a complex change, but unfortunately I don't see how to simplify this and/or split this up into several PRs. For all existing sites, this PR will not result in new errors, but rather fix existing issues.

Let's start into the changes in here:

  • The view class has been reordered to mimic the article view of com_content. This means, that data is assigned directly to a class attribute and not to a temporary variable, after the data is collected from the model, the parameters are merged appropriately and then the plugin events are run.
  • A bunch of docblocks have been fixed.
  • The feature to count hits on tags has been moved from the view to the controller, similar to how it is done in com_content. An option to disable this has been added as well.
  • $this->item in the view class contains an array of tags and up till now only the first tag was checked against the menu item, etc. Now all the tags are checked.
  • At several places, the view class checked the access levels. This is something that we are doing in the model (already) not in the view.
  • Merging of parameters was unnecessarily complex.
  • In the tag model, the $item attribute wasn't defined. $tag at the same time wasn't used. With $item being initialised as an array, we can remove a bunch of checks. At the same time we can now properly throw a 404 if the number of tag IDs doesn't match the number of tags found in the database matching these IDs. (we might want to rewrite the TagModel::getItem() method to use a single query instead of loading each tag separately with a Table call...)

Testing Instructions

Basically there should be no difference on an existing site between the current code and after applying this PR.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar Hackwar Hackwar - open - 31 Oct 2022
avatar Hackwar Hackwar - change - 31 Oct 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Oct 2022
Category com_tags Administration Front End
avatar Hackwar Hackwar - change - 31 Oct 2022
Labels Added: PR-4.3-dev
avatar chmst
chmst - comment - 2 Nov 2022

Then I misunderstood that, sorry. I see the problem from your point of view. But as a user I would be ok to know that there is nothing to see. Without 404 error message.

avatar jamfx
jamfx - comment - 3 Nov 2022

I have tested this item successfully on 80c6c27

Testes and no Problems found.


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

avatar jamfx jamfx - test_item - 3 Nov 2022 - Tested successfully
avatar richard67 richard67 - alter_testresult - 16 Nov 2022 - jamfx: Tested successfully
avatar richard67
richard67 - comment - 16 Nov 2022

I've restored @jamfx 's test result in the issue tracker since the commits which have invalidated the test count were just clean branch updates.

@Hackwar Please avoid unnecessary branch updates since that invalidates the test counter in the issue tracker and so makes it harder for us to find the PRs which have 2 good tests and causes additional work for restoring the test result. Thanks in advance.

avatar jwaisner jwaisner - test_item - 22 Nov 2022 - Tested successfully
avatar jwaisner
jwaisner - comment - 22 Nov 2022

I have tested this item successfully on 47f9758


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

avatar jwaisner jwaisner - change - 22 Nov 2022
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 22 Nov 2022

RTC


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

avatar cyanama
cyanama - comment - 27 Nov 2022

I have tested this item successfully

Please give us customizable css styles for the image and the title. At the moment you need to customize the raw img and h1 statements with impact for the whole webpage.

thanks
Cyana


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

avatar Hackwar Hackwar - change - 28 Nov 2022
Labels Added: ?
avatar richard67
richard67 - comment - 28 Nov 2022

RTC is still valid because the change after that was just replacing 3 nested if statements by one with the combined condition, which is ok for me by review.

avatar obuisard obuisard - change - 29 Nov 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-11-29 19:11:20
Closed_By obuisard
avatar obuisard obuisard - close - 29 Nov 2022
avatar obuisard obuisard - merge - 29 Nov 2022
avatar obuisard
obuisard - comment - 29 Nov 2022

Thank you Hannes @Hackwar for the PR!

Add a Comment

Login with GitHub to post a comment