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.
Using the feature, will all fields mapped in the view the following is output on my test site and a live site.
Notice: Undefined index: image_style in views_timelinejs_plugin_style_timelinejs->render() (line 568 of sites/all/modules/views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
http://www.inspirationtree.org/en/timeline
Line 568 in 7.x-1.x-dev as of April 30th
if ($this->view->field[$tmp['fieldname']]->options['settings']['image_style'] && !empty($value['uri'])) {
before April 30th
if ($this->view->field[$tmp['fieldname']]->options['settings']['image_style']) {
Comment | File | Size | Author |
---|---|---|---|
#16 | views_timelinejs-undefined_index_image_style-2497003-16.patch | 898 bytes | iStryker |
#10 | views_timelinejs-fix-undefined-index-2497003-9.patch | 3.71 KB | lily.yan |
Comments
Comment #1
kingfisher64 CreditAttribution: kingfisher64 commentedComment #2
WorldFallz CreditAttribution: WorldFallz commentedah... whether or not you were using the feature was going to be my next question. The feature has not been updated and was already buggy when I took over the module. It's going to be removed in the next official release in favor a providing a default view.
In the meantime, I would recommend trying to setup a completely new view not in any way connected to the feature.
Comment #3
kingfisher64 CreditAttribution: kingfisher64 commentedOkay thanks, I'll do that then WorldFallz.
I like features so find it a brilliant time saving way to test a module's functionality.
Comment #4
WorldFallz CreditAttribution: WorldFallz commentedYep, that's definitely the prevailing opinion. In my experience it's been an unmitigated disaster of broken features/reverts/broken content types/overrides etc... so I avoid it like the plague, lol. In all fairness though, it's been awhile so I probably owe it a re-evaluation.
however, it does add a rather large maintenance to burden to the module (and any module that supports a feature really). Plus, in this case, I imagine there's more folks using it with existing content types than creating a content type just for the timeline, but that's just a guess.
In any case, the issue I linked above was resoundingly not replied to (not even by the op, lol), so I find it hard to justify its inclusion unless someone wants to step up and debug/patch it.
Comment #5
jsnyder83 CreditAttribution: jsnyder83 commentedI am also experiencing issues with the line 568 error.
I applied the patch found here (https://www.drupal.org/node/2480427) to address a broken image graphic being displayed on the timeline slide item, which seems to have addressed that particular issue. However, I continued to experience issues with the thumbnail images on the "flags" in the timeline slider.
If I used a media link to a raw photo file (.jpg, .gif, etc) the image displayed correctly on the slide and on the flag. On the other hand, if the media link pointed to a YouTube video or a Tweet, the image displayed correctly on the slide, but not on the flag.
Since displaying a thumbnail on the flag is not particularly important to me, I made the following edit to the views_timelinesjs_plugin_style_timelinejs.inc file
Having done that, the slides display properly for all types of Media Links, and the flags display tiny thumbnails for for raw image links, as well as for website links, and display a little empty white space for things like YouTube videos.
HOWEVER, I am still receiving the following error message:
I created a new view, unassociated with the feature, and had no different result.
Any suggestions?
Comment #6
aronsmith CreditAttribution: aronsmith as a volunteer commentedi have the same error message
Comment #7
jsnyder83 CreditAttribution: jsnyder83 commentedAnyone had any success with addressing this issue?
If not, I'd be tempted to just use the original TimelineJS, as available on the Knight Lab website, and just do an embed. I'd give up some control, and perhaps sacrifice speed, but I would gain a much added benefit - bug-free basic functionality.
Comment #8
WorldFallz CreditAttribution: WorldFallz commentedI'm happy to look at/commit a patch. But haven't had the time to look into this one myself since it involves the feature. I'd even be willing to commit a patch that only affects the feature until the feature has been removed from the module.I didn't see that it occurs without the feature in a separate view. if you could provide the exact steps I can use to reproduce the error, I'll see if I can figure out where the problem is.
Also, you stated that you applied a patch from linked issue. This issue is for 7.x-1.x-dev and that patch has been committed. Make sure you're using the current dev snapshot.
Comment #9
lily.yan CreditAttribution: lily.yan commentedI am getting this error when using the featurized sub-module.
I stumbled across this issue when we are creating our own feature. Our feature uses one node with field collection. When we create the feature it works great on the site we created it. When we enable the feature on another site, we get this error along with a few others, all complaining about undefined indexes. The timeline shows up perfectly below the error message.
After re-saving the view, it does not complain about anything. All of the error message are gone. If I revert the view, then the errors comes back.
I am not an expert, but I feel like if the views configuration is stored in the database, then everything works (at least for my feature). If the view is in code, then it does not.
I notice in a few other threads, you ask people to re-save their view, and see if the error message goes away. If this work, this is not a proper solution. With a feature, you should enable it and it should work. We are pushing this feature to over 500+ websites we maintain. We cannot go to each and everyone and re-save the view.
Lastly, I am all for you dropping the feature in 1.0, however you should implement Simpletest with a default view. I believe this will catch errors like this.
Comment #10
lily.yan CreditAttribution: lily.yan commentedHere is a patch to fix issues in comment#9.
Comment #11
iStryker CreditAttribution: iStryker commentedThe style plugin sets default options values, in options_definition. Using $this->view->style_option['X'] it does not load the default values, when the view is not in the database. You have to use style_plugin->option['X']. Patch #10 fixes this.
This issue is about the feature sub-module. Patch #10 does not solve it. Ideally it should be moved to another issue called something like "Undefined indexes when creating feature".
Comment #12
Liam MorlandComment #13
haridyb CreditAttribution: haridyb commentedHi,
Thanks for the wonderful patch.
I was getting these errors before patching:
Notice: Undefined index: start_at_current in views_timelinejs_plugin_style_timelinejs->render() (line 436 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
Notice: Undefined index: start_at_current in views_timelinejs_plugin_style_timelinejs->render() (line 517 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
Notice: Undefined index: image_style in views_timelinejs_plugin_style_timelinejs->render() (line 568 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
Notice: Undefined index: start_at_current in views_timelinejs_plugin_style_timelinejs->render() (line 517 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
Notice: Undefined index: image_style in views_timelinejs_plugin_style_timelinejs->render() (line 568 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
Notice: Undefined index: start_at_current in views_timelinejs_plugin_style_timelinejs->render() (line 613 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
Now, after applying the patch, I get the following error:
Notice: Undefined index: image_style in views_timelinejs_plugin_style_timelinejs->render() (line 567 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
Notice: Undefined index: image_style in views_timelinejs_plugin_style_timelinejs->render() (line 567 of views_timelinejs/views_timelinejs_plugin_style_timelinejs.inc).
I would appreciate any help?
Thanks
Comment #14
lily.yan CreditAttribution: lily.yan commentedCreated new issue #2549435: Undefined indexes when creating feature for creating your own feature.
Comment #15
iStryker CreditAttribution: iStryker commented@haridyb your comment makes sense. The patch fixes the undefined indexes other than the image style field. The error of line 568 became 567 because 1 line of whitespace was removed with patch....so you are still getting the problem in the issue summary.
Line 568 in 7.x-1.x-dev as of April 30th
before April 30th
A simple isset should solve this.
Comment #16
iStryker CreditAttribution: iStryker commentedAttached is patch
Comment #17
WorldFallz CreditAttribution: WorldFallz commentedThanks for sorting this out. Just to make sure I understand-- both #10 and #16 are necessary? And the feature issue was moved into #2549435: Undefined indexes when creating feature?
Comment #18
Liam MorlandYes. The patch in #10 is identical to the patch in #2549435: Undefined indexes when creating feature. The patch in #16 fixes specifically the problem identified by the current issue.
Comment #19
Liam MorlandPerhaps the patch in #16 should use !empty() instead of isset(). isset(FALSE) is TRUE, but !empty(FALSE) is FALSE.
Comment #20
koentimmers CreditAttribution: koentimmers commentedWhat worked for me was editing the view "Timeline" and then click the Settings and later click the Image field. No need to do changes. Save the view and all errors were gone.
Comment #22
dcam CreditAttribution: dcam as a volunteer commentedCommitted #16 to 7.x-1.x-dev with @Liam Morland's suggestion from #19. Thanks everyone!