Hello,

A warning keep appearing in the watchdog:

Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 74 of /opt/difang/prod/qlkaixin/sites/all/modules/views_galleriffic/views_galleriffic.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tripper54’s picture

Version: 7.x-1.0-beta3 » 7.x-1.0

I'm getting the same notices when viewing a gallery (via an attached view) with 7.1.0 except for the line numbers - 92,94,99,103 and 108, eg

Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 108 of C:\xampp\dev\sites\all\modules\views_galleriffic\views_galleriffic.module).

casdesign’s picture

FileSize
31.24 KB

I am also getting a similar error. This is what mine says:

"•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 92 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module).
•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 94 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module).
•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 92 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module).
•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 108 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module).
•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 92 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module).
•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 103 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module).
•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 92 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module).
•Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 99 of C:\xampp\htdocs\drupal\sites\all\modules\views_galleriffic\views_galleriffic.module)."

It seems to show these 8 warnings times the number of images on that page in the gallery. For example, I have one page with 2 thumbnail images, and there are 16 bullet points. Another page only has one image and there are the 8 bullet points above.

I don't know if this is related to the problem, but the large version of the image is covering the prev/next buttons. I attatched a screenshot incase that would help.

I am also using Entity Views Attatch. I would love to be able to use this module as it seems to be the only one I have found that claims to work with combining different nodes into a gallery.

SN00Py’s picture

D0es any 0ne have a s0luti0n t0 this pr0blem i'm getting it als0.

Mores’s picture

Got also the same problem, although the gallery attached to the node functions well.

Mores’s picture

I found a solution. This error tells you the code instantiated a default object (of type stdClass) implicitely. PHP is strict and doesn't accept this, because the $object wasn't created explicitely. The solution to this is rather simple: add the explicit instantiation and it's fixed.

I added 3 lines of code to the views_galleriffic.module file:

$vars['fields'][$object['option']] = new stdClass();
$vars['fields']['thumbnail'] = new stdClass();
$vars['fields']['slide'] = new stdClass();

The code starting @ line 90 should look like:

    // This is to check if the field has an option. If not ignore.
    if (count($object) > 1 ) {
	  $vars['fields'][$object['option']] = new stdClass();
      $vars['fields'][$object['option']]->content = $object['content'];
      if ($object['option'] == 'title_field') {
        $vars['fields']['title']->content = check_markup($vars['fields']['title_field']->content, $format_id = 'full_html', '', $check = FALSE);
        // Slideshow can break if there are spaces or '#' in the title.
        $vars['fields']['title']->stripped = str_replace('#', '', str_replace(' ','', strip_tags($vars['fields']['title_field']->content)));
      }
      if ($object['option'] == 'description_field') {
        $vars['fields']['desc']->content = check_markup($vars['fields']['description_field']->content, $format_id = 'full_html', '', $check = FALSE);
      }
      if ($object['option'] == 'thumbnail_field') {
        if (preg_match('/(src=")(\S+)(")/', $vars['fields']['thumbnail_field']->content, $thumb_url)) {
		  $vars['fields']['thumbnail'] = new stdClass();
          $vars['fields']['thumbnail']->content = $thumb_url['2'];
        };
      }
      if ($object['option'] == 'slide_field') {
        if (preg_match('/(src=")(\S+)(")/', $vars['fields']['slide_field']->content, $slide_url)) {
		  $vars['fields']['slide'] = new stdClass();
          $vars['fields']['slide']->content = $slide_url['2'];
        }
      }
    }

Hope this is useful for other people!

josephcvh’s picture

Hi all,

Im also having this issue. Trying out Mores solution came out less but still have the error.

Anymore solution?

And also how to add image to view galleriffic? Sorry, Im new with drupal.

Thanks,
Joseph

Smokenham’s picture

Hello

I was having the same issue. My error list looked like this:

Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 111 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 105 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 111 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 105 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Notice: Undefined index: slide in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Notice: Trying to get property of non-object in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 93 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Notice: Undefined index: slide in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Notice: Trying to get property of non-object in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).

I followed Mores advice and added in the explicit instantiations and my error list shrank to this:

Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Notice: Undefined index: slide in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Notice: Trying to get property of non-object in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 95 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 100 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views_galleriffic.module).
Notice: Undefined index: slide in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Notice: Trying to get property of non-object in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).

You need to add two more explicit instantiations into the code

$vars['fields']['title'] = new stdClass();
$vars['fields']['desc'] = new stdClass();

it should look like this:

// This is to check if the field has an option. If not ignore.
    if (count($object) > 1 ) {
	  $vars['fields'][$object['option']] = new stdClass();
      $vars['fields'][$object['option']]->content = $object['content'];
      if ($object['option'] == 'title_field') {
		$vars['fields']['title'] = new stdClass();
        $vars['fields']['title']->content = check_markup($vars['fields']['title_field']->content, $format_id = 'full_html', '', $check = FALSE);
        // Slideshow can break if there are spaces or '#' in the title.
        $vars['fields']['title']->stripped = str_replace('#', '', str_replace(' ','', strip_tags($vars['fields']['title_field']->content)));
      }
      if ($object['option'] == 'description_field') {
	    $vars['fields']['desc'] = new stdClass();
        $vars['fields']['desc']->content = check_markup($vars['fields']['description_field']->content, $format_id = 'full_html', '', $check = FALSE);
      }
      if ($object['option'] == 'thumbnail_field') {
        if (preg_match('/(src=")(\S+)(")/', $vars['fields']['thumbnail_field']->content, $thumb_url)) {
		  $vars['fields']['thumbnail'] = new stdClass();
          $vars['fields']['thumbnail']->content = $thumb_url['2'];
        };
      }
      if ($object['option'] == 'slide_field') {
        if (preg_match('/(src=")(\S+)(")/', $vars['fields']['slide_field']->content, $slide_url)) {
		  $vars['fields']['slide'] = new stdClass();
          $vars['fields']['slide']->content = $slide_url['2'];
        }
      }

Now I am only left with these errors:

Notice: Undefined index: slide in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Notice: Trying to get property of non-object in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Notice: Undefined index: slide in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).
Notice: Trying to get property of non-object in include() (line 7 of C:\xampp\htdocs\lelia\sites\all\modules\views_galleriffic\views-galleriffic-view-gallerifficrows.tpl.php).

Will try to fix this later.

Hope this helps someone out there.

iancu35’s picture

@Smokenham; your solution works perfectly in both 7 - release and dev -versions; thks :)
I gues your error derives from 'Galleriffic' row style, e.g.:
- not assinging an image field preset to (slide galleriffic field is set to none), or
- setting one single image field twice: for "thumbnail" and "slide" galleriffic fileds, or
- having the same image preset twice (even you have 2 image fields): for "thumbnail" and "slide" galleriffic fileds

hope it will help
iancu

RaulMuroc’s picture

Status: Active » Needs work

I am really off of time to do it but as soon as I'm free I'll work on patching through @Smokenham solution.

Meanwhile, could somebody make a patch on that?

Thanks in advance.

jibran’s picture

jibran’s picture

Status: Needs work » Needs review

status change

acouch’s picture

Status: Needs review » Closed (duplicate)

Is anyone still having this problem? I believe this was fixed here: #1346966: Notice: Undefined index in line 7

hawkeye.twolf’s picture

Status: Closed (duplicate) » Closed (fixed)

Updating status. This issue is closely related to, but not a duplicate, of #1346966: Notice: Undefined index in line 7.

The patch that fixed this issue still needs to be committed (after updating line numbers to reflect the latest release code). I created #1773972: Committing two patches instead of re-opening this issue.

acouch’s picture

Status: Closed (fixed) » Needs review
hevilp’s picture

is this bug solved or not?

Ahigh4life’s picture

tried the patch.....Working

sacha05’s picture

I confirm; #10 worked for me.

LeeHle’s picture

Hey...

Could someone please help me.
And I don't know how to fix it as I'm a drupal newbie. Please could someone help me? Or let me know where to plugin the PFA patch that's seemed to have solved most of your errors.

jibran’s picture

Please clone the module using http://drupal.org/node/498690/git-instructions/7.x-1.x using "Setting up repository for the first time" section. Download the patch in #10. Place in your cloned views_galleriffic folder and apply the patch by using "Applying a patch" section.
The longer and detailed version can be found here http://drupal.org/node/620014.

LeeHle’s picture

Thank you so much I'll check it out and let you know how it goes :)

LeeHle’s picture

thank you so much it works :)

pcaplan’s picture

I'm posting this here because I was using the wonderful tutorial by acouch, Step by Step Instructions for Views Galleriffic in Drupal 7. He said if you had problems to open an issue here. Rather than opening an issue, I found this issue describes my problem.

Everyone who commented on the tutorial said it worked wonderfully, but I got this "Strict warning" message. I don't understand why I get the message when I'm following the steps completely and other people didn't get it.

Is there any way around the message besides installing the patch?

nguy3ndk’s picture

Cool, It's good

sui_page’s picture

I keep getting:

Checking patch views_galleriffic.module...
error: while searching for:
    }
    // This is to check if the field has an option. If not ignore.
    if (count($object) > 1 ) {
      $vars['fields'][$object['option']]->content = $object['content'];
      if ($object['option'] == 'title_field') {
        $vars['fields']['title']->content = check_markup($vars['fields']['title_field']->content, $format_id = 'full_html', '', $check = FALSE);
        // Slideshow can break if there are spaces or '#' in the title.
        $vars['fields']['title']->stripped = str_replace('#', '', str_replace(' ','', strip_tags($vars['fields']['title_field']->content)));
      }
      if ($object['option'] == 'description_field') {
        $vars['fields']['desc']->content = check_markup($vars['fields']['description_field']->content, $format_id = 'full_html', '', $check = FALSE);
      }
      if ($object['option'] == 'thumbnail_field') {
        if (preg_match('/(src=")(\S+)(")/', $vars['fields']['thumbnail_field']->content, $thumb_url)) {
          $vars['fields']['thumbnail']->content = $thumb_url['2'];
        };
      }
      if ($object['option'] == 'slide_field') {
        if (preg_match('/(src=")(\S+)(")/', $vars['fields']['slide_field']->content, $slide_url)) {
          $vars['fields']['slide']->content = $slide_url['2'];
        }
      }

error: patch failed: views_galleriffic.module:89
error: views_galleriffic.module: patch does not apply

when I try and install the patch. What am I doing wrong? I've just moved a site from my dev server to my localhost and all of sudden this errors popped up.

sui_page’s picture

I stopped getting this error by simply uploading a default placeholder image into my content type field

absoludo’s picture

For those interested, the patch #10 did not apply for me on 7.x-1.1 because of different row numbers.
I created a newer patch based on the sollution given in #10.

PalaDolphin’s picture

I'm getting these same warning messages. But, here's the strange thing: I performed the installation and followed Step by Step instructions from https://drupal.org/node/1578774 on three Drupal 7.23 installations at the same time; a live, alpha, and localhost (laptop). Only the localhost is failing; The live and alpha sites work fine. Very strange.

schmook’s picture

I had this issue crop up on an existing site. The host upgraded their account to PHP 5.4. After switching back to PHP 5.3 the errors went away.

Hopefully, this may help someone...

PalaDolphin’s picture

It's not a 5.4 issue for me:

PHP version 5.3.27

I will try to apply the above patch, but since this only happens on my laptop's localhost and not live, I'm delaying it until I evaluate other picture modules. There's other things I'm not satisfied with when it comes to Galleriffic.

Sk8erPeter’s picture

@PalaDolphin: it's not so strange, the output of these error messages may depend on at least three things:

  1. PHP version: E_STRICT became part of E_ALL above 5.4.0 (http://php.net/manual/en/function.error-reporting.php). This means "Strict warnings" do not get displayed with error_reporting(E_ALL); under PHP versions 5.4.0.
  2. error_reporting settings: e.g. E_ALL|E_STRICT or just E_ALL or others... E.g. with PHP 5.3, strict error messages only get displayed with E_ALL|E_STRICT setting, but no strict messages get output with E_ALL. But as I mentioned, above 5.4.0, E_STRICT is part of E_ALL.
  3. the "Error messages to display" setting on admin/config/development/logging (Administration » Configuration » Development » Logging and errors): there are 3 possible options for "Error messages to display":
    1. None
    2. Errors and warnings
    3. All messages

    But - as the text suggests - "It is recommended that sites running on production environments do not display any errors."

PalaDolphin’s picture

Title: Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() » Ah, I see!

But - as the text suggests - "It is recommended that sites running on production environments do not display any errors."

Yah think?

I misspoke (or mis-typed) before regarding my PHP version.

Live is running PHP version 5.3.27.
Localhost (laptop) is running PHP Version 5.4.4.

That is why only localhost is reporting warnings.

Now, if I could just translate what Sk8erPeter said into coxing localhost to turn off those infernal warnings, I'd be a happy clam. I'm not really interested in the code change solutions right now, since I'm only evaluating photo gallery modules.

Got it! Setting Error logging to None avoids the warnings. I'll have to remember to turn this back on when I start developing modules.

Thank you Sk8erPeter for your help.

tripper54’s picture

Title: Ah, I see! » Strict warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows()

Changing the issue title back.

tjtj’s picture

Issue summary: View changes

This is still (just) happening for me. Everything is up to date:

Warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 104 of /home5/briarcli/public_html/new/sites/all/modules/views_galleriffic/views_galleriffic.module).

The fixes described here worked, but why aren't they incorporated into the distribution versions? Even the development version has this bug.

mhamed’s picture

OK
#26
fixed the problem of :

Warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 104 of ...sites/drupal7/sites/all/modules/contrib/views_galleriffic/views_galleriffic.module).

and other 12 errors of the same kind
with drupal 7.34
views_galleriffic 7.x-1.x

thanks for the work

roderik’s picture

Thanks all.

roderik’s picture

Status: Needs review » Reviewed & tested by the community

OK what I meant to do was set RTBC.

modulist’s picture

Version: 7.x-1.0 » 7.x-1.1
Status: Reviewed & tested by the community » Active

I ran into a similar warning using the views_galleriffic 7.x-1.1:

warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() line 104.

The module did not throw any errors in a development environment running PHP 5.3.6-13ubuntu3.10. However, the errors surfaced when I migrated the site to a local environment running 5.5.18.

I applied the patch #26 https://www.drupal.org/files/views_galleriffic-strict_warnings-1208298-2... and the errors went away. However, the latest released version of the module does not appear to resolve the issue for PHP 5.5 without the patch.

roderik’s picture

Status: Active » Reviewed & tested by the community

That's exactly right. Status "Reviewed & tested by the community" means that the patch has not been committed yet to the module, but has been tested and reviewed enough that it should be.

kingfisher64’s picture

thanks roderik that worked lovely against the stable version.

Can we have this committed by the maintainer into a new version?

Thank you

Aezarien’s picture

I tried #10 and I got an error which said the patch did not apply. I tried #26 and it seemed to apply without issue. I am still getting the same warnings, however. Additionally, I can see a slideshow now, but instead of seeing the four images I uploaded, it repeats the first one I uploaded. Is it necessary to go through the process of creating the content type again? Could this be why I am still seeing the errors?

Aezarien’s picture

Der... I have never worked with patches before so I went with the assumption that if it worked for everyone else, I had to be doing something incorrectly. I was working in root directory with a clone and didn't copy to the modules directory in drupal. Otherwise, #26 worked and was magnificently easy to apply. I just wasn't paying attention to what I was doing. The other error was due to a mistake in my initial configuration in views. It's all up and running perfectly now. Thanks y'all.

Veshalen27’s picture

#26 worked beautifully.

greenmana3’s picture

Patch from Comment #37 worked perfectly. Thank You!

waqarit’s picture

patch #10 has worked for me. thanks Jibran

meno1max’s picture

Still having this problem, with Drupal 7.43 and Views Galleriffic 7.x-1.1:

Warning: Creating default object from empty value in template_preprocess_views_galleriffic_view_gallerifficrows() (line 115 of /home/myaccount/public_html/mysite.eu/sites/all/modules/views_galleriffic/views_galleriffic.module).

Server is running PHP 5.6.19

After all these years, aren't the patches above already included in Views Galleriffic?

steven.be’s picture

#26 solves the error messages for me! Thank you absoludo!!

darvanen’s picture

Works well... let's get it committed.

If @acouch isn't around any more, does anyone here fit the criteria to apply for maintainer status and want to do so? I would, as the module is quite small, but this is my first interaction with the issue queue for this module.

GeorgeLangley’s picture

Hi everyone. casdesign's fix is on the right trail, but was missing some "new stdClass()" lines. The following DOES work (Drupal 7.38, Vews 7.x-3.11, Views Galleriffic 7.x-1.1)

// This is to check if the field has an option. If not ignore.
if (count($object) > 1 ) {
$vars['fields'][$object['option']] = new stdClass();
$vars['fields'][$object['option']]->content = $object['content'];
if ($object['option'] == 'title_field') {
$vars['fields']['title'] = new stdClass();
$vars['fields']['title']->content = check_markup($vars['fields']['title_field']->content, $format_id = 'full_html', '', $check = FALSE);
// Slideshow can break if there are spaces or '#' in the title.
$vars['fields']['title']->stripped = str_replace('#', '', str_replace(' ','', strip_tags($vars['fields']['title_field']->content)));
}
if ($object['option'] == 'description_field') {
$vars['fields']['desc'] = new stdClass();
$vars['fields']['desc']->content = check_markup($vars['fields']['description_field']->content, $format_id = 'full_html', '', $check = FALSE);
}
if ($object['option'] == 'thumbnail_field') {
if (preg_match('/(src=")(\S+)(")/', $vars['fields']['thumbnail_field']->content, $thumb_url)) {
$vars['fields']['thumbnail'] = new stdClass();
$vars['fields']['thumbnail']->content = $thumb_url['2'];
};
}
if ($object['option'] == 'slide_field') {
if (preg_match('/(src=")(\S+)(")/', $vars['fields']['slide_field']->content, $slide_url)) {
$vars['fields']['slide'] = new stdClass();
$vars['fields']['slide']->content = $slide_url['2'];
}
}
}
}
// Allow for empty fields that didn't already get defined.

darvanen’s picture

Thanks George, would you like to roll that as a patch so it can go through automatic testing?

broon’s picture

Recently switched from PHP 5.5.9 to 7.0.4 and this error message appeared. Patch in #26 resolved the issue.