Closed (fixed)
Project:
Panels
Version:
7.x-3.x-dev
Component:
In-Place Editor (IPE)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Jun 2014 at 16:45 UTC
Updated:
5 Sep 2014 at 16:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
cboyden commentedPatch attached.
Comment #2
dsnopekI tested manually and it works great! We've just committed this to Panopoly as well. Marking as RTBC, but I have one super minor code review comment:
While this works, this is a relatively difficult template to read. Personally, I think it'd read better like:
Although, this is really up to the maintainer.
Comment #3
cboyden commentedIf you don't output the image button along with the text button, the UI and the DOM will change, which may cause problems for people who update Panels without updating ctools.
There may be a more readable way to code that in the template though.
Comment #4
dsnopekYeah, my comment wasn't about the functionality - that looks fine! - just the readability of the template. Using curly brackets in templates is a little harder to read than the colon/endif syntax.
Comment #5
japerryGetting there! Committed the ctools patch. As for this one, there are two things I have questions/concerns about:
You say the goal is to have it duplicated, but I guess I don't understand how this would be a good thing. Perhaps throw a else in here?
I agree with dsnopek here, templates should not be using curly braces. See https://drupal.org/coding-standards#controlstruct for more info.
Comment #6
cboyden commentedFor #1: This covers the case where someone is overriding the template panels-add-content-link.tpl.php. They may be depending on the $image_button and $text_button variables being set. There's a bit of complexity here to cover these alternatives:
I don't know why anyone would override that template, as it's internal to Panels. But if they did, and setting the $image_button and $text_button happened inside an else block, that would cause a PHP notice and would break their template. If you think that's an extreme enough edge case I can make the change to an else block.
For #2: I will reroll the template patch using the alternate control statement syntax.
Comment #7
cboyden commentedAlternate control structure for template file. Also reroll to apply to latest dev of add-content.inc.
Comment #8
cboyden commentedUpdated patch to add subtype_class - see earlier commit.
Comment #9
dsnopekPatch looks great to me! Just did some manual testing and it worked fine.
Comment #11
japerryTested good for me as well, Fixed! Thanks dsnopek for the ping :)