[TH] Custom Fields [Deleted]

Can custom thread fields be required before submitting the thread? Can the rest of the editor be removed on the new thread page on forums this is enabled in so you can only fill the fields in? Thanks.
It is not currently possible to remove the editor completely. This has been suggested several times but never implemented. Drop me a PM if you'd be interested in this.
 
Two issues - I've created and deleted a couple of custom user fields, but they're not actually gone - they export when I export data with the search and export tool. I'd like to actually be rid of them.

Also, for custom thread fields, we're having some users who aren't able to edit (they have permissions - the overlay is taking their whole screen and they can't actually scroll or navigate). Any ideas?
 
Two issues - I've created and deleted a couple of custom user fields, but they're not actually gone - they export when I export data with the search and export tool. I'd like to actually be rid of them.
This is a problem with the way XenForo caches custom fields. Rebuilding caches may help, but otherwise there is not much can be done about this.

Also, for custom thread fields, we're having some users who aren't able to edit (they have permissions - the overlay is taking their whole screen and they can't actually scroll or navigate). Any ideas?
Screenshot?
 
Screen+shot+2014-06-16+at+8.28.02+PM.png


Screen+shot+2014-06-16+at+8.28.14+PM.png


Screen+shot+2014-06-16+at+8.28.28+PM.png


The blue scrollbar at the right only scrolls the background. To get to the bottom of the form, she had to zoom all the way out so that the whole form was on the screen. It's intermittent, though - I can't seem to find any common thread/OS/browser/platform/etc.

This is a problem with the way XenForo caches custom fields. Rebuilding caches may help, but otherwise there is not much can be done about this.

Which cache? DB restart help? Anything? I can deal with a few minutes of downtime if it solves this issue.
 
Another question - for fields set up with a drop down, is it possible to force the options to sort alphabetically? We have a couple where we add choices over time and it would work best if they just auto sorted instead of displaying in the order they were added.
 
@Waindigo , after uninstall this addon I have many server errors

Please Help :cry:

When try to edit any resource i get this error:


Code:
Server Error

Mysqli prepare error: Table 'pijanitv_xenforo2.xf_resource_field_category' doesn't exist

    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in XenForo/Model.php at line 219
    XenForo_Model->fetchAllKeyed() in XenResource/Model/ResourceField.php at line 78
    XenResource_Model_ResourceField->getResourceFields() in XenResource/Model/ResourceField.php at line 55
    XenResource_Model_ResourceField->getResourceFieldsForEdit() in XenResource/ControllerPublic/Resource.php at line 738
    XenResource_ControllerPublic_Resource->_getResourceAddOrEditResponse() in XenResource/ControllerPublic/Resource.php at line 858
    XenResource_ControllerPublic_Resource->actionEdit() in XenForo/FrontController.php at line 347
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    XenForo_FrontController->run() in /home/pijanitv/public_html/index.php at line 13

In Admin CP I have tons of this errors:

Code:
Server Error Log
Error Info
ErrorException: Undefined index: prefix_cache - library/XenResource/ControllerPublic/Resource.php:493
Generated By: Unknown Account, A moment ago
Stack Trace

#0 /home/pijanitv/public_html/library/XenResource/ControllerPublic/Resource.php(493): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/pijanitv/...', 493, Array)
#1 /home/pijanitv/public_html/library/XenResource/ControllerPublic/Resource.php(155): XenResource_ControllerPublic_Resource->_displayFilterOptions(Array, Array)
#2 /home/pijanitv/public_html/library/*******/SearchResourceName/ControllerPublic/Resource.php(21): XenResource_ControllerPublic_Resource->actionIndex()
#3 /home/pijanitv/public_html/library/*******/FilterResourceAuthor/ControllerPublic/Resource.php(41): *******_SearchResourceName_ControllerPublic_Resource->actionIndex()
#4 /home/pijanitv/public_html/library/*******/ResourcesPagination/ControllerPublic/Resource.php(12): *******_FilterResourceAuthor_ControllerPublic_Resource->actionIndex()
#5 /home/pijanitv/public_html/library/FireDaemon/ResourceManager/ViewCount/ControllerPublic/Resource.php(7): *******_ResourcesPagination_ControllerPublic_Resource->actionIndex()
#6 /home/pijanitv/public_html/library/XenForo/FrontController.php(347): FireDaemon_ResourceManager_ViewCount_ControllerPublic_Resource->actionIndex()
#7 /home/pijanitv/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /home/pijanitv/public_html/index.php(13): XenForo_FrontController->run()
#9 {main}

Request State

array(3) {
  ["url"] => string(83) "http://www.pijanitvor.com/index.php?resources/&order=rating_weighted&begin=U&page=4"
  ["_GET"] => array(4) {
    ["resources/"] => string(0) ""
    ["order"] => string(15) "rating_weighted"
    ["begin"] => string(1) "U"
    ["page"] => string(1) "4"
  }
  ["_POST"] => array(0) {
  }
}

Code:
Server Error Log
Error Info
ErrorException: Undefined index: featured_count - library/XenResource/Model/Category.php:503
Generated By: Unknown Account, 2 minutes ago
Stack Trace

#0 /home/pijanitv/public_html/library/XenResource/Model/Category.php(503): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/pijanitv/...', 503, Array)
#1 /home/pijanitv/public_html/library/XenResource/Model/Category.php(474): XenResource_Model_Category->_applyRecursiveCountsToGrouped(Array, 0)
#2 /home/pijanitv/public_html/library/XenResource/ControllerPublic/Resource.php(67): XenResource_Model_Category->applyRecursiveCountsToGrouped(Array)
#3 /home/pijanitv/public_html/library/*******/SearchResourceName/ControllerPublic/Resource.php(21): XenResource_ControllerPublic_Resource->actionIndex()
#4 /home/pijanitv/public_html/library/*******/FilterResourceAuthor/ControllerPublic/Resource.php(41): *******_SearchResourceName_ControllerPublic_Resource->actionIndex()
#5 /home/pijanitv/public_html/library/*******/ResourcesPagination/ControllerPublic/Resource.php(12): *******_FilterResourceAuthor_ControllerPublic_Resource->actionIndex()
#6 /home/pijanitv/public_html/library/FireDaemon/ResourceManager/ViewCount/ControllerPublic/Resource.php(7): *******_ResourcesPagination_ControllerPublic_Resource->actionIndex()
#7 /home/pijanitv/public_html/library/XenForo/FrontController.php(347): FireDaemon_ResourceManager_ViewCount_ControllerPublic_Resource->actionIndex()
#8 /home/pijanitv/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/pijanitv/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}

Request State

array(3) {
  ["url"] => string(83) "http://www.pijanitvor.com/index.php?resources/&order=download_count&begin=E&page=20"
  ["_GET"] => array(4) {
    ["resources/"] => string(0) ""
    ["order"] => string(14) "download_count"
    ["begin"] => string(1) "E"
    ["page"] => string(2) "20"
  }
  ["_POST"] => array(0) {
  }
}


Code:
Server Error Log
Error Info
ErrorException: Undefined index: featured_count - library/XenResource/ControllerPublic/Resource.php:89
Generated By: Unknown Account, A moment ago
Stack Trace

#0 /home/pijanitv/public_html/library/XenResource/ControllerPublic/Resource.php(89): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/pijanitv/...', 89, Array)
#1 /home/pijanitv/public_html/library/*******/SearchResourceName/ControllerPublic/Resource.php(21): XenResource_ControllerPublic_Resource->actionIndex()
#2 /home/pijanitv/public_html/library/*******/FilterResourceAuthor/ControllerPublic/Resource.php(41): *******_SearchResourceName_ControllerPublic_Resource->actionIndex()
#3 /home/pijanitv/public_html/library/*******/ResourcesPagination/ControllerPublic/Resource.php(12): *******_FilterResourceAuthor_ControllerPublic_Resource->actionIndex()
#4 /home/pijanitv/public_html/library/FireDaemon/ResourceManager/ViewCount/ControllerPublic/Resource.php(7): *******_ResourcesPagination_ControllerPublic_Resource->actionIndex()
#5 /home/pijanitv/public_html/library/XenForo/FrontController.php(347): FireDaemon_ResourceManager_ViewCount_ControllerPublic_Resource->actionIndex()
#6 /home/pijanitv/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /home/pijanitv/public_html/index.php(13): XenForo_FrontController->run()
#8 {main}

Request State

array(3) {
  ["url"] => string(83) "http://www.pijanitvor.com/index.php?resources/&order=rating_weighted&begin=U&page=4"
  ["_GET"] => array(4) {
    ["resources/"] => string(0) ""
    ["order"] => string(15) "rating_weighted"
    ["begin"] => string(1) "U"
    ["page"] => string(1) "4"
  }
  ["_POST"] => array(0) {
  }
}
 
Also @Waindigo, when I try to edit any phrase I get similiar error:

Code:
Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'featured_count' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Sunka, 21 minutes ago
Stack Trace

#0 /home/pijanitv/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('UPDATE `xf_reso...')
#1 /home/pijanitv/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'UPDATE `xf_reso...')
#2 /home/pijanitv/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('UPDATE `xf_reso...')
#3 /home/pijanitv/public_html/library/Zend/Db/Adapter/Abstract.php(632): Zend_Db_Adapter_Abstract->query('UPDATE `xf_reso...', Array)
#4 /home/pijanitv/public_html/library/XenForo/DataWriter.php(1640): Zend_Db_Adapter_Abstract->update('xf_resource_cat...', Array, 'resource_catego...')
#5 /home/pijanitv/public_html/library/XenForo/DataWriter.php(1609): XenForo_DataWriter->_update()
#6 /home/pijanitv/public_html/library/XenForo/DataWriter.php(1405): XenForo_DataWriter->_save()
#7 /home/pijanitv/public_html/library/XenResource/Deferred/Category.php(18): XenForo_DataWriter->save()
#8 /home/pijanitv/public_html/library/XenForo/Model/Deferred.php(256): XenResource_Deferred_Category->execute(Array, Array, 6.94161510468, '')
#9 /home/pijanitv/public_html/library/XenForo/Model/Deferred.php(390): XenForo_Model_Deferred->runDeferred(Array, 6.94161510468, '', false)
#10 /home/pijanitv/public_html/library/XenForo/Model/Deferred.php(335): XenForo_Model_Deferred->_runInternal(Array, 6.94161605835, '', false)
#11 /home/pijanitv/public_html/library/XenForo/ViewRenderer/Abstract.php(352): XenForo_Model_Deferred->run(true, 6.94161605835)
#12 /home/pijanitv/public_html/library/XenForo/ViewRenderer/Json.php(147): XenForo_ViewRenderer_Abstract::hasManualDeferredToRun()
#13 /home/pijanitv/public_html/library/XenForo/ViewRenderer/Json.php(185): XenForo_ViewRenderer_Json::_addDefaultParams(Array)
#14 /home/pijanitv/public_html/library/XenForo/ViewRenderer/Json.php(37): XenForo_ViewRenderer_Json::jsonEncodeForOutput(Array)
#15 /home/pijanitv/public_html/library/XenForo/FrontController.php(597): XenForo_ViewRenderer_Json->renderRedirect(4, 'http://www.pija...', NULL, Array)
#16 /home/pijanitv/public_html/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_Redirect), Object(XenForo_ViewRenderer_Json), Array)
#17 /home/pijanitv/public_html/admin.php(13): XenForo_FrontController->run()
#18 {main}

Request State

array(3) {
  ["url"] => string(48) "http://www.pijanitvor.com/admin.php?phrases/save"
  ["_GET"] => array(1) {
    ["phrases/save"] => string(0) ""
  }
  ["_POST"] => array(9) {
    ["title"] => string(22) "no_permission_to_reply"
    ["phrase_text"] => string(32) "Nemate ovlasti za pisanje ovdje!"
    ["addon_id"] => string(7) "XenForo"
    ["phrase_id"] => string(1) "0"
    ["language_id"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(43) "/admin.php?phrases/46589/edit&language_id=1"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Is there any way to call up the custom thread fields in templates? I can pull up the normal custom user fields alright, but can't figure out how to reference the thread fields.
 
On XF 1.4 I'm getting an error when using the Flash Uploader within a node where this add-on is enabled. It throws a "There was a problem uploading your file" error.
The uploader is working fine across the board except within that single node where this mod is enabled. It works fine if I disable the Flash Uploader.
Thanks for any help.

*Edit* Disabling/reenabling the mod seems to have solved this.
 
Last edited:
Any news about updated uninstall code of this mod @Waindigo? I post errors in posts #868 and #869

Also, this mod is disabled on my forum, until uninstalling will be possible (new version), so quoted errors are not happened any more.


But, when try to copy post from one thread to another, I have another server error. Could you tell me is that error conected with this your Mod (even if mod is disabled in acp).

Code:
Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'node_id' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Sunka, 11 minutes ago
Stack Trace

#0 /home/pijanitv/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('INSERT INTO `xf...')
#1 /home/pijanitv/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'INSERT INTO `xf...')
#2 /home/pijanitv/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('INSERT INTO `xf...')
#3 /home/pijanitv/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#4 /home/pijanitv/public_html/library/XenForo/Model/Post.php(1633): Zend_Db_Adapter_Abstract->insert('xf_post', Array)
#5 /home/pijanitv/public_html/library/XenForo/Model/Post.php(1471): XenForo_Model_Post->_copyPost(Array, Array, Array)
#6 /home/pijanitv/public_html/library/XenForo/Model/Post.php(1377): XenForo_Model_Post->_moveOrCopyPosts('copy', Array, Array, Array, Array)
#7 /home/pijanitv/public_html/library/XenForo/Model/InlineMod/Post.php(475): XenForo_Model_Post->copyPosts(Array, Array, Array, Array)
#8 /home/pijanitv/public_html/library/XenForo/Model/InlineMod/Post.php(419): XenForo_Model_InlineMod_Post->_moveOrCopyPosts('copy', Array, Array, Array, Array, NULL)
#9 /home/pijanitv/public_html/library/XenForo/ControllerPublic/InlineMod/Post.php(231): XenForo_Model_InlineMod_Post->copyPosts(Array, Array, NULL)
#10 /home/pijanitv/public_html/library/XenForo/ControllerPublic/InlineMod/Post.php(155): XenForo_ControllerPublic_InlineMod_Post->_moveOrCopyPostsAction('canCopyPosts', 'copyPosts', 'XenForo_ViewPub...', 'inline_mod_post...')
#11 /home/pijanitv/public_html/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_InlineMod_Post->actionCopy()
#12 /home/pijanitv/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#13 /home/pijanitv/public_html/index.php(13): XenForo_FrontController->run()
#14 {main}

Request State

array(3) {
  ["url"] => string(56) "http://www.pijanitvor.com/index.php?inline-mod/post/copy"
  ["_GET"] => array(2) {
    ["inline-mod/post/copy"] => string(0) ""
    ["threads/25314/"] => string(0) ""
  }
  ["_POST"] => array(7) {
    ["thread_type"] => string(8) "existing"
    ["existing_url"] => string(50) "http://www.pijanitvor.com/index.php?threads/25314/"
    ["save"] => string(10) "Copy Posts"
    ["posts"] => array(1) {
      [0] => string(6) "339873"
    }
    ["_xfConfirm"] => string(1) "1"
    ["redirect"] => string(50) "http://www.pijanitvor.com/index.php?threads/25313/"
    ["_xfToken"] => string(8) "********"
  }
}
 
Does this addon work on 1.4? :)

Edit: Seems to be working fine, for anyone who was worried like I was. :)
 
Last edited:
Hello. I have a problem with this add-on.

I am testing it at the moment. The problem is that the search results dont find aynthing related to this add-on.

For example I make a drop-down menu and let choose something or make a multi-line box and let type something.
In both cases if I search for the title of the field (not title of the thread) or for the ceontent of the field (not content of the thread), nothing can be found.

What am I doing wrong?
 
But, when try to copy post from one thread to another, I have another server error. Could you tell me is that error conected with this your Mod (even if mod is disabled in acp).

Code:
Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'node_id' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Sunka, 11 minutes ago
Stack Trace

#0 /home/pijanitv/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('INSERT INTO `xf...')
#1 /home/pijanitv/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'INSERT INTO `xf...')
#2 /home/pijanitv/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('INSERT INTO `xf...')
#3 /home/pijanitv/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#4 /home/pijanitv/public_html/library/XenForo/Model/Post.php(1633): Zend_Db_Adapter_Abstract->insert('xf_post', Array)
#5 /home/pijanitv/public_html/library/XenForo/Model/Post.php(1471): XenForo_Model_Post->_copyPost(Array, Array, Array)
#6 /home/pijanitv/public_html/library/XenForo/Model/Post.php(1377): XenForo_Model_Post->_moveOrCopyPosts('copy', Array, Array, Array, Array)
#7 /home/pijanitv/public_html/library/XenForo/Model/InlineMod/Post.php(475): XenForo_Model_Post->copyPosts(Array, Array, Array, Array)
#8 /home/pijanitv/public_html/library/XenForo/Model/InlineMod/Post.php(419): XenForo_Model_InlineMod_Post->_moveOrCopyPosts('copy', Array, Array, Array, Array, NULL)
#9 /home/pijanitv/public_html/library/XenForo/ControllerPublic/InlineMod/Post.php(231): XenForo_Model_InlineMod_Post->copyPosts(Array, Array, NULL)
#10 /home/pijanitv/public_html/library/XenForo/ControllerPublic/InlineMod/Post.php(155): XenForo_ControllerPublic_InlineMod_Post->_moveOrCopyPostsAction('canCopyPosts', 'copyPosts', 'XenForo_ViewPub...', 'inline_mod_post...')
#11 /home/pijanitv/public_html/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_InlineMod_Post->actionCopy()
#12 /home/pijanitv/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#13 /home/pijanitv/public_html/index.php(13): XenForo_FrontController->run()
#14 {main}

Request State

array(3) {
  ["url"] => string(56) "http://www.pijanitvor.com/index.php?inline-mod/post/copy"
  ["_GET"] => array(2) {
    ["inline-mod/post/copy"] => string(0) ""
    ["threads/25314/"] => string(0) ""
  }
  ["_POST"] => array(7) {
    ["thread_type"] => string(8) "existing"
    ["existing_url"] => string(50) "http://www.pijanitvor.com/index.php?threads/25314/"
    ["save"] => string(10) "Copy Posts"
    ["posts"] => array(1) {
      [0] => string(6) "339873"
    }
    ["_xfConfirm"] => string(1) "1"
    ["redirect"] => string(50) "http://www.pijanitvor.com/index.php?threads/25313/"
    ["_xfToken"] => string(8) "********"
  }
}

My appologies to you @Waindigo, above error is nothing to do with your Mod. It is connected with another mod and it is solved with new version.



Any news about updated uninstall code of this mod @Waindigo? I post errors in posts #868 and #869

Also, this mod is disabled on my forum, until uninstalling will be possible (new version), so quoted errors are not happened any more.

Still, I am waiting for new version of this Mod couse, like you said to me in PM, you have to make better uninstalling code couse this mode in uninstalling process delete some database rows of default official Xenforo Resource manager Mod.
 
Hi,
thanks for your great add-on!
I need to import a custom field from vbulletin to xenForo. I created the custom fields from acp. And I have made a php script that reads from the vbulletin database and should write to the database of xenForo, but I saw that the column xf_thread.custom_fields is a blob and I did not understand how I should write this field. Can you tell me how I can write my custom fields strings in this blob column?
Thanks a lot.
Regards
 
Hi,
thanks for your great add-on!
I need to import a custom field from vbulletin to xenForo. I created the custom fields from acp. And I have made a php script that reads from the vbulletin database and should write to the database of xenForo, but I saw that the column xf_thread.custom_fields is a blob and I did not understand how I should write this field. Can you tell me how I can write my custom fields strings in this blob column?
Thanks a lot.
Regards


You need to serialize the data.

This is what I did to import custom fields from VB

PHP:
$location = $thread['vbfield1'];
$price = $thread['vbfield2'];

$array = array("price" => $price,"location" => $location,);

$array = serialize($array);

$arrQuoted = $db->quote($array);

$db->query("
UPDATE xf_thread
SET custom_fields = {$arrQuoted}
WHERE thread_id = ?  ", $newThreadId);

You should also insert the same data into the xf_thread_field_value tables

PHP:
$fieldvalue = $thread['vbfield1'];

$field_id = "location";         // xf custom field name

$db->query(
        '
        INSERT INTO xf_thread_field_value
        (thread_id, field_id, field_value)
        VALUES
        (?, ?, ?)
        ON DUPLICATE KEY UPDATE
        field_value = VALUES(field_value)
        ',
        array(
            $newThreadId,
            $field_id,
            $fieldvalue
        ));

$fieldvalue = $thread['vbfield2'];

$field_id = "price";            // xf custom field name
           
  $db->query(
        '
        INSERT INTO xf_thread_field_value
        (thread_id, field_id, field_value)
        VALUES
        (?, ?, ?)
        ON DUPLICATE KEY UPDATE
        field_value = VALUES(field_value)
        ',
        array(
            $newThreadId,
            $field_id,
            $fieldvalue
        ));
 
Top Bottom