Download & Extend

Wrapper of fields, is printed even if it has no value

Project:Drupal Commerce
Version:7.x-1.x-dev
Component:Product reference
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi people, i notice that wrappers of fields are always printed, even if it has no value. This cause themeing issues, since div exists.
I know there might be an issue, since if i switch to a second color, this one might have a value while the other does not. But it would be very helpfull to have, at least, an extra class on empty wrapper.....like "empty".
Then it would be solve like -> div.commerce-product-field.empty {display: none;}

thanks for everything.

Comments

#1

Category:bug report» feature request
Priority:major» normal
Status:active» needs review

These wrapping divs are always rendered because they are actually necessary for dynamic value replacement – say, when you switch your color attribute. It would be nice however to have some context as to when the product field is empty, as you described for CSS purposes.

AttachmentSizeStatusTest resultOperations
empty-product-field-classes-1570058-1.patch4.01 KBIdlePASSED: [[SimpleTest]]: [MySQL] 3,567 pass(es).View details

#2

Excellent helior, it works perfect. Many thanks for this patch and this module =)

#3

has no success patching.
#1: empty-product-field-classes-1570058-1.patch queued for re-testing.

#4

actually i tried patching against the dev version

#5

Version:7.x-1.3» 7.x-1.x-dev

changed version and recreate the patch. it seems it's working

AttachmentSizeStatusTest resultOperations
empty-product-field-classes-1570058-5.patch3.51 KBIdlePASSED: [[SimpleTest]]: [MySQL] 3,589 pass(es).View details

#6

Status:needs review» reviewed & tested by the community

#7

Component:Product» Product reference
Status:reviewed & tested by the community» fixed

Trimmed a little from the patch and committed! Thanks.

Commit: http://drupalcode.org/project/commerce.git/commitdiff/c98eca8

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.