Skip to content

[plg_search_tags] Search results now don't include unpublished, archived or trashed tags#10713

Merged
wilsonge merged 3 commits intojoomla:stagingfrom
EmilMassey:tags_plugin
Jun 15, 2016
Merged

[plg_search_tags] Search results now don't include unpublished, archived or trashed tags#10713
wilsonge merged 3 commits intojoomla:stagingfrom
EmilMassey:tags_plugin

Conversation

@EmilMassey
Copy link
Copy Markdown

@EmilMassey EmilMassey commented Jun 2, 2016

Pull Request for Issue #10712 .

Summary of Changes

Select only published tags from the database by adding $query->where('a.published = 1');.

Testing Instructions

  1. Make sure Search - Tags plugin is enabled
  2. Create a tag
  3. Unpublish, archive or trash it
  4. Type a tag name in a mod_search module
  5. Only published tags should be listed.

Emil Masiakowski and others added 2 commits June 2, 2016 14:56
@infograf768
Copy link
Copy Markdown
Member

Looking at code, I think you should separate the query for published, and leave alone the code with if ($app->isSite() && JLanguageMultilang::isEnabled()) as this is done in the other search plugins.
I.e. should be:

        $query->where('a.published = 1');

        if ($app->isSite() && JLanguageMultilang::isEnabled())
        {
            $tag = JFactory::getLanguage()->getTag();
            $query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')');
        }

@hardiktailored
Copy link
Copy Markdown

I have tested this item ✅ successfully on c0b829b

I have tested in Joomla 3.5.1 and patch works perfectly.


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

@gunjanpatel
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on c0b829b

It works perfect after applying path.
It has two successful tests, but as per @infograf768 suggestion, I agree that $query->where('a.published = 1'); should be outside of the condition. Also, I would like to suggest below code to use quoteName.

$query->where($db->qn('a.published') . ' = 1');

Thanks for fixes.


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

@brianteeman
Copy link
Copy Markdown
Contributor

rtc


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 7, 2016
@brianteeman brianteeman added this to the Joomla 3.6.0 milestone Jun 7, 2016
@wojsmol
Copy link
Copy Markdown
Contributor

wojsmol commented Jun 7, 2016

@brianteeman Please remove RTC, see comments by @infograf768 and @gunjanpatel .

@brianteeman brianteeman removed the RTC This Pull Request is Ready To Commit label Jun 7, 2016
@brianteeman
Copy link
Copy Markdown
Contributor

Done

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 7, 2016
@brianteeman
Copy link
Copy Markdown
Contributor

Back to pending


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

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 7, 2016
@infograf768
Copy link
Copy Markdown
Member

@EmilMassey

Please update your PR

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @gunjanpatel, @hardiktasol


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

@wilsonge wilsonge removed this from the Joomla 3.6.0 milestone Jun 8, 2016
@gunjanpatel
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on db7e77e

Tested successfully.


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

@brianteeman
Copy link
Copy Markdown
Contributor

As the previously tested PR has been updated and confirmed by @gunjanpatel I am setting this back to RTC


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

@brianteeman
Copy link
Copy Markdown
Contributor

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 10, 2016
@brianteeman brianteeman added this to the Joomla 3.6.0 milestone Jun 10, 2016
@EmilMassey
Copy link
Copy Markdown
Author

Thank you @infograf768, @gunjanpatel for your suggestions.

@wilsonge wilsonge merged commit 1a026b9 into joomla:staging Jun 15, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 15, 2016
@wilsonge
Copy link
Copy Markdown
Contributor

Merged :) Thanks very much!

@EmilMassey EmilMassey deleted the tags_plugin branch June 16, 2016 11:31
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.

8 participants