Error/Warning in theme.inc after upgrade php - 7.1.9

FrancescoR's picture
FrancescoR
Fri, 09/15/2017 - 14:42
#1
Error/Warning in theme.inc after upgrade php - 7.1.9

Hello

after making the progress of php 7.1.9

I received a bug in theme.inc

three warning for each result...

  • Warning: Illegal string offset 'md_row_height_flag' in template_preprocess_md_portfolio_mdp_plugin_rows() (linea 348 di /sites/all/modules/md_portfolio/templates/mdp/theme.inc).

  • Warning: Illegal string offset 'md_row_height' in template_preprocess_md_portfolio_mdp_plugin_rows() (linea 352 di /sites/all/modules/md_portfolio/templates/mdp/theme.inc).

  • Warning: Illegal string offset 'md_row_height_flag' in template_preprocess_md_portfolio_mdp_plugin_rows() (linea 360 di /sites/all/modules/md_portfolio/templates/mdp/theme.inc).

the code in question is this:

$md_data['options'] = $options;
 
  if (!isset($md_data['options']['md_row_height_flag'])) {
    $md_data['options']['md_row_height_flag'] = '1';    // LINE 348
  }
 
  if (!isset($md_data['options']['md_row_height'])) {
    $md_data['options']['md_row_height'] = 300;       // LINE 352
  }
 
  $wdt_json = drupal_json_encode($md_data['options']);
  drupal_add_js(array(
    'md_row' => $wdt_json,
  ), array('type' => 'setting'));
 // LINE 360 ↓
  if ($md_data['options']['md_row_height_flag'] == '0') {
    $row_style = 'style="height: ' . $md_data['options']['md_row_height'] . 'px;"';
  }
  else {
    $row_style = '';
  }

Is it possible to adjust with a PATCH?

thank you

Franceso

cindy's picture
cindy
Sat, 09/23/2017 - 03:59

Hi,

Are you using the latest version? Please update the newest one

https://megadrupal.com/user/francescor

FrancescoR's picture
FrancescoR
Sat, 09/23/2017 - 08:28

Hello Cindy,

I installed the latest version but the error persists, it has just moved four rows!

  • Warning: Illegal string offset 'md_row_height_flag' in template_preprocess_md_portfolio_mdp_plugin_rows() (line 352 of /sites/all/modules/md_portfolio/templates/mdp/theme.inc).

  • Warning: Illegal string offset 'md_row_height' in template_preprocess_md_portfolio_mdp_plugin_rows() (line 356 of /sites/all/modules/md_portfolio/templates/mdp/theme.inc).

  • Warning: Illegal string offset 'md_row_height_flag' in template_preprocess_md_portfolio_mdp_plugin_rows() (line 364 of /sites/all/modules/md_portfolio/templates/mdp/theme.inc).

P.S. if it can help

after upgrade from php 5 to 7 I received other errors from other modules, fixing with patches from the drupal community

example

https://www.drupal.org/node/2865906

https://www.drupal.org/node/2843367

thanks for support.
Francesco.

cindy's picture
cindy
Mon, 09/25/2017 - 00:14

Hi,

Please send us your website url, admin and FTP account account to check this issue

FrancescoR's picture
FrancescoR
Thu, 04/12/2018 - 12:27

Hi Cindy,

I installed the module on an online site and I created an ftp account:

PS in Load Content: Full page

the photobox module gallery images and audio sound manager 2 player no longer works,

i think i do not load javascript .... do you know how i can solve it?

Thanks again.

Francesco.

cindy's picture
cindy
Mon, 09/25/2017 - 23:26

Hi,

We fixed your issue already

Please check

FrancescoR's picture
FrancescoR
Tue, 09/26/2017 - 08:52

Thank you for solving the problem!

there is a way to work audio sound-manager2 and photobox image player

within md portfolio in full page view?

how can I fix it?

Thanks for all.

cindy's picture
cindy
Wed, 09/27/2017 - 01:11

Hi,

We check and see that you used css and js library for sound-manager2 and photobox image player already.

Now you need to change html structure or add script which runs sound-manager2, photobox.

When you click the link to show detail portfolio page, your website will call ajax to load the node content

function callback is md_portfolio_load_content, you can add js to variable $content_view

If you want to change html structure. you can follow the instruction above or override file template node.tpl.php properly

FrancescoR's picture
FrancescoR
Wed, 09/27/2017 - 09:33

Hi Cindy

I added the .js and .css libraries using the md_portfolio_library function

the problem with sound-manager2 is resolved.

However, the issue with the photobox persists, in the header there are the two js

jquery.photobox.js

photobox.js

with firebug I noticed that DOM is not modified by jquery.photobox.js as it does with the node, so i assume jquery.photobox.js does not run properly.

I tried in many ways but I did not solve it!! I do not have the necessary skills.

you could kindly help me, the solution should not be far away!

Thank you again

cindy's picture
cindy
Wed, 09/27/2017 - 23:50

Hi,

jQuery only selects DOM of the page when that page is completely loaded. Other DOMs, which are added after loading page, are only selected if you call function jquery one more time, (usually when ajax is fully loaded.)

As we mentioned above, you can add js to function md_portfolio_load_content

Now, we fixed your issue already

Please check!

FrancescoR's picture
FrancescoR
Thu, 09/28/2017 - 07:35

Hi Cindy,

I saw your change to md portfolios load content!

Thanks a lot, now it's perfect.

"May the Force be with you"

skobe's picture
skobe
Sun, 11/03/2019 - 06:31

Hi there,

could you be so kind and make the solution to this problem public? I'm getting the same error and would love to see the actual patch here. Best, Jesko

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.