Skip to content
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

The Search text fields moved per #215 - now getting errors in log #217

Open
padora-cob opened this issue Aug 10, 2021 · 3 comments
Open

Comments

@padora-cob
Copy link

Notice: Undefined index: id in bos_list_preprocess_form_element() (line 215 of modules/custom/bos_components/modules/bos_list/bos_list.module).

if(strtolower($variables['element']['#title']) === 'search' || $variables['element']['#attributes']['id'] === "edit-title") { $variables['label_display'] = 'after'; $variables['label']['#attributes']['class'] = 'sf-i-l'; }

Will need to add some conditional checks to avoid the errors, we don't see them on higher ENVs because we suppress the error messages.

@padora-cob
Copy link
Author

I don't have perms on this repo, need to move this ticket or re-create it :/

@padora-cob
Copy link
Author

We cannot guarantee that the "$variables['element'][XXXXX]" is available every time this hook runs. Just need to check if the variable we want to check against is available for comparison, if not then bail.

function bos_list_preprocess_form_element(&$variables) { if((isset($variables['element']['#title']) && strtolower($variables['element']['#title']) === 'search') || (isset($variables['element']['#attributes']['id']) && $variables['element']['#attributes']['id'] === "edit-title")) { $variables['label_display'] = 'after'; $variables['label']['#attributes']['class'] = 'sf-i-l'; } }

@padora-cob
Copy link
Author

Also not sure if we are wanting this to change the labels on the admin pages? If so we may want to do the same to all of the admin textfield labels as it is kind of breaking some of the layouts a little.
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant