Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello mantainers,
I'm getting the error message described on title when running cron via drush and the following error message on logs:
Warning: Creating default object from empty value in boxes_box::load() (line 28 of /sites/all/modules/boxes/plugins/boxes_box.inc).
The code is as follows:
public static function load($delta, $reset = FALSE) {
if (!isset(self::$boxes[$delta]) || $reset) {
ctools_include('export');
$box = ctools_export_load_object('box', 'names', array($delta));
if (!empty($box) && $values = array_pop($box)) {
self::$boxes[$delta] = self::factory($values->plugin_key, $values);
self::$boxes[$delta]->new = FALSE; // Line 28
}
}
return isset(self::$boxes[$delta]) && get_class(self::$boxes[$delta]) != 'stdClass' ? self::$boxes[$delta] : NULL;
}
I see that this error was supposedly fixed as described on https://drupal.org/node/1279752. Checked the code and its up to date on dev, which was updated on April 10th, 2013.
Can you give me a lead on what's the problem and/or how to fix it? Thank you for your time.
Comment | File | Size | Author |
---|---|---|---|
#7 | default_object_empty_value-2042101-4.patch | 773 bytes | kenorb |
#4 | default_object_empty_value-2042101-4.patch | 773 bytes | RoySegall |
#3 | default_object_empty_value-2042101-3.patch | 1.49 KB | Anonymous (not verified) |
Comments
Comment #1
mikhailian CreditAttribution: mikhailian commentedI get exactly the same problem in my own profile: 4 times the message
Creating default object from empty value in boxes_box::load() (line 28 of /var/www/tinar/profiles/tinar/modules/contrib/boxes/plugins/boxes_box.inc).
The message is pretty well explain in this StackOverflow thread.
Below is a tiny patch. The syntax requires PHP 5.3+, but it's concise and easy to understand.
Comment #2
mikhailian CreditAttribution: mikhailian commentedComment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedRecreated patch with PHP version check added
Comment #4
RoySegall CreditAttribution: RoySegall at Gizra commentedRe rolling.
Comment #6
kenorb CreditAttribution: kenorb commentedThe same problem here with Boxes 7.x-1.2 when working with OpenPublic.
Comment #7
kenorb CreditAttribution: kenorb commentedComment #9
mqannehPatch #3 worked for me.
Comment #10
Rob858 CreditAttribution: Rob858 commentedPatch #4 worked for me, on OpenPublic distribution (7.x-1.9).
Comment #11
joseph.olstadPatch #4 looks good. Thanks
Comment #12
marcelovaniWhat are we waiting to accept this patch?
Comment #13
joseph.olstad@marcelovani, we're waiting for someone like you to take over ownership of this project. here's the project ownership queue, please create an issue there.
https://www.drupal.org/project/issues/projectownership
look at a few issues in there, you'll see how it's done.