Closed (fixed)
Project:
Nivo Slider
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
6 Apr 2012 at 19:18 UTC
Updated:
24 Apr 2012 at 04:01 UTC
Jump to comment: Most recent file
Fatal error: Cannot use string offset as an array in nivo_slider/nivo_slider_slides.admin.inc on line 59 when I try to edit slider (?=admin/structure/nivo-slider). First-time editing (after installing module) works until I'm trying to save the slider.
If I comment line 59 in module source (nivo_slider/nivo_slider_slides.admin.inc), the module could work, but results are weird — I receive a notice Notice: Uninitialized string offset: 0 in function nivo_slider_slider() (line 60 in sites/all/modules/nivo_slider/slider.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | provide-default-values-1518206-7.patch | 6.06 KB | devin carlson |
| #5 | provide-default-values-1518206-5.patch | 3.64 KB | devin carlson |
| #4 | provide-default-values-1518206-4.patch | 3.64 KB | devin carlson |
Comments
Comment #1
electrichound commentedChange code in line 59 from
'#default_value' => $settings['description']['value'],to
'#default_value' => isset($settings['description']['value']) ? $settings['description']['value'] : ' ',It works, but I get notices like above (Notice: Uninitialized string offset: 0 in function nivo_slider_slider() (line 60 in sites/all/modules/nivo_slider/slider.inc).
Comment #2
dasgalloway commentedEdit: I uninstalled the Nivo Slider module, deleted the nivo_slider folder from my modules folder, and reinstalled. So long as you do not delete ALL of the slides, this issue does not occur. I believe it is removing information from the
nivo_slider_banner_settingsvariable when you do this, and there doesn't seem to be a case for what to do when you go to the admin page when this is empty.I'm getting the same thing after I updated. Everything seemed to be working until I deleted my existing slides and tried to add a new one fresh. I don't know if it's the same case as electrichound or not, but it's definitely the same error.
In addition to the string offset as array error, I am also receiving the following:
Comment #3
electrichound commentedActually, I got the same messages in admin/structure/nivo_slider section. So I think we both have one issue.
==
I've tried your method, but it doesn't solve the issue for me. When I'm trying to add an image to slider (actually, even if I'm just saving default images), I get the same Fatal error.
So, the only way to make it work is to edit the line 59, even just comment out.
Comment #4
devin carlson commentedA test to see if the tests are now enabled for Nivo Slider.
Comment #5
devin carlson commentedLets try that again.
Comment #7
devin carlson commentedAutomated testing is now up and running!
The attached patch should solve this issue (and the failing tests).
Comment #8
devin carlson commentedCommitted to 7.x-1.x.