why we can not delete root user group?

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
saman2
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Jan 18, 2018 7:36 pm

why we can not delete root user group?

Post by saman2 » Mon Feb 05, 2018 7:36 am

hi
i create some usergroup in joomla that has not parent. how can i remove this type of usergroup.
what is goal of this syntax:
https://github.com/joomlatools/joomlato ... p.php#L165
Last edited by toivo on Mon Feb 05, 2018 9:14 am, edited 1 time in total.
Reason: mod note: moved from Registered Joomla! User Groups - please read the description of the forum before posting

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17443
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: why we can not delete root user group?

Post by toivo » Mon Feb 05, 2018 9:21 am

Your github link points to code from the Joomlatools framework, available from http://joomlatools.com. Joomlatools is an extension developer. If your question relates to one of their extensions or source code, you should study their documentation or ask the question at their support forum.
Toivo Talikka, Global Moderator

saman2
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Jan 18, 2018 7:36 pm

Re: why we can not delete root user group?

Post by saman2 » Mon Feb 05, 2018 11:59 am

excuse me toivo and thank you for your help...i have some mistake and please forget my github link...look at my problem:

I used these codes to build the Joomla group:

Code: Select all


$app = JFactory::getApplication();
$groupTitle = .....;
$parent = .....;

if (!empty($groupTitle)) {
   $usergroupTable = JTable::getInstance('UserGroup', 'JTable');

   $mydata = array(
      'id' => 0,
      'title' => $groupTitle,
      'parent_id' => $parent[0],
      'tags' => null
   );
   if (!$usergroupTable->bind($mydata)) {
    $app->enqueueMessage("Bind failed: " . $usergroupTable->getError());
      return false;
   }
   if (!$usergroupTable->check()) {
      $app->enqueueMessage("check failed: " . $usergroupTable->getError());
      return false;
   }
   if (!$usergroupTable->store()) {
      $app->enqueueMessage("store failed: " . $usergroupTable->getError());
      return false;
   }
    $app->enqueueMessage("group created " . $groupTitle);
    return true;
}
$app->enqueueMessage("no empty group created");
My script uses these codes to create user groups that have no parent. How can I delete them? When i want remove through back-end, joomla return to me erorr: Root categories cannot be deleted.
Would not it be a problem if I started using the database?


Locked

Return to “Joomla! 3.x Coding”