Needs review
Project:
Simplenews
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2013 at 13:27 UTC
Updated:
17 Dec 2017 at 12:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirThe reason is that we do not want the default node template markup just like we don't want the default field markup.
A possible solution could be to only remove it only if has the default values and to assume that "you know what you're doing" if not.
Comment #2
miro_dietikerThat sounds like a great idea.
Comment #3
andrewbelcher commentedI suppose that comes with the risk of other modules doing something iffy. Would having some kind of hook for modules to register themselves with if they properly handle things be sensible? I suppose there is a balance of avoiding conflicts and allowing the use of other modules...
Comment #4
berdirThere isn't really a reason to replace the #theme property of e.g. a node unless you are panelizer or display suite I think. So IMHO, we can safely assume that if this happens, it happens for a reason.
field #theme functions might be a bit different.
However, it is IMHO fine to go with this for 7.x-2.x and then check if users report any bugs/issues about it. Using a hook or something would require that those modules explicitly integrate with simplenews and that's always a bit tricky (where does that code live and so on).
Comment #5
andrewbelcher commentedOk, so here is a patch that should solve it. I suggest we want the 2nd one unless I'm wrong about my assumption that the default entity theme uses the entity type...
Comment #6
rlmumfordThe 'any-entity' stuff is progressing quite quickly, so I would definitely go with the second patch.
Does this need to include a check for whether the #theme is 'entity' or is the use of entity.tpl.php controlled by the template suggestions?
Comment #7
rlmumfordComment #8
berdirYes, I think it should check for both 'entity' and getEntityType(). entity types that rely on entity.module usually use #theme entity and then work with template suggestions (entity__$entity_type) if they need a custom template but #theme should always be entity.
Comment #9
andrewbelcher commentedOk, that's updated!
Comment #10
rlmumfordI feel like this should have a comment explaining the thought process of only unsetting it if it's the default.
Comment #11
andrewbelcher commentedOk, here's with some documentation!
Comment #12
rlmumfordLooks good to me!
Comment #13
berdirAgreed, commited and pushed.
Display Suite might need a different check as that AFAIK keeps #theme node. But we can deal with that separately.
Comment #16
Olivier Beerens commentedDoesn't work with simplenews 7.x-1.1
Comment #18
osopolarBackport to version 7.x-1.x-dev.
Comment #19
jsacksick commentedI'm also wondering why we need to get rid of the default node template?
I'm customizing the node template (Putting html around fields, embedding views via a preprocess_node function) for both the email version and the node full page.
I'm attaching a patch that removes the unset line for the 1.x version (I guess this won't be committed but I need it on d.o for my make file, and this could be useful for other users).
Comment #20
osopolar@jsacksick: Are using Panelizer? I guess the unsetting is necessary for those not using Panelizer but want to set a theme different to the default theme. Did the patch in #18 not work for you? As it is the backport it would be more likely to get it in and even more if it gets reviewed.
Comment #21
candelas commentedThanks @osopolar , patch in #19 works.
Please @Berdir add this to 7.x-1.x-dev :)
Since you are very busy with D8 I don't think you will have time for 7.x-2.x-dev and it will make it easy for future port to D8.
By the way, a good opportunity to say thanks for all your generous code sharing in Drupal ;)