Hi,

When activating the blog feature with a french locale, my OpenPublic home page displays the following error:

Warning : Illegal offset type in isset or empty dans phase2_blog_preprocess_views_view_field() (ligne 99 dans /home/hcme/profiles/openpublic/modules/custom/phase2_blog/phase2_blog.theme.inc).

Diving in to the code, I believe I found a bug in the file /home/hcme/profiles/openpublic/modules/custom/phase2_blog/phase2_blog.theme.inc, on lines 98 and 104.

Line 98:
$lang = isset($field_blog_author[$language->language]) ? $language : LANGUAGE_NONE;
should be changed to:
$lang = isset($field_blog_author[$language->language]) ? $language->language : LANGUAGE_NONE;

Line 104:
&& ($lang = isset($author->field_profile_photo[$language->language]) ? $language : LANGUAGE_NONE)
should be changed to:
&& ($lang = isset($author->field_profile_photo[$language->language]) ? $language->language : LANGUAGE_NONE)

That clears the error for me, and I hope that I understood the mechanisms of the function phase2_blog_preprocess_views_view_field() correctly and that my patch is correct.

Hope this can help someone else.

NB: I have installed the OpenPublic beta 8, plus applied all available updates for the different modules.

Comments

  • hefox committed 4940cf4 on 7.x-1.x
    Issue #1653346: fix some issues with showing author picture
    
hefox’s picture

Issue summary: View changes
Status: Patch (to be ported) » Fixed

thanks

Wrong issue status, patch to be ported implies there was an existing patch for a different version of the project

Status: Fixed » Closed (fixed)

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