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. I'm getting several PHP errors when using the SingleFrame module in a block. Here are the errors:
Notice: Undefined variable: controls_top in include() (line 10 of views_slideshow/contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php).
Notice: Undefined variable: pager_top in include() (line 10 of views_slideshow/contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php).
Notice: Undefined variable: image_count_top in include() (line 10 of views_slideshow/contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php).
Notice: Undefined variable: controls_bottom in include() (line 20 of views_slideshow/contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php).
Notice: Undefined variable: pager_bottom in include() (line 20 of views_slideshow/contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php).
Notice: Undefined variable: image_count_bottom in include() (line 20 of views_slideshow/contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php).
I'm attaching a patch that puts an isset() around each variable, which alleviates the error. I'm not sure why the error is happening; I thought that if you call a variable and it isn't set, it just returns FALSE. Maybe there's something else going on here.
In any case, here's the patch. I'm running PHP 5.3, and the slideshow is working just fine otherwise.
Comment | File | Size | Author |
---|---|---|---|
#3 | 879840-strict_errors-2.patch | 3.04 KB | pkiraly |
#1 | 879840-strict_errors-1.patch | 3.46 KB | redndahead |
#1 | 879840-strict_erros-v3-1.patch | 4.8 KB | redndahead |
singleframe-undefined-var.patch | 836 bytes | theunraveler | |
Comments
Comment #1
redndahead CreditAttribution: redndahead commentedThank you! I decided to declare the variables instead of doing the checks. These patches were committed.
Comment #3
pkiraly CreditAttribution: pkiraly commentedThis patch is essentially the same as 879840-strict_errors-1.patch, the difference is that it was created for the Git (against 6.x-2.3 tag), so the header of the patch is different. I did it, because I was not able to run that patch.
Comment #4
ergonlogicPlease update the 6.x-2.x branch with the patch in #3.
Comment #5
ergonlogicSorry, nevermind.
Comment #6
ergonlogicActually, on second thought, a new -dev snapshot would be helpful, as this patch is not in the current snapshot.
Better yet, would be a new 6.x-2.4 release... :)
Comment #7
redndahead CreditAttribution: redndahead commentedI'm looking at the dev version and it has those changes.