e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
320 stars 214 forks source link

UEF - allow delete plugin fields manually if plugin is already uninstalled #5030

Closed Jimmi08 closed 1 year ago

Jimmi08 commented 1 year ago

Motivation

If the plugin is uninstalled without deleting EUF, there is no option to delete those fields later.

Plugin uninstallation deletes all EUF fields, sometimes this is not needed.

You can't delete only one field now.

Proposed Solution

Allow this for the main admin only.

Jimmi08 commented 1 year ago

This is a working solution

                if(strpos($name, 'plugin_') === 0)
                {
                    $attributes['readParms']['deleteClass'] = e_UC_NOBODY;

                    $tmp_a = array();
                    $tmp_a = explode('_', $name);

                    if(count($tmp_a)==3) {
                        $plugin = $tmp_a[1];
                    }
                    else {

                        $tmp =  array_slice($tmp_a, 1, -1);
                        $plugin  = implode("_", $tmp);
                    }

                    if (e107::isInstalled($plugin) === FALSE)
                    {
                        $attributes['readParms']['deleteClass'] = e_UC_MAINADMIN;
                    }
                }
Jimmi08 commented 1 year ago

It is possible via the batch option, it is enough.