Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
rdf.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Feb 2010 at 17:52 UTC
Updated:
22 Sep 2012 at 00:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedForgot tag
Comment #2
Anonymous (not verified) commentedChecks whether $variables['content'] or or $variables['user_profile'] is set and attaches the #prefix value to the correct variable.
Comment #3
scor commentedWe are hard-coding things. We should check to see if this missing 'content' key is expected or if it's a bug in the user module. What other modules/entity do we need to add to this list? It would be better if we could standardize on 'content', or at least forsee what are the other special cases...
leaving status "needs review" hoping to get feedback on this.
Comment #4
Anonymous (not verified) commentedThe offending code is in user.pages.inc
Comment #5
scor commentedLooks like this is a common pattern in HEAD:
We should check whether it would make more sense to standardize on
$variables['content']or if there is a valid reason for having a different key name here (which looks like the hook name).Comment #6
Anonymous (not verified) commentedStandardizing on 'content' would require a lot of changes in the theme layer. Since it seems to be standardized on hook name already, this patch uses that.
Comment #7
Anonymous (not verified) commentedActually, this breaks it in comment, so nevermind.
Comment #8
Anonymous (not verified) commentedComment and node are the only ones that use 'content' for their template variable. If all others use the hook name, we may want to see if those could be standardized to use hook name rather than the other way around.
Comment #9
scor commentedmaking title more generic
Comment #10
Anonymous (not verified) commentedIf the variable is either 'content' or the theme hook name, this patch would be an alternate option to standardizing. Same patch as #2, it checks whether 'content' is set and if not, sets the variable name to the theme hook name.
Comment #11
Anonymous (not verified) commentedChanging title because it does work for preprocess_node and preprocess_comment.
Comment #12
effulgentsia commentedsubscribing for review later.
Comment #13
effulgentsia commentedThis is great. Let's make the test a little more robust by checking that 'content' is both not empty and an array. We should apply the same test to $hook, and if that also fails, then we don't have any render array variable to apply metadata to, so not get into the if block.
Also, what do you think of $content_variable instead of $variable_name?
Why different indentation of replacement code?
This review is powered by Dreditor.
Comment #14
effulgentsia commentedAlso, if there is a real use-case of user_profile needing metadata, please include that in this patch, along with a test for it, so the fix in this patch gets some test coverage. Thanks!
Comment #15
Anonymous (not verified) commentedThanks for the review, I just noticed that there were new comments on this yesterday.
Great comments, I incorporated them all. We solved the problem in the case of user_profile by just adding the RDF in a meta tag, but I use that as the test case in the tests.
Comment #16
Anonymous (not verified) commentedComment #17
Anonymous (not verified) commentedNew and improved! (with less whitespace thanks to the new version of Dreditor)
Comment #18
effulgentsia commentedAwesome. Thanks! Tiny nit:
s/else if/elseif/
143 critical left. Go review some!
Comment #19
Anonymous (not verified) commentedThanks, fixed now.
Comment #20
effulgentsia commentedThanks!
Comment #21
realityloop commented#19: rdf_process-user_702664_19.patch queued for re-testing.
Comment #22
marcingy commented#19: rdf_process-user_702664_19.patch queued for re-testing.
Comment #23
dries commentedThis patch no longer applies. Needs a reroll so moving to 'needs work'.
Comment #24
marcingy commentedReroll against head.
Comment #25
marcingy commentedhadn't updated head above patch will fail.
Comment #26
Anonymous (not verified) commentedThis should hopefully no longer be an issue once #1778226: [META] Fix RDF module is completed.