3

I created a Low Variable, using a Grid field. One of the Grid columns is an Assets field. It actually all works as supposed to. Except that I get an annoying PHP notice:

Severity: Notice
Message: Array to string conversion
Filename: assets/ft.assets.php
Line Number: 1778

Is there a way to resolve this?

Some example code

{exp:low_variables:pair var="low_var_grid"}     
    {low_var_grid:grid_assets_col}
        <img src="{low_var_grid:grid_assets_col:url}">
    {/low_var_grid:grid_assets_col}
{/exp:low_variables:pair}

Setup

EE 2.9.2
Low Variables 2.5
Assets 2.5

1 Answer 1

5

Okay, this definitely is an Assets issue, but here's a temporary fix.

Open up ft.assets.php and look up the grid_replace_tag method, around line 1771. In there, you can see this line of code:

$field_name = ee()->db->select('field_name')->from('channel_fields')->where(array('field_id' => $this->field_id))->get()->row('field_name');

Below that, add this:

if ( ! $field_name)
{
    $field_name = ee()->db->select('variable_name')->from('global_variables')->where('variable_id', $this->field_id)->get()->row('variable_name');
}

...which should fix the issue.

3
  • Fixes the issue for me to. Apr 9, 2015 at 0:25
  • This fix worked for me too
    – CreateSean
    May 25, 2015 at 13:51
  • Still seems to be an issue with what are currently most recent version of Assets 2.5 on EE 2.10.1. This fix still works though. Thank you for providig this, Low.
    – jthomas
    Jun 15, 2015 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.