Since today's update of views-6.x-3.x-dev I'm getting strange fatal errors when editing a View with Amazon fields. From Apache's error.log:

[Sat Dec 17 01:33:32 2011] [error] [client xx.xxx.xx.xx] PHP Fatal error: Cannot access empty property in /var/www/drupal/sites/all/modules/amazon/includes/views_handler_field_amazon_image.inc on line 98, referer: http://xxxxx.org/admin/build/views/edit/grabr?destination=sites%2Fdefault%2Ffiles%2Flanguages%2Fde_02477c34eb6618914a14ee598580ea03.js

Attaching an example Views export. The View is pretty simple, it just pulls a cover image from Amazon for a given node with an ASIN field (argument on nid).

Other suspects than Views: 'Advagg' (6.x-1.x-dev).

Not sure if any harm is done, but a "PHP Fatal error" doesn't sound too good.

CommentFileSizeAuthor
php-fatal-views-export.txt11.54 KBasb

Comments

rfay’s picture

Yet again :-(

Probably a problem in 7.x as well...

Thanks for the report.

asb’s picture

Yesterday I had something remotely similar, #1372158: PHP Fatal error: Call to undefined method content_handler_field_multiple::use_group_by(), maybe it helps to look at the patch over there.

However, except for the error messages I get no (new) problems. Still, Views 3 behaves quite strange without patched CCK modules in some areas, but I have no idea to what degree this affects the ASIN field as well.

asb’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Priority: Normal » Major

This issue still exists, and increasingly swamps Apache's error.log with multiple "PHP Fatal error" messages per second. At this rate, even the logging takes the site's performance down :-(

The code around line 98 of ./sites/all/modules/amazon/includes/views_handler_field_amazon_image.inc is:

  function render($values) {
    // We may not have a URL. It's not guaranteed that Amazon will give us one.
    if (empty($values->{$this->aliases['url']})) {
          return;
    }
    $attributes = array(
      'height' => $values->{$this->aliases['height']},
      'width' => $values->{$this->aliases['width']},
    );
  […]

The "empty property" that causes the Fatal error appears to be the $attributes array. I don't know PHP, but the beginning of the function wraps $values checks for the condition that $values is empty. Wouldn't it suffice to do the same for the $attributes array?

rfay’s picture

I think it's fair to say we only support Views 2.x until this gets resolved.

asb’s picture

As we all know, maintainers are gods, and gods can do as they please ;) However, Views 3 is the recommended release for D6 (this doesn't change anything significantly, as lots of other modules ignore Views 3 issues as well).

rfay’s picture

6.x-2.16 is the recommended release for Views.

But maintainers aren't gods. They just hope that somebody will solve the problems. And they have too many things they maintain. If they were gods they'd keep up with all of them.

asb’s picture

The project page says in the section "Recommended versions of Views": "For new installs of Drupal 6, we recommend the 6.x-3.x branch. [...] The 6.x-2.x branch of Views is in critical/security maintenance mode only."

However, please let's not waste any more time on debating what makes a release recommended as it really does not matter; on d.o, nobody is obliged for anything; except for those few who get paid it's volunteer work.