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

Add ConfigOptionToParameterRector #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zoglo
Copy link
Contributor

@zoglo zoglo commented May 8, 2024

Description

Old:

'screenshot' => [
    'exclude' => true,
    'inputType' => 'fileTree',
    'eval' => ['fieldType'=>'radio', 'filesOnly'=>true, 'isGallery'=>true, 'extensions'=>Contao\Config::get('validImageTypes')],
    'sql' => "binary(16) NULL"
],

New:

'screenshot' => [
    'exclude' => true,
    'inputType' => 'fileTree',
    'eval' => ['fieldType'=>'radio', 'filesOnly'=>true, 'isGallery'=>true, 'extensions'=>'%contao.image.valid_extensions%'],
    'sql' => "binary(16) NULL"
],

Test

image

@aschempp
Copy link
Member

aschempp commented May 8, 2024

I'm not sure this is correct. We can only replace the config option with a parameter where it is expected to work, e.g. in the DCA config. If my custom code retrieves this value, we cannot replace this with a string, it would break everything?

@zoglo
Copy link
Contributor Author

zoglo commented May 9, 2024

Same as #8 (comment) - Might need to limit it to specific arrays and entry types (array keys) to change the value.

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.

None yet

2 participants