Checkboxes not working for custom job fields
-
Using the latest version of the plugin, in admin-jobs.php:
In the
jobman_updatedb()
function, data for checkbox custom fields for a given job is saved to the database by imploding on', '
.However, database data is read by exploding on the newline character (
\n
).Therefore, if you’ve checked more than one box, it’ll save to the database as
"Foo, Bar"
. When you try to explode, you get an array with one item:"Foo, Bar"
. When it checks to see if the value should be checked or not, neither"Foo"
nor"Bar"
are found in the array of data ("Foo, Bar"
).The explosion for the database data (
$data
) injobman_edit_job()
should be on a comma, rather than the newline character. Or implode on the newline character rather than a comma when saving. The latter would make it uniform with how all the possible values from the settings page are saved and read.
- The topic ‘Checkboxes not working for custom job fields’ is closed to new replies.