Skip to content

Commit

Permalink
Bug #135699 fix: [Uninstall tjvendor]- shows 1064 error when admin un…
Browse files Browse the repository at this point in the history
…install tjvendor (#34)
  • Loading branch information
snehal0904 authored and manojLondhe committed Nov 2, 2018
1 parent 6e245c9 commit b72edf8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/com_tjnotifications/install.tjnotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function update($parent)
// Install SQL FIles
$this->installSqlFiles($parent);
$this->fix_db_on_update();
$this->fixMenuLinks();
}

/**
Expand Down Expand Up @@ -341,4 +342,27 @@ public function fix_db_on_update()

$this->fixTemplateTable($db, $dbprefix, $config);
}

/**
* Fix Duplicate menu created for Notification
*
* @return void
*
* @Since 1.1
*/
public function fixMenuLinks()
{
$db = JFactory::getDbo();
$link = 'index.php?option=com_tjnotifications&view=notifications&extension=com_jticketing';
$link1 = 'index.php?option=com_tjnotifications&extension=com_tjvendors';
$allLinks = '"' . $link . '","'. $link1 . '"';

// Delete the mainmenu from menu table
$deleteMenu = $db->getQuery(true);
$deleteMenu->delete($db->quoteName('#__menu'));
$deleteMenu->where($db->quoteName('link') . 'IN (' . $allLinks . ')');
$deleteMenu->where($db->quoteName('level') . " = 1");
$db->setQuery($deleteMenu);
$db->execute();
}
}

0 comments on commit b72edf8

Please sign in to comment.