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.
Hi,
I get some php notices in facebook_pull-feed.tpl.php. Messages or descriptions are not always present in the feed which means $item->message or $item->description are not always defined when printed.
You'll find a patch attached.
Comment | File | Size | Author |
---|---|---|---|
php_notices_template_pull_feed.patch | 896 bytes | Anonymous (not verified) |
Comments
Comment #1
jpshayes CreditAttribution: jpshayes commentedI was getting the same errors. Applied patch cleanly, errors are gone. Thanks.
I updated the title with a little more description.
Comment #2
jpshayes CreditAttribution: jpshayes commentedMarking as "Needs Review"
Comment #3
Khalor CreditAttribution: Khalor commentedApplies cleanly, fixes the error.
Comment #4
aidanlis CreditAttribution: aidanlis commentedThanks, I've applied the patch to the 6.x and 7.x branches.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedCool!
Comment #7
TomSherlock CreditAttribution: TomSherlock commentedThe most recent version on the project page does not include the patch.
Comment #8
marcus178 CreditAttribution: marcus178 commentedI have applied this patch but still getting an error of
Notice: Undefined property: stdClass::$name in include() (line 10 of /modules/contrib/facebook_pull/facebook_pull-feed.tpl.php).
Also it's not actually displaying the messages just the Page name and time of post.
Comment #9
petergus CreditAttribution: petergus commentedthat patch was not applied in the latest version. applying removes the error message, however the base problem remains.... there are no messages coming in. i only see the pictures, name, and time.
i think could be related to which "Object type" to choose....?
Comment #10
valderama CreditAttribution: valderama commentedpatch works.
It would be nice to make a new release of the module?
Comment #11
phai CreditAttribution: phai commentedTo solve your problem you should edit that file (see filename inside patch).
Replace
echo l($item->name, $item->link);
writing
if(isset($item->name)) echo l($item->name, $item->link);
Comment #12
ErikU CreditAttribution: ErikU commentedPerfect! #11 needs to be applied to the next release!
Comment #13
jweedman CreditAttribution: jweedman commentedThank you! I always like to make small changes like this manually rather than a patch ... seems overkill.
ALSO: For others who might be getting more "NOTICES:" than just the one from $item->name variable - make sure you check that the $item->message and $item->description variables are set before you try to print them out as well.
I was getting 4 notices from the facebook_pull-feed.tpl.php file. Like #11 said, but use if(isset(...)) to check those variables exist before you print them, and notices should clear up. Thanks again, guys.
Comment #14
kyuubi CreditAttribution: kyuubi commentedThis problem is still happing when downloading the lastest release.
Basically I had to apply 2 patches for this module to work properly, this one and this one https://drupal.org/node/1989030
Can you commit to a release?
Comment #15
shiervermont CreditAttribution: shiervermont commentedThe solution posted by "toonketels" works fine. Thanks.
Comment #16
JoshuaHartmann CreditAttribution: JoshuaHartmann commentedJust a heads up I am still having this error issue post recommended patch with the latest d7 version. Also notice it seems to be pulling & displaying blank posts when it errors.
As I only display the latest post I have worked around this by displaying 2 and using this js to do some hiding.
Not a fix, just a work around.
Comment #17
nedjoReopening as the follow-up change suggested in #11 addresses a remaining bug and has not yet been addressed.
Comment #19
daveferrara1 CreditAttribution: daveferrara1 commentedComment #21
daveferrara1 CreditAttribution: daveferrara1 commented