2 years ago
2
Topic

Hello

I created a select dynamic field in free mode with a $uri->getValue('id') in the where statement. This select dynamic field is used in the ADMIN FORM.

it works if we EDIT an existing content but CRASHES with create a new one (since the id hasn't been created yet).

So I added a Workflow restrinction plugin on the select dynamic so that the field is only active when we edit the content.

However at the creation time the field still crashes because the SQL query is interpreted anyway BEFORE the restriction plugin !

How can I deactivate the field so that the SQL query is ignored when we first create the content please ?

thanks

cyril

Get a VIP membership
215 Posts
iliil
2 years ago
1
Level 1

Hi Cyril.

Just put $uri->getValue('id') into the quotes like this '$uri->getValue('id')' so you won't get MySQL error on empty value and keep the workflow restriction.

I must say I agree with you, it would be ideal if the field was disabled before it's beeing prepared.

Best

Mihal

2 years ago
0
Level 2

thanks Mihal for this solution


cyril

Get a VIP membership