I am getting this PHP error frequently in using the module page in my component.
https://prod.localapp.live/home PHP Warning: Undefined array key "title" in /var/www/vhosts/localapp.live/prod.localapp.live/themes/goblue/plugins/default/theme/page/layout/module.php on line 17
This is my related ossn_com.php:
function mapping_init(): void
{
if (ossn_isLoggedin()) {
ossn_register_page('mapping','mapping_pagehandler');
}
}
function mapping_pagehandler(): void
{
if (!ossn_isLoggedin()) {
header("Location: https://".$_SERVER['SERVER_NAME']);
exit;
}
$title = ossn_print('com:ossn:mapping');
$contents['content'] = ossn_plugin_view('pages/mappingpage');
$content = ossn_set_page_layout('module', $contents);
echo ossn_view_page($title, $content);
}
ossn_register_callback('ossn', 'init', 'mapping_init');
The solution worked for me thanks to the community and the members for the solution. PaybyPlateMa
That's fixed it, thanks!
You need to pass title to contents too
$title = ossn_print('com:ossn:mapping');
$contents['content'] = ossn_plugin_view('pages/mappingpage');
$contents['title'] = $title;
$content = ossn_set_page_layout('module', $contents);
Further instead of header()..exit();
Use
redirect(REF);
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)