? Success

User tests: Successful: 0 Unsuccessful: 0

avatar bahl24
bahl24
4 Apr 2019

Pull Request for Issue #24479 .

Summary of Changes

No results due to incorrect SQL query.

Expected result

Search page with results which are published

Actual result

Search always returns 0 results

avatar bahl24 bahl24 - open - 4 Apr 2019
avatar bahl24 bahl24 - change - 4 Apr 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2019
Category Front End Plugins
avatar brianteeman
brianteeman - comment - 4 Apr 2019

ws.condition=0 is the UNPUBLISHED state so that change cannot be correct can it?

avatar bahl24
bahl24 - comment - 4 Apr 2019

I tested and found that ws.condition=0 to be working.

avatar brianteeman
brianteeman - comment - 4 Apr 2019

That means there is a different problem to fix

avatar bahl24 bahl24 - change - 4 Apr 2019
Labels Added: ?
avatar bahl24
bahl24 - comment - 4 Apr 2019

I think I got the required solution.
Joining by ID always resulted in UNPUBLISHED state
Screenshot from 2019-04-04 22-16-55

avatar bahl24 bahl24 - change - 4 Apr 2019
Title
Fixed workflow conditions in search plugin
[4.0] Fixed workflow conditions in search plugin
avatar bahl24 bahl24 - edited - 4 Apr 2019
avatar brianteeman
brianteeman - comment - 4 Apr 2019

@bembelimen can you check this please

avatar bembelimen
bembelimen - comment - 4 Apr 2019

To get the correct state, you should always join over #__workflow_associations

avatar bahl24
bahl24 - comment - 5 Apr 2019

Updated: wa.stage_id=2 is equivalent to ws.condition=2 as both refer to PUBLISHED state

avatar bembelimen
bembelimen - comment - 5 Apr 2019

Updated: wa.stage_id=2 is equivalent to ws.condition=2 as both refer to PUBLISHED state

That's only for the default workflow the case (and only by chance), see e.g. for the correct join: https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/Model/ArticlesModel.php#L231-L260

avatar brianteeman
brianteeman - comment - 5 Apr 2019

Updated: wa.stage_id=2 is equivalent to ws.condition=2 as both refer to PUBLISHED state

Only in the default workflow!!!

avatar bahl24 bahl24 - change - 5 Apr 2019
Labels Added: J4 Issue
avatar bembelimen
bembelimen - comment - 5 Apr 2019

You shouldn't use the magic number "1" but the extension class constant for conditions.

avatar bahl24
bahl24 - comment - 6 Apr 2019

You shouldn't use the magic number "1" but the extension class constant for conditions.

Sorry, I didn't get you, ws.condition=1 points to published state. Is there an example regarding the extension class constant method?

avatar Bakual
Bakual - comment - 6 Apr 2019

The join on the #__workflow_associations table also needs to filter by extension = "com_content". Otherwise you also join on items from other extensions.

avatar bahl24
bahl24 - comment - 9 Apr 2019

@Quy , thanks for pointing out. I've made the changes

avatar wilsonge wilsonge - change - 18 Apr 2019
Labels Removed: J4 Issue
avatar wilsonge wilsonge - change - 18 Apr 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-04-18 09:59:48
Closed_By wilsonge
avatar wilsonge wilsonge - close - 18 Apr 2019
avatar wilsonge wilsonge - merge - 18 Apr 2019
avatar wilsonge
wilsonge - comment - 18 Apr 2019

Thanks!

Add a Comment

Login with GitHub to post a comment