How a delete works from the Joomla Admin - Joomla & VirtueMart Tips & How To's

GJC Website Design UK, Joomla Developer, VirtueMart Developer, Template Developer, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.

Home Home Alternative Health Practitioners

Sat

27

Sep

  • Joomla 2.5 & 3.0
  • Joomla core

Just for my own info - how a delete works from the Joomla Admin

I have a component with a view "records"

You would have a JS delete button in your view which points to "records.delete" formed in your html.php file  protected function addToolbar() .

//Show trash and delete for components that uses the state field
        if (isset($this->items[0]->state)) {
            if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
                JToolBarHelper::deleteList('', 'records.delete','JTOOLBAR_EMPTY_TRASH');
                JToolBarHelper::divider();
            } else if ($canDo->get('core.edit.state')) {
                JToolBarHelper::trash('records.trash','JTOOLBAR_TRASH');
                JToolBarHelper::divider();
            }
        }

Clicking this calls the controller "records" and could run the function delete() if configured.

If not configured in the "records" controller it  extends JControllerAdmin which is found in "libraries/legacy/controller/admin.php".
This function delete() makes some security checks and then loads the model (GporganiserModelRecord Object) using the getModel function and runs the delete function there if one is configured.
This loads the model for a single "record", not the" records" model.

If no delete is configured in models/record this model then extends "JModelAdmin" in libraries/legacy/model/admin.php which again has the "delete" function.

This model (JModelAdmin) delete() again makes some security checks and triggers some plugin events  then runs the delete function of the libraries/joomla/table/table.php.
This function is found in JTable itself and will run a simple delete query.

Be careful because in the delete functio it call the bind() in the same JTable class.
If for example you have a bind() in administrator/components/com_gporganiser/tables/record.php this will take precedence!

In this case I had

public function bind($array, $ignore = '') {
        $input = JFactory::getApplication()->input;
        $task = $input->getString('task', '');
        if($task != 'save' ) {
            return parent::bind($array, $ignore); //hand back to the JTable bind()
        }
}


 
Last Updated on Saturday, 27 September 2014 19:04
 
VirtueMart
Your Cart is currently empty.

Find a Domain Name!

Enter a domain name:

www.

Select an extension:

Select all
.com.net.org.info
.name.us.biz.eu
.co.uk.be.de.nl

Search Engine Optimisation (SEO)

The importance of having your site "visible" via the important search engines can not be stressed enough.
If your site is invisible to Google then no-one is going to find you no matter how wonderful your website is.

There are methods and techniques that need to be followed to ensure that your site is highly visible to your potential client base. We can do this for you and have had a large measure of success in the web sites that we have optimised.

Searching for a wide range of alternative health practitioner search terms (keywords & key-phrases in the jargon) returns a large number of GJC Web Design maintained and designed websites.
Terms such as alternative health practitioner, colourworks & colour mirrors consistently bring visitors and clients to our target websites.

Try the link below which will take you to a real search result for one or other of our sites.

Google UK search "colour mirrors"
1st, 2nd & 3rd place



How a delete works from the Joomla Admin|Joomla & VirtueMart Tips & How To's



GJC Website Design UK, Joomla Developer, VirtueMart Developer, Template Developer, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.


delete, function, records, model, bind, trash, state, php, joomla, jtoolbarhelper, configured, input, core, controller, libraries, admin, task, record, jtable, jmodeladmin, extends, table, ignore, run, makes, array, loads, checks, security, divider, runs, legacy, cando, jtoolbar, view, components, administrator, gporganiser, tables, precedence


guru

We use cookies to improve our website and your experience when using it. Cookies used for the essential operation of the site have already been set.
To find out more about the cookies we use and how to delete them, see our privacy policy.

I accept cookies from this site.