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

Incompatibility between DCA constants and the universal picker #4496

Closed
doishub opened this issue Apr 8, 2022 · 11 comments
Closed

Incompatibility between DCA constants and the universal picker #4496

doishub opened this issue Apr 8, 2022 · 11 comments
Assignees
Labels
Milestone

Comments

@doishub
Copy link
Contributor

doishub commented Apr 8, 2022

Affected version(s)

4.9.28

Description

While researching this ticket, I noticed an inconsistency which occurs when an external extension uses the picker widget but not the new DCA constants.

The following line of code only checks for the constant, so DCAs that are still defined as 'Table' (string) and want to be called by a picker widget are no longer compatible with the current Contao version 4.9.28:

return $this->getDataContainer() === $GLOBALS['TL_DCA'][$table]['config']['dataContainer']

Or in TablePickerProvider:

protected function getDataContainer(): string
{
return DC_Table::class;
}

If I would now adjust the extension accordingly, all running Contao instances (<4.9.28) that exclusively install the latest version of the extension would no longer work.

Is this behavior desired? I would have expected some kind of BC layer here now.

@bytehead
Copy link
Member

bytehead commented Apr 8, 2022

Will be fixed by #4481 🙃

@bytehead
Copy link
Member

bytehead commented Apr 8, 2022

Use Contao\DC_Table::class instead of Table in your DCA definition ($GLOBALS['TL_DCA'][$table]['config']['dataContainer']).

@bytehead bytehead added this to the 4.9 milestone Apr 8, 2022
@bytehead bytehead self-assigned this Apr 8, 2022
@bytehead
Copy link
Member

bytehead commented Apr 8, 2022

Closing in favor of #4481, thank you for reporting though 🙏

@bytehead bytehead closed this as completed Apr 8, 2022
@doishub
Copy link
Contributor Author

doishub commented Apr 8, 2022

Use Contao\DC_Table::class instead of Table in your DCA definition ($GLOBALS['TL_DCA'][$table]['config']['dataContainer']).

Hm, then I have the described case here or am I thinking wrong?

If I would now adjust the extension accordingly, all running Contao instances (<4.9.28) that exclusively install the latest version of the extension would no longer work.

@fritzmg
Copy link
Contributor

fritzmg commented Apr 8, 2022

That's not really an issue. The new version of your extension can just require "contao/core-bundle": "^4.9.28".

@doishub
Copy link
Contributor Author

doishub commented Apr 8, 2022

I thought I could do without this dependency, but then I will implement it that way or wait for the fix. Thank you 🙃

@bytehead
Copy link
Member

bytehead commented Apr 8, 2022

You could also add a conflict with "contao/core-bundle": "4.9.28".

@fritzmg
Copy link
Contributor

fritzmg commented Apr 8, 2022

I thought I could do without this dependency, but then I will implement it that way or wait for the fix. Thank you 🙃

There is no downside to defining your dependency this way.

@doishub
Copy link
Contributor Author

doishub commented Apr 8, 2022

Except that Contao instances which have to run on an older 4.9 (for whatever reason) can't use the extension anymore. I think I will wait for the fix and use a conflict. In the long run the constants will be used in any case.

@fritzmg
Copy link
Contributor

fritzmg commented Apr 8, 2022

Except that Contao instances which have to run on an older 4.9 (for whatever reason) can't use the extension anymore.

Why not? They will automatically get a version of your extension that is compatible.

I think I will wait for the fix and use a conflict.

But for the conflict to take effect you have to create a new version anyway.

@aschempp
Copy link
Member

#4711 fixes the inconsistency

@leofeyer leofeyer linked a pull request May 24, 2022 that will close this issue
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants