Jump to content
thirty bees forum
  • 0

Modules with migration


Question

Posted

We did a migration last week but noticed that no native TB modules where added. Is this normal behavior? Or did something go wrong?

8 answers to this question

Recommended Posts

  • 0
Posted

True. Installing tbupdater should mark all the native modules as in need of an update and doing these updates switches to the thirty bees version. Should work just fine. Well, except for modules on disk, but not installed, as uninstalled modules don't get checked for updates.

  • 0
Posted

It was not installed with the migration (non of the TB modules). Tried to install it manual v1.4.0 But resulted in an error:

 

## ThirtyBeesException  
**This is not a valid version [[]]**  
 *at line* **24** *in file* `vendor/vierbergenlars/php-semver/src/vierbergenlars/SemVer/version.php`  
```php  
19.         */
20.        function __construct($version, $padZero=false) {
21.            $version = (string) $version;
22.            $expression = sprintf(parent::$dirty_regexp_mask, parent::$global_single_version);
23.          	if(!preg_match($expression, $version, $matches)) {
24. =>             throw new SemVerException('This is not a valid version');
25.    	}
26.    
27.            parent::matchesToVersionParts($matches, $this->major, $this->minor, $this->patch, $this->build, $this->prtag, $padZero?0:null);
28.    
29.            if($this->build === '') 
```  
- **vierbergenlars\SemVer\version->__construct** - [line `167` - `vendor/vierbergenlars/php-semver/src/vierbergenlars/SemVer/version.php`]  
 - [1 Arguments]  
```php  
162.         * @param string|version $v2 The second version
163.         * @return boolean 
164.         */
165.        static function gt($v1, $v2) {
166.            $v1 = new version($v1);
167. =>         $v2 = new version($v2);
168.    
169.            $ma1 = $v1->getMajor();
170.            $ma2 = $v2->getMajor();
171.    
172.            if($ma1 < 0 &&$ma2 >= 0)
```  
```Argument [0]  
7.4.1.9
```  
- **vierbergenlars\SemVer\version::gt** - [line `1060` - `classes/module/Module.php`]  
 - [2 Arguments]  
```php  
1055.    
1056.            if (Validate::isLoadedObject($updater) && $modules = $updater->getCachedModulesInfo()) {
1057.                foreach ($modules as $name => $module) {
1058.                    if (isset($modulesNameToCursor[mb_strtolower(strval($name))])) {
1059.                        $moduleFromList = $modulesNameToCursor[mb_strtolower(strval($name))];
1060. =>                     if ($moduleFromList->version && Version::gt($module['version'], $moduleFromList->version)) {
1061.                            $moduleFromList->version_addons = $module['version'];
1062.                            $modulesNameToCursor[mb_strtolower(strval($name))] = $moduleFromList;
1063.                        }
1064.    
1065.                        continue;
```  
```Argument [0]  
vierbergenlars\SemVer\version Object
(
    [version:vierbergenlars\SemVer\version:private] =&gt; 5.4.2
    [major:vierbergenlars\SemVer\version:private] =&gt; 5
    [minor:vierbergenlars\SemVer\version:private] =&gt; 4
    [patch:vierbergenlars\SemVer\version:private] =&gt; 2
    [build:vierbergenlars\SemVer\version:private] =&gt; -1
    [prtag:vierbergenlars\SemVer\version:private] =&gt; 
    [chunks:vierbergenlars\SemVer\expression:private] =&gt; Array
        (
        )

)

Argument [1]  
7.4.1.9
```  
- **ModuleCore::getModulesOnDisk** - [line `334` - `controllers/admin/AdminModulesController.php`]  
 - [3 Arguments]  
```php  
329.                }
330.                $modulesPreferences[$v['module']] = $v;
331.            }
332.    
333.            // Retrieve Modules List
334. =>         $modules = Module::getModulesOnDisk(true, $this->logged_on_addons, $this->id_employee);
335.            $this->initModulesList($modules);
336.            $this->nb_modules_total = count($modules);
337.            $moduleErrors = [];
338.            $moduleSuccess = [];
339.            $upgradeAvailable = [];
```  
```Argument [0]  
1
Argument [1]  

Argument [2]  
1
```  
- **AdminModulesControllerCore->initContent** - [line `262` - `classes/controller/Controller.php`]  
```php  
257.                if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
258.                    $this->initHeader();
259.                }
260.    
261.                if ($this->viewAccess()) {
262. =>                 $this->initContent();
263.                } else {
264.                    $this->errors[] = Tools::displayError('Access denied.');
265.                }
266.    
267.                if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
```  
- **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();
```  

 

  • 0
Posted (edited)

Version is: 7.1.26

Also other TB module did give this error: statsmodule-v2.0.2

Edited by Smile
  • 0
Posted

It might have to do something with in the config file:

define('_PS_VERSION_', '1.6.1.999');
define('_TB_VERSION_', '1.0.8');

But when I remove 'define('_PS_VERSION_', '1.6.1.999');' I get the error: Use of undefined constant _PS_VERSION_ - assumed '_PS_VERSION_' in /home/beenl/public_html/test4orgineel/override/classes/Cookie.php on line 25

  • 0
Posted

Problem is with the paypal module. This has a version number of 7.4.1.9, and this is not in line with the version check pattern.

Workaround: Removing this paypal module (or changing the version number in the module & db) fixes the issue.

Real fix should be in allowing the version nummer with 4 digits.

As a side note: the TB version of paypal is v5.4.2 which is lower than the already installed paypal module. So auto updating probably will also not occur.

 

Credits go to the programmer 😉

 

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...