Hi there,

everything is working but I (admin & users) get for each PDF page two warnings:

Strict warning: Only variables should be passed by reference in _turnjs_magazines_get_content() (line 116 of /homepages/44/d513036722/htdocs/sites/all/modules/turnjs_magazines/turnjs_magazines.module).

Notice: Undefined index: attributes in theme_image() (line 1857 of /homepages/44/d513036722/htdocs/includes/theme.inc).

How can I get rid of this warnings?

Im using not the DEV Version and Drupal Core 7.35
Michael

Comments

mr4711’s picture

Issue summary: View changes
anybody’s picture

Thats related to your PHP version. Which version do you use?

I'll have to fix it in the module.

mr4711’s picture

PHP 5.4.39

anybody’s picture

Status: Active » Closed (fixed)

This is already fixed in the latest .dev-Version.

If the .dev Version works fine for all of you I can create a new stable release.

mr4711’s picture

Assigned: mr4711 » Unassigned

I've done some testing and would say: No the problem is only partly fixed. The warings are not at the "turnjs_magazines" sites any more, but on some of the pages showing a normal content node

Notice: Undefined property: stdClass::$type in turnjs_magazines_entity_view() (line 57 of /homepages/44/d513036722/htdocs/sites/all/modules/turnjs_magazines/turnjs_magazines.module).

It is strange, the pages do not have any link to turnjs_magazines ....

mr4711’s picture

Status: Closed (fixed) » Needs work
mr4711’s picture

We do still have tons of this warnings:

Notice: Undefined property: stdClass::$type in turnjs_magazines_entity_view() (line 57 of /homepages/44/d513036722/htdocs/sites/all/modules/turnjs_magazines/turnjs_magazines.module).

Would you help us to get rid of it?

mr4711’s picture

We sill have the problem and are still not experienced in PHP. So please, could someone give us a hint how to get rid of this warning. In the mean time we have many PDFs and tons of warinings in the logfile:

The message is:
Notice: Undefined property: stdClass::$type in turnjs_magazines_entity_view() (line 57 of /homepages/44/d513036722/htdocs/sites/all/modules/turnjs_magazines/turnjs_magazines.module).

and the code is:

52 /**
53  * Implements hook_entity_view().
54  */
55 function turnjs_magazines_entity_view($entity, $type, $view_mode, $langcode) {
56   // The teaser display can be used to link to magazines. We remove unwanted elements here.
57  if ($entity->type == TURNJS_MAGAZINES_NODE_TYPE && $view_mode == 'teaser') {
58     // Only show the first image of the field in teaser display (for references). This is currently not possible in field settings.
59     $entity->content[TURNJS_MAGAZINES_FIELD_RESULTING_IMAGES]['#items'] = array_slice($entity->content[TURNJS_MAGAZINES_FIELD_RESULTING_IMAGES]['#items'], 0, 1);
60     if (isset($entity->content['links'])) {
61       // Hide the further links for the teaser.
62       // hide() does not work here. Got no clue, why.
63       unset($entity->content['links']);
64     }
65     // Hide the title.
66     $entity->title = NULL;
67   }
68 }

Is there something we should add in the IF statement?

anybody’s picture

Please try the latest turnjs_magazines 7.x-3.x-dev release if you are using modernizr v3.
Of course in a testing and not in a live environment! ;)

Feedback is welcome if this fixes the problem for you.

mr4711’s picture

Yep, the missing "isset" was the problem.
Thank you!

anybody’s picture

Status: Needs work » Fixed

  • Anybody committed 6fb1887 on 7.x-3.x
    Issue #2484137 by mr4711, Anybody: Strict warning and Undefined index
    

Status: Fixed » Closed (fixed)

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