-
-
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
Revert "[Batch] Change State: pass only affected items to table #23197
Conversation
…vent (joomla#22851)" This reverts commit efd10de
Actually, no, it is not "clearly a BC break". Everything about #22851 is just fine minus the fact that nothing uses the column aliasing logic in the Table API even though it has been present for years. The same problem would exist with hardcoded column names and has been a constant issue throughout core because different components name columns with different standards or use columns with the same name in different ways. So is it annoying? Absolutely. Is it safer to just revert the change to save face? Yes. Is it a BC break? No. |
Although i agree that #22851 is not a bc break in technical terms, it will definitely break some extensions and forces 3dp devs to check (and change) their extensions in a patch release. Im with @laoneo here and think that it might be better to postpone the changes to 4.x. We should care about third party devs and the issue that is fixed in #22851 is not worth the shitstorm. We can still keep/merge the fixes in #22953, #23194 (...) in 3.x, so that the core finally uses jtable column aliasing correctly. Is there a way to keep the changes from #22851 in 3.x without getting a shitstorm from 3dp devs?
|
I think the solution exists a few lines above , look at the sanity check of checked_out column // If the table is checked out by another user, drop it and ..
if (property_exists($table, 'checked_out') && $table->checked_out && ($table->checked_out != ... So in our case for the ... "published" column // Prune items that are already at the given state
if ($table->get($table->getColumnAlias('published'), $value) == $value) will become /**
* Prune items that are already at the given state. Note: Only models whose table correctly
* sets 'published' column alias (if different than published) will benefit from this
*/
$published_col = $table->getColumnAlias('published');
if (property_exists($table, $published_col) && $table->get($published_col, $value) == $value) |
The checked out check needs fixing too in order to support column aliasing. We also need to be careful how much we rely on |
About column aliasing of checked_out, ok just i am a little of encouraging the use of an alias for checked_out column About Table::getColumnAlias()
$hitsAlias = $this->table->getColumnAlias('hits');
$checkedOutField = $table->getColumnAlias('checked_out');
$orderingField = $this->table->getColumnAlias('ordering'); https://github.com/joomla/joomla-cms/blob/staging/libraries/src/MVC/Model/AdminModel.php#L453 So is it ok to do the change i suggested ? |
Adding methods to an interface is a B/C break, hence the reason I said it should be done in 4.0. Until it is part of the interface, realistically you need to wrap things in So I'm not saying don't use the feature. I am saying to do things right. We have an interface, we should be treating our code as working against that interface unless you know with 100% certainty you are working with a specific concrete implementation of that interface. You cannot make that assumption in the MVC library classes; you can relatively safely make that assumption in a component's model classes. |
While true, we already use it in batchCopy. I'd say it's save to also use in batchMove. If we add such a wrapper and notice here, we should then do it in all 4 places. That actually is valid and should be done in another PR as it is another issue than this issue here. I'm in favor of using the suggestion from @ggppdk instead of reverting the code. That sounds like the better plan moving forward (assuming it works). So @laoneo do you want to adapt the PR or does @ggppdk want to create a second PR? |
Ah crap, didn't see that he already did it. 👍 |
BC break (techincally/theoretically) or whatever ... this to to me smells like our testing system is broken |
Pull Request for #23194, #23193, #23192, #23191 and probably dozens of support requests on 3rd party extensions where unpublish doesn't work anymore in the back end.
Summary of Changes
#22851 fixed bulk state changes but in a none BC way. After talking with @dneukirchen it is better to revert this change and apply it on joomla 4 as it is clearly a BC break.
Testing Instructions
Expected result
Client is unpublished.
Actual result
Client is still published.