Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] Smart Search: Only add published taxonomies #39961

Merged
merged 1 commit into from May 30, 2023

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Feb 27, 2023

Pull Request for Issue #36980.

Summary of Changes

While fixing the issue of #39944, it became clear that not only the content in the index had the issue that you couldn't reliably unpublish it, but that also the taxonomies had an issue with its state. Taxonomies tried to copy over the state from their input data and used that as state for the taxonomie itself. That means, that unpublished categories would have had been added as unpublished taxonomies to a content item. Now if you wanted to prevent a taxonomie to show up in the frontend, you were able to unpublish (or publish) the taxonomie, thus unsyncing the taxonomie and its datasource. You basically were able to set a category to unpublished, index an article from that category and in the resulting taxonomie, you would then be able to enable that again.

At the same time, the state of the taxonomie was changed back to its datasource when the original content item was indexed again. So you unpublished a taxonomie, then edited an article and those taxonomies would be published again. This PR changes this now.

With this PR, Taxonomies now have their own, exclusive state and are either published or unpublished and that state is preserved across several indexing runs. At the same time, taxonomies are only added to the index when they are published, thus having state = 1. Since only published taxonomies show up in the frontend anyway, this doesn't change anything to existing sites.

Furthermore, this PR ensures that languages and access levels are set properly from the datasource and not just from the given method inputs. This specifically means, that the specific language of a category does not overwrite the "all" language of its parent category for example.

Testing Instructions

  1. Create a category with language "all".
  2. Create a second category inside the first with a specific language, like "english".
  3. Create an article inside the second category with a specific language.
  4. Enable the languagefilter plugin.
  5. Go to the Content Maps of Smart Search and unpublish one of the categories.
  6. Clear index and Reindex
  7. Unpublish one of the categories in the category manager.
  8. Clear index and Reindex

Actual result BEFORE applying this Pull Request

Before the patch, the first category would also have the language "english". After reindexing, the unpublished category in the Content Maps is published again. After the second reindexing, the unpublished category and all its children is still listed as a taxonomy.

Expected result AFTER applying this Pull Request

After the patch, the first category has the correct language "all". After reindexing, the unpublished in Content maps is still unpublished. After the second reindexing, the unpublished category and all its children are not listed as taxonomies anymore.

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

@toivo
Copy link
Contributor

toivo commented Mar 13, 2023

I have tested this item ✅ successfully on 8f19bc0

Tested successfully in Joomla 4.3.0-beta5-dev of 13 March in PHP 8.1.10


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

@viocassel
Copy link
Contributor

I have tested this item ✅ successfully on 8f19bc0


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

@Quy
Copy link
Contributor

Quy commented Mar 13, 2023

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 13, 2023
@Hackwar Hackwar added the bug label Apr 7, 2023
@Hackwar Hackwar closed this Apr 18, 2023
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 18, 2023
@Hackwar Hackwar reopened this Apr 18, 2023
@Hackwar Hackwar changed the base branch from 4.3-dev to 5.0-dev April 18, 2023 12:51
@Hackwar Hackwar changed the title [4.3] Smart Search: Only add published taxonomies [5.0] Smart Search: Only add published taxonomies Apr 18, 2023
@laoneo laoneo removed the PR-4.3-dev label May 8, 2023
@HLeithner HLeithner merged commit b0c9104 into joomla:5.0-dev May 30, 2023
1 check failed
@HLeithner
Copy link
Member

thanks

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

Successfully merging this pull request may close these issues.

None yet

7 participants