Send missing variables to the TIMS template#29
Open
mfairchild365 wants to merge 2 commits intounlcms:7.x-1.xfrom
Open
Send missing variables to the TIMS template#29mfairchild365 wants to merge 2 commits intounlcms:7.x-1.xfrom
mfairchild365 wants to merge 2 commits intounlcms:7.x-1.xfrom
Conversation
…d to the template
Member
|
Did you happen across something without a 'pattern' defined? Without looking into it, I would assume there would always be a pattern. |
Author
|
Yeah, there are plenty of cases where a pattern is not defined. |
Member
|
Ah, of course. I think it would be ok to do it with everything. There's at least one thing in there that we'd want merged: 'field' since we did stuff with unl_four_preprocess_field that's not currently being respected due to this issue. |
Use the logic found in the drupal theme() function as a guideline here. This should handle specificity issues.
Author
|
@ericras I've updated the pull request to include hooks without patterns and to also find the most generic hook to merge, using the logic from the drupal |
Author
|
@ericras is this still relevant? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've descovered, and I know @ericras has too, that not all variables make it to the TIMS template. A specific example of this is the
views_viewtemplate seen here: https://api.drupal.org/api/views/theme!views-view.tpl.php/7In TIMS, none of those contextual variables are available, which makes the template useless.
I've discovered that this is because of the way that we are altering the theme registry.
The theme registry has an item for
views_viewwhich is as follows:Then, the TIMS module adds its own entry like this:
Thus, we have lost the process and preprocess hooks along with other important information.
So, this change merges the two so that it becomes:
I'm not very familiar with how all of this works, and I'm not quite sure how to know which entry to merge in the case where there are multiple hook patterns that match. I'm also only doing this for entries with patterns, but I think it should be okay to do it to everything?
Any thoughts/feedback is welcome.