Low Variables - error displaying Dropdown field within Grid field
I'm using some Grid fields in Low Variables 2.4, EE 2.7.2.
Any field types I've tried work fine except for the Dropdown fieldtype.
Once I try to display any Dropdown field I get the following error:
---------------------
A PHP Error was encountered
Severity: Notice
Message: Undefined property: EE::$typography
Filename: select/ft.select.php
Line Number: 97
Fatal error: Call to a member function parse_type() on a non-object in [path to system]/expressionengine/fieldtypes/select/ft.select.php on line 97
----------------------
The code I'm using in my template is as follows, where my grid field is called HOME_BOXES and my dropdown column is called colour:
----------------
{exp:low_variables:parse var="HOME_BOXES"}
Dropdown value: {HOME_BOXES:colour}
{/exp:low_variables:parse}
----------------
Thanks for your time.
Replies
Low 13 Nov 2013 16:25
Technically, this would be a Grid issue instead of a LV one. But it can be fixed within LV. Open up /low_variables/types/low_grid/vt.low_grid.php and look up line 179, which reads:
Change that into:
...which should fix it.
Tidy 13 Nov 2013 16:36
Many thanks for the instant fix Low! :)
Dropdown fields in Grid fields outside of LV work fine, so that's why I had thought it was LV related.
When you say it's a Grid issue, should I report this as an EE bug, or is it more a case that EllisLab aren't catering sufficiently for 3rd party add-ons which make use of the Grid field?
Thanks again
Low 13 Nov 2013 16:42
Well, it is kinda LV related. LV is the first 3rd party addon that uses Grid as a non-channel content type. That's a feature EllisLab rolled into 2.7. I've worked with EL to get this working, but there will always be things that we miss first time round.
Basically, this error is because the Typography library wasn't loaded in the field type that is in the Grid. For Channel entry types, that library is already loaded. But for any other entry types, that may not be the case. So they need to explicitly load it. LV shouldn't do this, because it cannot know which libraries/dependancies need to be loaded for each variable type.
If EL want to follow through on their non-channel entry types, then their fieldtypes need to cater for that as well, including the dropdown field. So they shouldn't assume any library they use is loaded already. An EE bug report would therefore be appropriate, yes.
Tidy 13 Nov 2013 17:16
Thanks for going to the trouble of explaining this Low.
When I searched the bug tracker prior to filing a bug for this, I realised that this bug is already there and marked as fixed in the next release
https://support.ellislab.com/bugs/det...
Thanks again for your help on this.