xfCheck [Deleted]

I get this when I try to install.

Server Error
Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NONE' at line 1

  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in xfCheck/Install.php at line 12
  5. xfCheck_Install::installLicenseCheck()
  6. call_user_func() in XenForo/Model/AddOn.php at line 214
  7. XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
  8. XenForo_Model_AddOn->installAddOnXmlFromFile() in AddOnInstaller/ControllerAdmin/AddOn.php at line 42
  9. AddOnInstaller_ControllerAdmin_AddOn->actionInstallUpgrade() in XenForo/FrontController.php at line 313
  10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  11. XenForo_FrontController->run() in /home/xxx/public_html/xxx/store/admin.php at line 13
 
I don't understand how anyone has been able to install this...

There's at least two queries in the install that do not work:

Code:
ALTER TABLE `xf_user` ADD COLUMN `token` BLOB DEFAULT NONE

NONE is not valid.

It should be:

Code:
ALTER TABLE `xf_user` ADD COLUMN `token` BLOB DEFAULT NULL

@Matthew Hawley

If you edit Install.php you can change the two queries that contain DEFAULT NONE to DEFAULT NULL and it should install.
 
I don't understand how anyone has been able to install this...

There's at least two queries in the install that do not work:

Code:
ALTER TABLE `xf_user` ADD COLUMN `token` BLOB DEFAULT NONE

NONE is not valid.

It should be:

Code:
ALTER TABLE `xf_user` ADD COLUMN `token` BLOB DEFAULT NULL

@Matthew Hawley

If you edit Install.php you can change the two queries that contain DEFAULT NONE to DEFAULT NULL and it should install.

I tried and I still get the same error.

Code:
<?php

class xfCheck_Install
{
    public static function installLicenseCheck($existingAddOn, $addOnData)
    {
        $db = XenForo_Application::get('db');
        $tokenColumn = $db->fetchOne("SHOW COLUMNS FROM `xf_user` LIKE 'xftoken'");
        if (empty($tokenColumn)) {
            $db->query("ALTER TABLE `xf_user` ADD COLUMN `token` BLOB DEFAULT NULL");
        }
        $domainColumn = $db->fetchOne("SHOW COLUMNS FROM `xf_user` LIKE 'domain'");
        if (empty($domainColumn)) {
            $db->query("ALTER TABLE `xf_user` ADD COLUMN `domain` VARCHAR(100) DEFAULT 0");
        }
        $ivColumn = $db->fetchOne("SHOW COLUMNS FROM `xf_user` LIKE 'iv'");
        if (empty($ivColumn))
        {
            $db->query("ALTER TABLE `xf_user` ADD COLUMN `iv` BLOB DEFAULT NULL");
        }
        $validColumn = $db->fetchOne("SHOW COLUMNS FROM `xf_user` LIKE `token_valid`");
        if (empty($validColumn))
        {
            $db->query("ALTER TABLE `xf_user` ADD COLUMN `token_valid` INT(1) DEFAULT 0");
        }
    }
    public static function uninstallLicenseCheck(array $addonInfo)
    {
        $db = XenForo_Application::get('db');
        $db->query("ALTER TABLE `xf_user` DROP COLUMN `token`");
        $db->query("ALTER TABLE `xf_user` DROP COLUMN `domain`");
        $db->query("ALTER TABLE `xf_user` DROP COLUMN `iv`");
        $db->query("ALTER TABLE `xf_user` DROP COLUMN `token_valid`");
    }
}
?>
 
You will need to check the error again, because the error is:

Rich (BB code):
Server Error
Mysqli prepare error: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server
version for the right syntax to use near 'NONE' at line 1

The error should be different because you've removed the "NONE" parts of the query. There may be other errors but I haven't tried it myself.

Also, if you're using my add-on installer, don't forget if you edit the file on your server, then use the add-on installer with the Zip file it will overwrite the existing files.
 
There is currently an error with using NULL with Blob so I'm working on a fix to make sure default values are set when updating the registration.
 
Yeah, actually, that's a good point.

You don't need (and can't have) a default value for a BLOB.

Code:
$db->query("ALTER TABLE `xf_user` ADD COLUMN `iv` BLOB");

That's all you need.
 
I know, don't know why I put DEFAULT. Right now there is an issue when users register that will error out due to no default value being set.
 
You shouldn't get an error about a BLOB not having a default value... what is the error?
 
That is what I thought too but people trying to register on my site get the following error:
Dangerously Dreaming
Server Error
Mysqli statement execute error : Field 'token' doesn't have a default value

  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  4. Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1591
  5. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1580
  6. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1381
  7. XenForo_DataWriter->save() in XenForo/ControllerPublic/Register.php at line 317
  8. XenForo_ControllerPublic_Register->actionRegister() in XenForo/FrontController.php at line 310
  9. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  10. XenForo_FrontController->run() in /home/ddream/public_html/index.php at line 13
 
I think you need to eyeball the actual table as it appears in MySQL or PHP My Admin.

BLOB fields just can't have a default value so I'm guessing that perhaps from some previous testing you maybe have it defined as a varchar or similar.
 
Odd managed to fix it, just have to update the install file to remove the unneeded nonsense when installing.
 
So far all my mods work on XenForo 1.2 Beta but as with anything on a beta I do not suggest running it all on a live site.
 
The member will automatically returns to the previous group the license is no longer valid?
 
FYI, if you have experienced problems with users not getting upgraded fully, you will have to manually rebuild user cache which will update all users still in the awaiting validation usergroup.
 
Top Bottom