- π¦π·Argentina abelpzl
I had the same problem without using the Layout Builder module and I solved it by applying #2.
Can someone merge this? how can I help? - Status changed to RTBC
12 months ago 7:36pm 26 November 2023 - Status changed to Needs review
12 months ago 8:00pm 26 November 2023 - Status changed to RTBC
12 months ago 6:07am 28 November 2023 - πΊπ¦Ukraine cosolom
@abramm why you don't want to merge this code? It's not new logic or condition. This is a simple additional part how a good PHP code should have. You can't just check element of array with ! sign if you don't really know if this variable exists. You can use !empty or (isset & have value) or ?? for set default value for suppress PHP warning. It should't even be covered with tests.
- πΊπ¦Ukraine abramm Lutsk
Hi cosolom,
Please don't change the status to RTBC as there are no community reviews; you've changed the status for your own code.
As for the approach you've taken, the problem is that you've fixed the symptom rather than root cause of the issue; the
unique
setting should be always present for the field. Not having it is likely a problem and the way you've fixed it is just by ignoring it.I appreciate your patch and I'd like to keep it here so people could use it as workaround if they happen to have the same issue but unfortunately that's not the fix for a root cause.
- Status changed to Needs review
12 months ago 9:33pm 4 December 2023 - πΊπ¦Ukraine cosolom
I think that even
unique
setting is missed - we can add error message to log and don't break Ajax request at all. This will increase stability for the project.