Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello Team,
I am facing an issue when we hide the node title being hidden from form, and save. Drupal throws error.
Steps to reproduce
- Go to "admin/structure/types/manage/article/form-display"
- Move "title" to disabled OR Select hidden from title widget settings
- Go to "node/add/article"
- Try to create a node, and you will land on an error screen.
Attaching screenshots.
Happy to help and provide any further info.
Comment | File | Size | Author |
---|---|---|---|
#7 | hiding_title_from_form-2801283-7.patch | 1.18 KB | scott_euser |
#3 | Screen Shot 2017-01-25 at 11.39.45 AM.png | 145.92 KB | navneet0693 |
#3 | Screen Shot 2017-01-25 at 11.39.27 AM.png | 145.19 KB | navneet0693 |
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedPlease share the error. It is best put in the issue summary in full, and perhaps the essential part in the title. For example:
"Hiding title from Form Display throws FooBarException when adding a node"
Comment #3
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedI am able to reproduce the issue. Updated summary.
Comment #4
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #5
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #6
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedIn this case I think we need to add validation to the 'Manage form display' screen.
Reasoning:
Title is a required field and cannot be made not required as the node table in the database also requires it.
Proposal:
Add an additional validation to 'Manage form display' to throw an error when the title field is not enabled.
I was unable to switch the title field to use a hidden widget: perhaps not allowed in 8.4.x-dev or perhaps a contrib module is being used that offers that option?
Comment #7
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedI think this should be specific to node like the attached patch as other entities may not have the title as a required column in the database.
Comment #9
scott_euser CreditAttribution: scott_euser as a volunteer and at Fat Beehive commentedHmmm patch says pass, changing back to needs review.
Comment #10
cilefen CreditAttribution: cilefen commentedI am marking this a duplicate of an issue with more comments. Please continue there.