Skip to content

Commit

Permalink
make sure data is object
Browse files Browse the repository at this point in the history
  • Loading branch information
danyj committed Jun 27, 2018
1 parent 9269dcd commit 3cf2ccd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yjsg.php
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,8 @@ function onContentPrepareForm($form, $data) {

if( $this->yjsg->yjtmpl() ){

$data = is_array($data) ? (object) $data : $data;

//YJSG mega menu
if ($form->getName() == 'com_menus.item') {
JForm::addFormPath(JPATH_PLUGINS . YJDS . 'system' . YJDS . 'yjsg' . YJDS . 'includes' . YJDS . 'yjsgmegamenu');
Expand Down Expand Up @@ -1243,10 +1245,13 @@ function onContentPrepareForm($form, $data) {
$this->addShortcodes();
}




// Microdata category
if ($form->getName() == 'com_menus.item' && $data->type == 'component' && strstr($data->link, 'com_content')) {

if (!strstr($data['link'], 'view=category&layout=blog') && !strstr($data['link'], 'view=featured'))return;
if (!strstr($data->link, 'view=category&layout=blog') && !strstr($data->link, 'view=featured'))return;
JForm::addFormPath(JPATH_PLUGINS . YJDS . 'system' . YJDS . 'yjsg' . YJDS . 'includes' . YJDS . 'yjsgmicrodata');
$form->loadFile('yjsg_category_microdata', false);
}
Expand Down

0 comments on commit 3cf2ccd

Please sign in to comment.