? PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
10 Jan 2023

Pull Request for Issue #39587.

Summary of Changes

This PR fixes wrong article meta-description priority as described in #39587. Basically, it should work as below:

  1. If the menu item is linked directly to the article, the meta description set in menu item will take highest priority
  2. If not, the meta description from article will be used
  3. And finally, the meta description from menu item

Testing Instructions

  1. Follow instructions at #39587 , confirm the issue
  2. Apply patch, confirm that the issue fixed

Actual result BEFORE applying this Pull Request

Meta description is not handled properly.

Expected result AFTER applying this Pull Request

Meta description is handled properly.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jan 2023
Category Front End com_content
avatar joomdonation joomdonation - open - 10 Jan 2023
avatar joomdonation joomdonation - change - 10 Jan 2023
Status New Pending
avatar Septdir
Septdir - comment - 10 Jan 2023

thx, but need also fix metakey and all another views.

This looks like a global architectural error.
Because the priority of parameters is first Menu Item, then Item.

On the meta, it's the other way around.

avatar Sulpher
Sulpher - comment - 10 Jan 2023

I've been tested - the PR works fine in article view mode. And I agree with @Septdir - other pages need this fix too.

avatar joomdonation joomdonation - change - 10 Jan 2023
Labels Added: ?
avatar joomdonation
joomdonation - comment - 10 Jan 2023

I made the same fix for category view in com_content. I agree that it should be fixed for all, but we should do the fix for a component at a time, easier to test.

Will be happy to review and apply fix for other components, in separate PR.

avatar Septdir
Septdir - comment - 10 Jan 2023

I've been tested - the PR, all done

avatar joomdonation
joomdonation - comment - 10 Jan 2023

Could you two please go to https://issues.joomla.org/tracker/joomla-cms/39588 and report your test result there so that your test will be counted and this PR could be merged ?

avatar brianteeman
brianteeman - comment - 10 Jan 2023

Is this really something that is safe to do. Doesn't it change the existing
expected behaviour of everyone's sits and how they may appear on search
engines etc. ??

avatar Sulpher
Sulpher - comment - 10 Jan 2023

Is this really something that is safe to do. Doesn't it change the existing expected behaviour of everyone's sits and how they may appear on search engines etc. ??

There are two ways:

  1. Make announcement and warns everyone to check sites and fix descriptions. (it requires making some actions, but it is worth to do to comply with the fixed architecture)
  2. Keep it as is, but add a notification in the documentation about such a "feature".
avatar Septdir
Septdir - comment - 10 Jan 2023

@brianteeman, I don't think this change will cause serious problems.
Because now the meta settings in the menu item simply do not work if the fields are filled in the item.

If this is not corrected, then it turns out that the Joomla based logic: "Menu item has the highest priority" does not work.

Moreover, h1 works according to the principle "The menu item has the highest priority" and the rest of the meta does not.

There is also another problem. Now if you fill in the meta fields in the item, then it will not be possible to make 2 different menu items with different layouts and different meta descriptions.

avatar Septdir Septdir - test_item - 10 Jan 2023 - Tested successfully
avatar Septdir
Septdir - comment - 10 Jan 2023

I have tested this item successfully on 68da900


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

avatar Septdir
Septdir - comment - 10 Jan 2023

This question has already been raised in 2017 #15102
But remained unanswered. I skimmed through the history and did not see that someone changed the priorities of the meta. This "problem" has been around for a very long time.

avatar joomdonation
joomdonation - comment - 10 Jan 2023

Accept this change or not is up to us. However, this is clear a bug fix to make meta description works in the same way with everything else: If the active menu item is linked directly to the item, the settings from menu item will take higher priority than the settings from the item itself. We can see it with the way we handle article layout or the way we merge item parameters with menu item parameters https://github.com/joomla/joomla-cms/blob/4.2-dev/components/com_content/src/View/Article/HtmlView.php#L143-L174

avatar viocassel viocassel - test_item - 10 Jan 2023 - Tested successfully
avatar viocassel
viocassel - comment - 10 Jan 2023

I have tested this item successfully on 44c87d9


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

avatar pakimov pakimov - test_item - 11 Jan 2023 - Tested successfully
avatar pakimov
pakimov - comment - 11 Jan 2023

I have tested this item successfully on 44c87d9


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

avatar weeblr
weeblr - comment - 11 Jan 2023

A couple of comments with respect to the B/C break concern mentioned by @brianteeman

Prior:

  • article description wins over direct link menu item description

Proposed:

  • direct link menu item wins over article

Biggest case FOR the change: the page title ("Browser title") works the "expected" way (menu wins over article) while description is currently the other way around. Really hard to figure out and handle.

B/C break:

  • happens if someone created a description in BOTH direct link menu item and article, and these descriptions are different

Likely reason is if someone entered a desc in menu item (as they did with a page title) then wanted to change it, forgot about the menu item and changed it in article options.

In that case, the change in this PR will revert back to the wrong, old description.

These cases will exist, no doubt, due to description working the opposite to title. So that change is definitely a B/C break.

I still think it's worth the change despite that, due to inconsistency with how similar setting Browser title behaves.

avatar joomdonation joomdonation - change - 11 Jan 2023
Status Pending Ready to Commit
avatar joomdonation
joomdonation - comment - 11 Jan 2023

RTC since there are two successful tests. Will add RLDQ label so that release lead can make final decision about this.


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

avatar Septdir
Septdir - comment - 11 Jan 2023

I spoke with several people about this change.
Everyone agrees that it is correct. The menu item must have the highest priority.

However, in fact, this is a change in long-used logic and can cause problems.

They gave me an example.

At the time of site assembly, a person created an article and a menu item. In the menu item in metadesc, I wrote "f ***" for the test, then at the stage of filling the correct metadesc was filled in the articles and everyone forgot about the menu item.

And after merge pr metadesc will become "f***" and get into search engines.

Therefore, I don’t think that people will be against making meta fields with the correct priority, but I think it’s better to postpone the release of changes to the minor version, and preferably to the major version.

Then it will be possible to add a warning before the update, and when upgrading to a major version, sites check more carefully.

avatar roland-d
roland-d - comment - 11 Jan 2023

As mentioned before this will impact users' sites so this is not fit for a patch or feature release. We all agree, this is a good fix but needs to go into the next major release.

Same as any other PRs for the same issue needs to be based on the 5.0-dev branch.

@joomdonation Could you rebase this to the 5.0-dev branch please?

avatar joomla-cms-bot joomla-cms-bot - change - 12 Jan 2023
Category Front End com_content Unit Tests Administration com_admin SQL Postgresql com_categories com_content com_contenthistory com_fields com_finder com_joomlaupdate com_media NPM Change JavaScript com_templates com_users Language & Strings
avatar joomdonation
joomdonation - comment - 12 Jan 2023

Sorry, I messed up the PR while changing the branch. Will close this new and do a new PR later.

avatar joomdonation joomdonation - change - 12 Jan 2023
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2023-01-12 00:37:55
Closed_By joomdonation
Labels Added: ? PR-5.0-dev
Removed: ?
avatar joomdonation joomdonation - close - 12 Jan 2023

Add a Comment

Login with GitHub to post a comment