TheLlamaman Posted September 17, 2023 Posted September 17, 2023 (edited) In the latest Invision Community release (4.7.13), I have tried to use the 'Copy to Database' feature of the Pages application. I selected the 'Copy Posts?' option and 'Use original author?'. When I submit, I see the following error suggesting there is a syntax error in a DB query: Note I've removed some paths and sensitive info. SELECT COUNT(*) FROM `cms_custom_database_4` WHERE field_25='<name removed>' AND primary_id_field != IS NULL IPS\Db\Exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IS NULL' at line 1 (1064) #0 <path removed>/system/Db/Select.php(388): IPS\_Db->preparedQuery() #1 <path removed>/system/Db/Select.php(446): IPS\Db\_Select->runQuery() #2 <path removed>/system/Db/Select.php(370): IPS\Db\_Select->rewind() #3 <path removed>/applications/cms/sources/Fields/Fields.php(1069): IPS\Db\_Select->first() #4 <path removed>/applications/cms/sources/Fields/Fields.php(412): IPS\cms\_Fields::validateUnique() #5 <path removed>/system/Helpers/Form/FormAbstract.php(382): IPS\cms\_Fields::IPS\cms\{closure}() #6 <path removed>/system/Helpers/Form/TextArea.php(119): IPS\Helpers\Form\_FormAbstract->validate() #7 <path removed>/system/Helpers/Form/Text.php(298): IPS\Helpers\Form\_TextArea->validate() #8 <path removed>/system/Helpers/Form/FormAbstract.php(170): IPS\Helpers\Form\_Text->validate() #9 <path removed>/system/Helpers/Form/FormAbstract.php(147): IPS\Helpers\Form\_FormAbstract->setValue() #10 <path removed>/system/Helpers/Form/TextArea.php(66): IPS\Helpers\Form\_FormAbstract->__construct() #11 <path removed>/system/Helpers/Form/Text.php(125): IPS\Helpers\Form\_TextArea->__construct() #12 <path removed>/applications/cms/sources/Fields/Fields.php(3163): IPS\Helpers\Form\_Text->__construct() #13 <path removed>/applications/cms/sources/Fields/Fields.php(433): IPS\cms\_Fields->buildHelper() #14 <path removed>/applications/cms/sources/Records/Records.php(518): IPS\cms\_Fields::fields() #15 <path removed>/applications/cms/modules/front/database/topic.php(200): IPS\cms\_Records::formElements() #16 <path removed>/system/Dispatcher/Controller.php(107): IPS\cms\modules\front\database\_topic->form() #17 <path removed>/applications/cms/modules/front/database/topic.php(47): IPS\Dispatcher\_Controller->execute() #18 <path removed>/system/Dispatcher/Dispatcher.php(153): IPS\cms\modules\front\database\_topic->execute() #19 <path removed>/index.php(13): IPS\_Dispatcher->run() #20 {main} This feature used to work fine up until recently, but it is now broken. Is this a new bug? Edited September 17, 2023 by TheLlamaman
Marc Posted September 18, 2023 Posted September 18, 2023 Do you have one I can test this with on your site, as I'm unable to replicate the issue on my end unfortunately.
TheLlamaman Posted September 18, 2023 Author Posted September 18, 2023 @Marc StridgenI have figured out how to replicate it. It only happens if one of your fields has the 'Unique Field' setting. As soon as I removed the 'Unique Field' setting from a text field I had setup in the database, the Copy to Database worked fine again. The Old Man 1
Jim M Posted September 18, 2023 Posted September 18, 2023 Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.
Marc Posted November 3, 2023 Posted November 3, 2023 This issue has been resolved in our recent 4.7.14 release of the platform. Please upgrade to resolve the issue, and if you see any further problems at that point, please let us know.
Recommended Posts