-
Notifications
You must be signed in to change notification settings - Fork 7
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
Error when overriding profile.tpl.php #35
Comments
What do you mean by "overwriting"? Overriding? Can you add more specific steps to reproduce? I believe you have Entity Plus enabled (which is not required for this module). I do see some issues in I see another issue, which may also be causing this problem: If you want to try patching your site with those and seeing if that helps, that'd be helpful to pinpoint the problem. |
Yes, overriding I meant. I need Entity Plus for some other module. Thanks, @argiepiano, those changes didn't fix the problem. Steps are easy, just create a profile and try to override profile.tpl.php file within your theme. Accessing the profile page triggers the error. |
Did you try clearing caches after the changes? If so, OK, that means that more debugging is needed. |
yep, cache was cleared. |
Commenting the function profile_entity_info_alter(&$entity_info) in profile.module fixes the error. I have been doing actions on profiles with no problem. Is that hook_entity_info_alter() function used at all? |
|
Actually, what I just sald above is wrong. So, commenting that out will avoid using E+ entity controller for Profiles in your site. This is an acceptable solution in your case. But the bug needs to be found, since it still exists. |
I'm lost with this bug. |
If I had the time I'd try to reproduce ... not right now unfortunately. |
I can reproduce this. Created a profile, then added profile.tpl.php to Basis and cleared caches. Immediate error screen. Now looking into it... |
This problem happens because The solution is simple. We just need to pass the entity under $build += array(
'#theme' => 'profile',
'#profile' => $this,
'#entity' => $this,
'#view_mode' => $view_mode,
'#langcode' => $langcode,
); notice the line I can provide a PR if you want |
If we comment out the change of entity controller (as described above) and then view a user profile, we end up calling However, if we leave the change of entity controller to use E+'s controller, then we don't call that preprocess function; instead, we call
and there is no This seems to be set in
Since
This completely fixed the crash, and the user profile rendered correctly. @argiepiano, based on your considerable entity guru-ship, does this sound like the appropriate change to make Profile module play nicely with E+? |
Hah. Jinx. |
Next time, I won't spend so much time writing up what I found! |
Issue #35: Fix Entity Plus compatibility.
Overwriting profile.tpl.php triggers an error:
I found the same kind of error with paragraphs (backdrop-contrib/paragraphs#91) which has been fixed.
The text was updated successfully, but these errors were encountered: