-
Notifications
You must be signed in to change notification settings - Fork 39
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
copying field.tpl.php into a custom theme crashes your site #1135
Comments
The PR looks good to fix the problem but it causes a difference from the In
So instead of just deleting $item_attributes in the field.tpl.php, we should change it to:
It's not pretty but it matches the existing code. If we want to clean this up, we can add |
I'm not seeing any difference from |
I applied your suggestion in backdrop/backdrop#1120, but I think it makes the template file (and theme function) unnecessarily cumbersome in the name of flexibility that's never used. So I've created #1352 :) |
Because it was supported in Drupal 7. It looks like RDFa module had used it in the past:
And although we don't have RDFa in core any more, removing variables that had been there previously seems like a regression we don't need to create. However I totally agree that this is ugly and messy. I would suggest that we create a |
It looks like the need to check for all these variables is a remanent of removing template_process_fields(), which defined all of these: https://api.drupal.org/api/drupal/modules!field!field.module/function/template_process_field/7 We should just ensure each of these variables is populated with at least an empty array in our existing template_preprocess_field(). It looks like $title_attributes was also (possibly inadvertently?) removed in the change. |
New PR takes a completely different approach, and defines variables for all the attributes as @quicksketch recommends. |
Super, looks great. Merged backdrop/backdrop#1191 into 1.x and 1.2.x. |
I just got a nasty fatal error when I copied field.tpl.php from core/modules/field/templates/field.tpl.php into my theme:
It looks like the problem is that
$item_attributes
doesn't exist. It's never set intemplate_preprocess_field
, or anywhere else that I can see. Is it supposed to be? If not, why was it ever in here?The text was updated successfully, but these errors were encountered: