-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Implement condition query for frontend modules/plugins #21702
Conversation
…frontend-stages # Conflicts: # modules/mod_stats/Helper/StatsHelper.php
@brianteeman could you please tag this PR, too? Thx. |
tagged as requested. |
…frontend-stages # Conflicts: # modules/mod_stats/Helper/StatsHelper.php
. ' ON ' . $db->quoteName('ws.id') . ' = ' . $db->quoteName('c.state') | ||
) | ||
->where($db->quoteName('ws.condition') . ' = 1'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove blank line
…frontend-stages # Conflicts: # modules/mod_stats/Helper/StatsHelper.php
Fix error c.id not in field list.
Fix template alias
Adding workflow tables to each sql query will slow down joomla 4 on front end. As IMO workflow staff should be loaded optionally, I mean workflow tables should not be used in the sql Example using subquery SELECT old.*, wa.*, ws.*
( SELECT * FROM #__content INNER JOIN #__categories [...] WHERE [...] ORDER BY [...] LIMIT 30) AS old
LEFT JOIN #__workflow_associations wa [...]
LEFT JOIN #__workflow_stages ws [...] |
I have tested this item ✅ successfully on d5aaf5f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21702. |
Hi @csthomas thanks for your feedback. The state field of com_content should be viewed as "deprecated", it's only there because of B/C reasons but is not used by the workflow in any case. |
So the workflow tables need to be used when listing / querying the records of components that use workflow ? Could we not say that it is not there for B/C, |
I manage website with 400k articles, 140k of them are published now. Now on upgrade to 4.0 I will have to create 400k rows in |
Joomla goes in this direction. If you want to read article you have to ask "a workflow" for permission:) |
Not the workflow, but in the future, the stage/state of the article should matter, yes. At the moment everyone can edit an article all the time with edit rights. In the future only people with permission based on the stage will be able to edit. For example if you're responsible for proofreading, you should be able to edit an article when it's unpublished but not when it's published and so on. So you need this "mapping". |
ok, but is workflow required to be checked when viewing the records too ? |
I think that was a joke from @csthomas viewing is based on the Access level (view levels) of the article and if it's published. That makes no sense to solve it over the workflow. |
|
Workflow feature is very nice, but it should stay out of "usage" queries as much as possible at most we should have an API call to get the viewable conditions
or this
About state being a deprecated B/C thing, i would not agree, workflow should continue set to a condition into the state column in the future, without having the column removed !! and the workflow tables should not be required at all
they should be used only when finding current workflow information to show in management, not when using the content |
the joke was merging the workflow in the 4.x branch to begin with |
Summary of Changes
Change hardcoded state calls to the new condition constants
Testing Instructions