Jump to content

Object of class xxxxx could not be converted to string in xxxxx on line xxx


Recommended Posts

I am working on some changes to the application MediaWiki to make it better fit my needs which they say I need to create a "hook". I have created this hook with the below code but the problem is when I try and insert $article into a string so I can email it, I get a error that a object class could not be converted to string. I have looked all around and I am not even sure how I can extract the data from this $article variable. Does anyone have any suggestions on things to try?

 

$wgHooks['ArticleSaveComplete'][] = 'fnMyHook';

function fnMyHook(&$article, &$user, &$text, &$summary, &$minoredit, &$watchthis, &$sectionanchor, &$flags)
{
$email_text = "";
$email_text .= $article . "\n\n";
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.