-
Notifications
You must be signed in to change notification settings - Fork 41
Open
backdrop/backdrop
#5072Milestone
Description
Description of the bug
Backdrop does a great job of preventing use of field_name machine name for new fields once Paragraphs is installed, whether for paragraph types or for nodes. However, if you've already created a field with machine name of field_name then you are not prevented from re-using that field on a paragraph type.
This was first raised in the paragraphs issue queue but actually is wider
Steps To Reproduce
To reproduce the behavior:
- Start with a site without Paragraphs
- Add a field to a content type with label of "Name" and allow the field machine name to be saved as field_name
- Install Paragraphs
- Create new paragraph type
- Add the field_name field to the paragraph type
- Add a paragraphs field to a content type
- Create a new item of that content type
- Enter some data (not paragraph) and save
- Re-edit and add the paragraph
- Save the node
Actual behavior
Fatal error:
TypeError: Cannot access offset of type string on string in _field_invoke() (line 193 of /var/lib/tugboat/backdrop/core/modules/field/field.attach.inc).
Expected behavior
Node saves, but actually, re-using an existing field with field_name on a paragraph type should be prevented at Step 5
Additional information
Add any other information that could help, such as:
- Backdrop CMS version: 1.30.2
- Web server and its version: n/a
- PHP version: n/a
- Database sever (MySQL or MariaDB?) and its version: n/a
- Operating System and its version: n/a
- Browser(s) and their versions: n/a
avpaderno