Jump to content
thirty bees forum

Error 500 when trying to uninstall PayPal module


cprats

Recommended Posts

Hi,

I get this error 500 when I try to uninstall PayPal module (module version 5.4.2, thirtybees version 1.0.8):

 

## ThirtyBeesException  
**[] is not a valid configuration key**  
 *at line* **1005** *in file* `classes/Configuration.php`  
```php  
1000.         * @since   1.0.8
1001.         */
1002.        protected static function validateKey($key)
1003.        {
1004.            if ( ! Validate::isConfigName($key)) {
1005. =>             $e = new PrestaShopException(sprintf(
1006.                    Tools::displayError('[%s] is not a valid configuration key'),
1007.                    Tools::htmlentitiesUTF8($key)
1008.                ));
1009.                die($e->displayMessage());
1010.            }
```  
- **ConfigurationCore::validateKey** - [line `813` - `classes/Configuration.php`]  
 - [1 Arguments]  
```php  
808.         * @throws PrestaShopException
809.         * @throws PrestaShopDatabaseException
810.         */
811.        public static function deleteByName($key)
812.        {
813. =>         static::validateKey($key);
814.    
815.            $result = Db::getInstance()->execute(
816.                '
817.            DELETE FROM `'._DB_PREFIX_.static::$definition['table'].'_lang`
818.            WHERE `'.static::$definition['primary'].'` IN (
```  
```Argument [0]  

```  
- **ConfigurationCore::deleteByName** - [line `292` - `modules/paypal/paypal.php`]  
 - [1 Arguments]  
```php  
287.        public function deleteConfiguration()
288.        {
289.            \Configuration::deleteByName(static::LIVE);
290.    
291.            \Configuration::deleteByName(static::IMMEDIATE_CAPTURE);
292. =>         \Configuration::deleteByName(static::DEBUG_MODE);
293.            \Configuration::deleteByName(static::STORE_COUNTRY);
294.    
295.            \Configuration::deleteByName(static::LOGIN_ENABLED);
296.            \Configuration::deleteByName(static::CLIENT_ID);
297.            \Configuration::deleteByName(static::SECRET);
```  
```Argument [0]  

```  
- **PayPal->deleteConfiguration** - [line `275` - `modules/paypal/paypal.php`]  
```php  
270.         *
271.         * @return bool Indicates whether the module was uninstalled successfully
272.         */
273.        public function uninstall()
274.        {
275. =>         $this->deleteConfiguration();
276.    
277.            return parent::uninstall();
278.        }
279.    
280.        /**
```  
- **PayPal->uninstall** - [line `1648` - `controllers/admin/AdminModulesController.php`]  
```php  
1643.                                }
1644.                                if (count($this->errors)) {
1645.                                    continue;
1646.                                }
1647.                                // Get the return value of current method
1648. =>                             $echo = $module->{$method}();
1649.                                // After a successful install of a single module that has a configuration method, to the configuration page
1650.                                if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent')) {
1651.                                    Tools::redirectAdmin(static::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12');
1652.                                }
1653.                            }
```  
- **AdminModulesControllerCore->postProcessCallback** - [line `1511` - `controllers/admin/AdminModulesController.php`]  
```php  
1506.                }
1507.            }
1508.    
1509.            // Call appropriate module callback
1510.            if (!isset($ppmReturn)) {
1511. =>             $this->postProcessCallback();
1512.            }
1513.    
1514.            if ($back = Tools::getValue('back')) {
1515.                Tools::redirectAdmin($back);
1516.            }
```  
- **AdminModulesControllerCore->postProcess** - [line `251` - `classes/controller/Controller.php`]  
```php  
246.            if ($this->checkAccess()) {
247.                if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
248.                    $this->setMedia();
249.                }
250.    
251. =>             $this->postProcess();
252.    
253.                if (!empty($this->redirect_after)) {
254.                    $this->redirect();
255.                }
256.    
```  
- **ControllerCore->run** - [line `837` - `classes/Dispatcher.php`]  
```php  
832.                if (isset($paramsHookActionDispatcher)) {
833.                    Hook::exec('actionDispatcher', $paramsHookActionDispatcher);
834.                }
835.    
836.                // Running controller
837. =>             $controller->run();
838.            } catch (PrestaShopException $e) {
839.                $e->displayMessage();
840.            }
841.        }
842.    
```  
- **DispatcherCore->dispatch** - [line `63` - `admin/index.php`]  
```php  
58.    if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {
59.        $_REQUEST['controller'] = strtolower($_REQUEST['tab']);
60.    }
61.    
62.    // Prepare and trigger admin dispatcher
63. => Dispatcher::getInstance()->dispatch();

Link to comment
Share on other sites

Seems to refer to a non-existent configuration field in the database. I guess it would help to delete the waste line 

Configuration::deleteByName(static::DEBUG_MODE);

In function deleteConfiguration() of your paypal.php.

  • Like 2
Link to comment
Share on other sites

On 8/29/2019 at 9:56 AM, Occam said:

Seems to refer to a non-existent configuration field in the database. I guess it would help to delete the waste line 


Configuration::deleteByName(static::DEBUG_MODE);

In function deleteConfiguration() of your paypal.php.

Yes, this was the issue. After making the changes you suggested I could uninstall the module.

Thank-you very much!

Link to comment
Share on other sites

That's because this commit was to master branch, which corresponds to version 6.0.0. That version was released for a brief period of time only, as many people had issues with it. Since that time there was some development on 5.x.x branch, and couple of 5.x.x version releases. Unfortunately this branch still has the issue mentioned in this thread. 

I don't know if there are any plans to revive 6.0.0 work and fix it, or if the plan is to continue development in 5.x.x branch. That's up to thirtybees developers to decide. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...