[4.1 RC 2] Admin cp: Content types SQL error when updating active selections without changing the enabled/disabled state of any content type
On the Content types page of the admin cp, an SQL statement prepare error is encountered when an administrator attempts to submit the form without first changing which types are active/not active. The error:
Code:
XF\Db\InvalidQueryException: MySQL statement prepare error [1064]: 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 'END WHERE `id` IN () LIMIT 0' at line 3
UPDATE `vw_nodetype` SET `on` = CASE `id`
END WHERE `id` IN () LIMIT 0
Stack trace:
Code:
#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1064, '42000')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1064, '42000')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/addons/vw/vw/_core/controller/db/xf2.php(117): XF\Db\AbstractAdapter->query('UPDATE `vw_nod...')
#5 src/addons/vw/vw/_core/model/db/mysql/vw.php(1339): vw_DB_Controller_XF2->query_write('UPDATE `vw_nod...')
#6 src/addons/vw/vw/_core/model/db/mysql/vw.php(983): vw_DB_MySQL_Model->shutdown_or_run('UPDATE `vw_nod...', false)
#7 src/addons/vw/vw/_core/controller/cp/types/vw.php(138): vw_DB_MySQL_Model->update(Array)
#8 src/addons/vw/vw/_core/controller/cp/types/vw.php(29): vw_CP_Types_Controller->update()
#9 src/addons/vw/vw/Admin/Controller/Wiki.php(103): vw_CP_Types_Controller->execute('update', 'post')
#10 src/addons/vw/vw/Mvc/Dispatcher.php(30): vw\vw\Admin\Controller\Wiki->_actionIndex(Object(XF\Mvc\ParameterBag))
#11 src/addons/vw/vw/Admin/Controller/Wiki.php(51): vw\vw\Mvc\Dispatcher::dispatch(Object(vw\vw\Admin\Controller\Wiki), 'index', Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(350): vw\vw\Admin\Controller\Wiki->actionIndex(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('vw\\vw\\Admin\\Con...', 'Index', Object(XF\Mvc\RouteMatch), Object(vw\vw\Admin\Controller\Wiki), NULL)
#14 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(vw\vw\Admin\Controller\Wiki), NULL)
#15 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#17 src/XF.php(391): XF\App->run()
#18 admin.php(13): XF::runApp('XF\\Admin\\App')
#19 {main}
----
Additionally, a little more could perhaps be done to visually distinguish enabled and disabled types from each other. As it stands, the only difference is the checked/unchecked checkbox state on the right-hand side. With XenForo 2.x, disabled template modifications change to grey text by adding the class
.dataList-row--disabled to the applicable data row. One catch is this grey styling only specifically applies to links (via selector .dataList-row.dataList-row--disabled .dataList-cell--link a), so some extra CSS would, I believe, be necessary. Maybe something like the following could be added via a VaultWiki admin cp .less template:
Code:
.dataList-row.dataList-row--disabled .dataList-cell--main .dataList-mainRow
{
color: @xf-textColorMuted;
.m-transition();
}