glensc / dokuwiki-plugin-pageredirect

Redirects page requests based on content
https://www.dokuwiki.org/plugin:pageredirect
19 stars 19 forks source link

Fix for Warning: Attempt to modify property of non-object Error #2

Closed abbibi closed 11 years ago

abbibi commented 11 years ago

If you get the double errors of:

Warning: Attempt to modify property of non-object in ~/lib/plugins/pageredirect/action.php on line 94 & Warning: Cannot modify header information - headers already sent by (output started at ~/lib/plugins/pageredirect/action.php:94) in ~/inc/actions.php on line 180

Modify ~/lib/plugins/pageredirect/action.php to fix the problem:

Change line 93 to:

function handle_pageredirect_metadata(&$event, $param) { 
if( isset($event->data->meta['relation']['isreplacedby'])) {
    unset($event->data->meta['relation']['isreplacedby']); 
}
}

from:

function handle_pageredirect_metadata(&$event, $param) { 
    unset($event->data->meta['relation']['isreplacedby']); 
}
glensc commented 11 years ago

what the hell? are you sure you use code offered from this repository?

this is fixed long time ago in 68df998fff1df0bd3e476bfb56fe32f2ea470eee