1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MG 1.1 Error Trying to Create New Album

Discussion in 'Media Gallery Support' started by beanfan78, Oct 21, 2015.

  1. beanfan78

    beanfan78 Active Member

    I am getting an error and I am using XF 1.5.2 and XMG 1.1.2. Not sure what else to do besides reviewing permissions and trying different settings:

    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 Zend/Db/Adapter/Abstract.php at line 574
    5. Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1624
    6. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1613
    7. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1405
    8. XenForo_DataWriter->save() in XenGallery/ControllerPublic/Album.php at line 1067
    9. XenGallery_ControllerPublic_Album->actionCreate() in XenForo/FrontController.php at line 351
    10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    11. XenForo_FrontController->run() in /home/tdmrjfrm/public_html/index.php at line 13
  2. Mike

    Mike XenForo Developer Staff Member

    Please provide the actual error message. That's just the backtrace.
  3. beanfan78

    beanfan78 Active Member

    @Mike do you mean this?

    Error Info
    Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'album_rating_weighted' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
    Generated By: Ted, 10 minutes ago
    Stack Trace
    #0 /home/tdmrjfrm/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('INSERT INTO `xe...')
    #1 /home/tdmrjfrm/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'INSERT INTO `xe...')
    #2 /home/tdmrjfrm/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('INSERT INTO `xe...')
    #3 /home/tdmrjfrm/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xe...', Array)
    #4 /home/tdmrjfrm/public_html/library/XenForo/DataWriter.php(1624): Zend_Db_Adapter_Abstract->insert('xengallery_albu...', Array)
    #5 /home/tdmrjfrm/public_html/library/XenForo/DataWriter.php(1613): XenForo_DataWriter->_insert()
    #6 /home/tdmrjfrm/public_html/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
    #7 /home/tdmrjfrm/public_html/library/XenGallery/ControllerPublic/Album.php(1067): XenForo_DataWriter->save()
    #8 /home/tdmrjfrm/public_html/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_Album->actionCreate()
    #9 /home/tdmrjfrm/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #10 /home/tdmrjfrm/public_html/index.php(13): XenForo_FrontController->run()
    #11 {main}
    Request State
    array(3) {
    ["url"] => string(53) "http://www.mydomain.com/media/albums/create"
    ["_GET"] => array(0) {
    ["_POST"] => array(11) {
    ["album_title"] => string(4) "test"
    ["album_description"] => string(4) "test"
    ["view_media"] => string(7) "private"
    ["view_users"] => string(0) ""
    ["add_media"] => string(7) "private"
    ["add_users"] => string(0) ""
    ["_xfConfirm"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(10) "/media/add"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  4. Brogan

    Brogan XenForo Moderator Staff Member

    That could indicate the column in the database is missing.

    Have you recently installed or upgraded?

    Can you run this query in phpMyAdmin and post the full text output?

    SHOW CREATE TABLE xengallery_album
  5. Chris D

    Chris D XenForo Developer Staff Member

    This column is a reasonably recent addition, but there actually doesn't appear to be a situation where it should be missing - it is added for new installs and it should have been added when upgrading to or beyond the version which added it.

    Have you been in any situations where you have had to restore the database from a back up?

    Please do run the query as mentioned by Brogan above, this will allow us to see if there are any other columns missing.
  6. beanfan78

    beanfan78 Active Member

    I have updating as it had becoming along. I ran the query and this is what I got:

    SQL query: SHOW CREATE TABLE xengallery_album;
    Rows: 1

    Table Create Table
    xengallery_album CREATE TABLE `xengallery_album` (
    `album_id` int...
  7. beanfan78

    beanfan78 Active Member

    Also, no restores or anything. I just upgraded from 1.1.1 to 1.1.2 because one of the members was complaining and I duplicated the error and thought maybe the upgrade would fix it.
  8. Chris D

    Chris D XenForo Developer Staff Member

    The output of that query isn't actually complete.

    That said, this should rectify the problem at hand as it will add the missing column:
    ALTER TABLE xengallery_album
    ADD COLUMN album_rating_weighted float DEFAULT '0' NOT NULL AFTER album_rating_avg
    Let us know if you continue to receive issues after running that query.
  9. beanfan78

    beanfan78 Active Member

    Thank you to all, it worked. I am not happy and ready to crash for the night! Seriously, you are all rockstars :)
    Chris D likes this.

Share This Page