Posted by prabhatjn on March 3, 2011 at 9:02am
8 followers
| Project: | Share Buttons (AddToAny) by Lockerz |
| Version: | 7.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi there,
I am facing a bug warning when using addtoany in my views (where I am showing my nodes in teaser mode on front page):
the warning is: "Notice: Undefined variable: teaser in addtoany_handler_field_addtoany_link->render() (line 23 of /var/www/html/multiinstall/africanew/sites/all/modules/addtoany/views/addtoany_handler_field_addtoany_link.inc)."
Please let me know what should I do about it.
Many thanks in advance,
Perry Jain.
Comments
#1
This is still occurring with the latest dev (2011-Mar-07).
#2
Hi, I used the Node: AddToAny link in a view using fields and I receive the same error
Notice: Undefined variable: teaser in addtoany_handler_field_addtoany_link->render() (line 22 of (...)/sites/all/modules/addtoany/views/addtoany_handler_field_addtoany_link.inc).here's the line:
return _addtoany_create_button($node, $teaser);How should that be changed?
#3
Temporary you may insert:
$teaser ='';return _addtoany_create_button($node, $teaser);
#4
it works, tested with facebook and twitter in my views, modification in attached patch
#5
There is no need for
_addtoany_create_button()to even have the $teaser parameter since it is not used, so therefore there is no need to pass it fromaddtoany_handler_field_addtoany_link::render(). I'll leave the $teaser parameter existing because it seems to have some relevance, but here is a patch that allows the views integration to just fall back to the default, which is FALSE rather than an empty string.#6
Here is our patch works ;)
#7
With After applying last patch in #6 and the patch in http://drupal.org/node/1316274#comment-5142072, which removes the "teaser" notices, I still get some notices about the node title variable :
Notice: Undefined property: stdClass::$node_title in addtoany_handler_field_addtoany_link->render() (line 20 of (...)/sites/all/modules/addtoany/views/addtoany_handler_field_addtoany_link.inc).#8
When the view doesn't use the title field, the notice mentionned earlier appears. When the content title field is used I get a fatal error. So temporarilly, waiting for a correct patch by someone who knows php, I used this code, which removes the notice, but doesn't allow addtoany to display the node title :
function render($values) {$node = new stdClass();
$node->nid = $values->nid;
$node->title = '';
$teaser = '';
return _addtoany_create_button($node, $teaser);
#9
#10
Fixed in dev.
#11
Automatically closed -- issue fixed for 2 weeks with no activity.