VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: carsten888 on December 31, 2018, 11:10:05 AM

Title: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: carsten888 on December 31, 2018, 11:10:05 AM
I'm trying to update my live site from 3.2.12 to 3.2.14.
I get this warning:
Quote
To ensure seemless working with Virtuemart please use MySQLi as database type in Joomla configuration
Extension Update: Custom install routine failure.
But in the joomla config the database IS using mysqli.

How to proceed?

I got an exact copy of the site on localhost and had no problem doing the update.   :o
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: jenkinhill on December 31, 2018, 11:59:57 AM
PHP version?
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: GJC Web Design on December 31, 2018, 12:36:09 PM
and why 3.2.14?
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: carsten888 on December 31, 2018, 14:19:41 PM
php 7.1.25-1
J 3.8.12
Quoteand why 3.2.14?
because that is the latest version according to Joomla update.
So I emptied the cache and tried again, now its version 3.4.2. But when trying to update I get the same error.

Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: jenkinhill on December 31, 2018, 17:06:23 PM
ISTR Milbo mentioned that the latest VM version is for Joomla 3.9  (now at 3.9.1)
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: carsten888 on January 01, 2019, 16:43:24 PM
I updated to 3.9.1 and tried again. Same issue.  :-[
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: carsten888 on January 18, 2019, 09:04:20 AM
solved! Bug in Joomla core.

How wierd. In the Joomla config at 'database type' 'mysqli' was selected. But in the configuration.php
public $dbtype = 'mysql';
I changed that to
public $dbtype = 'mysqli';
and had no problem updating vm.
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: GJC Web Design on January 18, 2019, 09:11:28 AM
oddly I had exactly this problem yesterday with a site upgrade...
and this is the weird part...

In Joomla admin config it clearly showed mysqli  in the dropdown but VM still said mysql on install.
The installer takes this directly from the configuration.php

      $config = JFactory::getConfig();
      $type = $config->get( 'dbtype' );
      if ($type != 'mysqli' and $type!= 'Jdiction_mysqli') {
         JFactory::getApplication()->enqueueMessage('To ensure seemless working with Virtuemart please use MySQLi as database type in Joomla configuration', 'warning');
         return false;
      }

when I checked the configuration.php by ftp it did say public $dbtype = 'mysql';

I have no idea how this can be possible but manually changing this to public $dbtype = 'mysqli'; and the upgrade worked fine

Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: carsten888 on January 18, 2019, 12:15:07 PM
good to know I'm not the only one with this crazy issue.  :)
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: GJC Web Design on January 18, 2019, 12:56:59 PM
almost as if Joomla doesn't read the states directly from configuration.php but stores them elsewhere .. can't find anything like this though (DB or xmls etc)

but the problem is repeatable

just changed and saved the config but it doesn't change in JAdmin -- no caches etc configged..

hmmmm

debugging directly in administrator\components\com_config\model\application.php the correct state is shown but the select still doesn't update

and directly at the form template still shows wrong even though $this is correct  [dbtype] => mysql

administrator\components\com_config\view\application\tmpl\default_database.php

ah....  there is no mysql value

<select id="jform_dbtype" name="jform[dbtype]" style="display: none; font-family: Arial;">
   <option value="mysqli" style="font-family: Arial;">MySQLi</option>
   <option value="pgsql" style="font-family: Arial;">PostgreSQL (PDO)</option>
   <option value="pdomysql" selected="selected" style="font-family: Arial;">MySQL (PDO)</option>
   <option value="postgresql" style="font-family: Arial;">PostgreSQL</option>
</select>

so if config is set to mysql it just defaults to the 1st one which is mysqli
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: carsten888 on January 18, 2019, 16:07:48 PM
Good debugging!  :)

You might want report that bug. If only for all the VM users.
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: Milbo on February 11, 2019, 20:46:20 PM
I think for all joomla users also. Sounds really like a joomla bug.
Title: Re: update 3.2.12 to 3.2.14 fails "use MySQLi" but site is using MySQLi ?!
Post by: Studio 42 on February 11, 2019, 22:50:48 PM
The problem is perhaps because mysql is already saved before upgrade
mysql was and continue to be a valid choice on Joomla 4, if i read correctly.
In latest built : https://github.com/joomla/joomla-cms/blob/ad2c673ac27c2fd19bbdf6003aee0451d068de16/installation/forms/setup.xml
<field
         name="db_type"
         type="databaseconnection"
         label="INSTL_DATABASE_TYPE_DESC"
         id="db_type"
         class="custom-select form-control"
         supported="mysql,mysqli,pgsql,postgresql"
         required="true"
         default="mysqli"
         filter="string"
      />