RM 1.2 Showing server errors when eiditng resource

PAPPACLART

Active member
#1
Hello Updated to Xenforo 1.5.2 recently and yesterday updated the resource manager to the latest version.

When editing the resource itself or the resource icon I get the below errors. I did have waindigo resource icon plugin but I have disabled it. Do not know if it makes a difference but the server the site is hosted on was migrated from a Plesk panel to Cpanel.


Any suggestions would be great. Thanks in advance


Server Error (When editing resource Icon)
Mysqli prepare error: Unknown column 'icon_date' in 'field list'

  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 632
  5. Zend_Db_Adapter_Abstract->update() in XenForo/DataWriter.php at line 1640
  6. XenForo_DataWriter->_update() in XenForo/DataWriter.php at line 1609
  7. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1405
  8. XenForo_DataWriter->save() in XenResource/Model/Resource.php at line 1432
  9. XenResource_Model_Resource->applyResourceIcon() in XenResource/Model/Resource.php at line 1338
  10. XenResource_Model_Resource->uploadResourceIcon() in XenResource/ControllerPublic/Resource.php at line 1348
  11. XenResource_ControllerPublic_Resource->actionIcon() in XenForo/FrontController.php at line 351
  12. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  13. XenForo_FrontController->run() in /home/gtarena/public_html/community/index.php at line 13



Server Error (When editing resource only)
Mysqli prepare error: Table 'ryanacock_xenforo.xf_resource_field' doesn't exist

  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 XenForo/Model.php at line 219
  5. XenForo_Model->fetchAllKeyed() in XenResource/Model/ResourceField.php at line 78
  6. XenResource_Model_ResourceField->getResourceFields() in XenResource/Model/ResourceField.php at line 55
  7. XenResource_Model_ResourceField->getResourceFieldsForEdit() in XenResource/ControllerPublic/Resource.php at line 792
  8. XenResource_ControllerPublic_Resource->_getResourceAddOrEditResponse() in Tinhte/XenTag/XenResource/ControllerPublic/Resource.php at line 8
  9. Tinhte_XenTag_XenResource_ControllerPublic_Resource->_getResourceAddOrEditResponse() in XenResource/ControllerPublic/Resource.php at line 930
  10. XenResource_ControllerPublic_Resource->actionEdit() in XenForo/FrontController.php at line 351
  11. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  12. XenForo_FrontController->run() in /home/gtarena/public_html/community/index.php at line 13
 

Chris D

XenForo developer
Staff member
#2
As long as you're certain you actually ran the RM upgrade...

The upgrade likely failed to create all of the fields required due to having add-ons which had already added columns of the same name.

Run these queries separately in phpMyAdmin or similar - some of them may already exist.

Code:
ALTER TABLE xf_resource
   ADD custom_resource_fields MEDIUMBLOB NOT NULL
Code:
ALTER TABLE xf_resource
   ADD prefix_id INT UNSIGNED NOT NULL DEFAULT 0,
Code:
ALTER TABLE xf_resource
   ADD icon_date INT UNSIGNED NOT NULL DEFAULT 0
Code:
ALTER TABLE xf_resource
   ADD KEY prefix_id (prefix_id)
Code:
CREATE TABLE IF NOT EXISTS `xf_resource_field` (
   field_id VARBINARY(25) NOT NULL,
   display_group VARCHAR(25) NOT NULL DEFAULT 'above_info',
   display_order INT UNSIGNED NOT NULL DEFAULT 1,
   field_type VARCHAR(25) NOT NULL DEFAULT 'textbox',
   field_choices BLOB NOT NULL,
   match_type VARCHAR(25) NOT NULL DEFAULT 'none',
   match_regex VARCHAR(250) NOT NULL DEFAULT '',
   match_callback_class VARCHAR(75) NOT NULL DEFAULT '',
   match_callback_method VARCHAR(75) NOT NULL DEFAULT '',
   max_length INT UNSIGNED NOT NULL DEFAULT 0,
   required TINYINT UNSIGNED NOT NULL DEFAULT 0,
   display_template TEXT NOT NULL,
   PRIMARY KEY (field_id),
   KEY display_group_order (display_group, display_order)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8
 

PAPPACLART

Active member
#3
I for sure ran the upgrade correctly.

Thanks I will give that a go, though not to familiar with phpMyAdmin, but I have ran a queries before though it was a while ago.

Can't I just run the upgrade again or is that not advisable?

Thanks for your very quick response it is much appreciated :)
 

PAPPACLART

Active member
#8
Of all the messing around I have done with my sites and all the times I have broken them I have never taken a back up prior to doing updates and the like. I some how work out how to fix them lol I will take your advice though as my luck will soon run out haha :)

Thanks guys
 

PAPPACLART

Active member
#9
I can now upload icons so that half worked thanks :) Some of the SQL entries that you suggested I run did not work.

when editing the resource it now shows the below. Also I checked the table 'ryanacock_xenforo.xf_resource_field_category' does not exist in my database. Do I just create the Table or do I need some more code also?:)


Server Error
Mysqli prepare error: Table 'ryanacock_xenforo.xf_resource_field_category' doesn't exist

  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 XenForo/Model.php at line 219
  5. XenForo_Model->fetchAllKeyed() in XenResource/Model/ResourceField.php at line 78
  6. XenResource_Model_ResourceField->getResourceFields() in XenResource/Model/ResourceField.php at line 55
  7. XenResource_Model_ResourceField->getResourceFieldsForEdit() in XenResource/ControllerPublic/Resource.php at line 794
  8. XenResource_ControllerPublic_Resource->_getResourceAddOrEditResponse() in XenResource/ControllerPublic/Resource.php at line 932
  9. XenResource_ControllerPublic_Resource->actionEdit() in XenForo/FrontController.php at line 351
  10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  11. XenForo_FrontController->run() in /home/gtarena/public_html/community/index.php at line 13
 

Chris D

XenForo developer
Staff member
#10
This query should create it for you:
Code:
CREATE TABLE IF NOT EXISTS xf_resource_field_category (
    field_id VARBINARY(25) NOT NULL,
    resource_category_id INT NOT NULL,
    PRIMARY KEY (field_id, resource_category_id),
    KEY resource_category_id (resource_category_id)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
 

PAPPACLART

Active member
#11
Thanks @Chris D

Executed the above.

Now I have this error?

Mysqli prepare error: Table 'ryanacock_xenforo.xf_resource_field_value' doesn't exist

  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 XenForo/Model.php at line 219
  5. XenForo_Model->fetchAllKeyed() in XenResource/Model/ResourceField.php at line 78
  6. XenResource_Model_ResourceField->getResourceFields() in XenResource/Model/ResourceField.php at line 55
  7. XenResource_Model_ResourceField->getResourceFieldsForEdit() in XenResource/ControllerPublic/Resource.php at line 794
  8. XenResource_ControllerPublic_Resource->_getResourceAddOrEditResponse() in XenResource/ControllerPublic/Resource.php at line 932
  9. XenResource_ControllerPublic_Resource->actionEdit() in XenForo/FrontController.php at line 351
  10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  11. XenForo_FrontController->run() in /home/gtarena/public_html/community/index.php at line 13


Not sure how long this tennis game will go on for lol

Really appreciate your help :)


Edit

these are some of the server errors that are showing up.



Untitled.png
 
Last edited:

Chris D

XenForo developer
Staff member
#12
Some of these will probably fail and that's fine:
Code:
ALTER TABLE xf_resource_category
   ADD field_cache MEDIUMBLOB NOT NULL
Code:
ALTER TABLE xf_resource_category
   DROP allow_submit_user_group_ids
Code:
ALTER TABLE xf_resource_category
   ADD prefix_cache MEDIUMBLOB NOT NULL COMMENT 'Serialized data from xf_resource_category_prefix, [group_id][prefix_id] => prefix_id'
Code:
ALTER TABLE xf_resource_category
   ADD require_prefix TINYINT UNSIGNED NOT NULL DEFAULT '0'
Code:
ALTER TABLE xf_resource_category
   ADD featured_count SMALLINT UNSIGNED NOT NULL DEFAULT '0'
And finally:
Code:
CREATE TABLE IF NOT EXISTS xf_resource_field_value (
   resource_id INT UNSIGNED NOT NULL,
   field_id VARBINARY(25) NOT NULL,
   field_value MEDIUMTEXT NOT NULL,
   PRIMARY KEY (resource_id, field_id),
   KEY field_id (field_id)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
 

Mike

XenForo developer
Staff member
#13
Are you sure you actually "upgraded" the RM? What version is it showing in the control panel? It appears that none of the upgrade steps have actually run.
 
Top