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']) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kingfisher64’s picture

Issue summary: View changes
WorldFallz’s picture

ah... 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.

kingfisher64’s picture

Okay thanks, I'll do that then WorldFallz.

I like features so find it a brilliant time saving way to test a module's functionality.

WorldFallz’s picture

Yep, 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.

jsnyder83’s picture

I 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

            if ($media['formatted']) {
              $rows[$count]['asset'][$target_field] = check_plain($media['formatted']);
-             $rows[$count]['asset']['thumbnail'] = check_plain($media['formatted']);
            }

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:

Notice: Undefined index: image_style in views_timelinejs_plugin_style_timelinejs->render() (line 568 of C:\MAMP\htdocs\drupal7\sites\all\modules\views_timelinejs\views_timelinejs_plugin_style_timelinejs.inc).

I created a new view, unassociated with the feature, and had no different result.

Any suggestions?

aronsmith’s picture

i have the same error message

jsnyder83’s picture

Anyone 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.

WorldFallz’s picture

I'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.

lily.yan’s picture

I 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.

lily.yan’s picture

Here is a patch to fix issues in comment#9.

iStryker’s picture

Title: Undefined index 568 » Undefined index line 568
Issue summary: View changes

The 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".

Liam Morland’s picture

Title: Undefined index line 568 » Undefined index: image_style
haridyb’s picture

Hi,
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

lily.yan’s picture

Created new issue #2549435: Undefined indexes when creating feature for creating your own feature.

iStryker’s picture

Issue summary: View changes

@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

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']) {

A simple isset should solve this.

iStryker’s picture

Status: Active » Needs review
FileSize
898 bytes

Attached is patch

WorldFallz’s picture

Thanks 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?

Liam Morland’s picture

Yes. 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.

Liam Morland’s picture

Perhaps the patch in #16 should use !empty() instead of isset(). isset(FALSE) is TRUE, but !empty(FALSE) is FALSE.

koentimmers’s picture

What 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.

  • dcam committed dee57e4 on 7.x-1.x authored by iStryker
    Issue #2497003 by iStryker, Liam Morland: Undefined index: image_style
    
dcam’s picture

Status: Needs review » Fixed

Committed #16 to 7.x-1.x-dev with @Liam Morland's suggestion from #19. Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.