Well, I did a bunch of testing. I figured out the following:
I have 12 items in my custom taxonomy. There were two that were never recorded with the tickets (always failed). The other 10 always successfully recorded. Here is the list along with the results (they’re in French):
- Administratif – SUCCESS
- Cours – Problème de comportement participant – SUCCESS
- Cours – Problème de niveau dans le cours – SUCCESS
- Cours – Problème pendant le cours – SUCCESS
- Facturation Client – SUCCESS
- Planning – NOT RECORDED, EVEN AFTER MULTIPLE TICKET SUBMISSIONS
- Procédure – SUCCESS
- RH / Paie – SUCCESS
- Comportement Salarié – NOT RECORDED, EVEN AFTER MULTIPLE TICKET SUBMISSIONS
- Salles et équipement – SUCCESS
- Support Pédagogique – SUCCESS
- Système d’information – SUCCESS
So for the two items that that were not being recorded (“Planning” and “Comportement Salarié”), I tried the following:
- Changing the slug – didn’t work, still not recorded with ticket creation
- Deleting and re-adding the item – this worked for “Planning” (Planning is now recorded with the ticket creation), but it did not work for “Comportement Salarié”
- Changing the name – this worked for “Comportement Salarié”. I deleted it and created a new taxonomy with the name “Salarié – Comportement”. Oddly, this worked. This item is now being recorded with the ticket creation.
Any ideas on why the plugin was behaving this way? Took a lot of testing and troubleshooting to finally get it working (2 hours of testing). I’d like to figure out the reason, so I can move forward with this plugin on other sites. But the bug I was experiencing is worrying.
A final note, below are two sets of code that I added to the functions.php file of my child theme. Could you confirm that it is correct?
/**** This code creates the 'Origine Options' option in the "Tickets" submenu ****/
wpas_add_custom_taxonomy( 'my_custom_origines', array( 'title' => 'My Custom Origines', 'label' => 'Origine', 'label_plural' => 'Origine Options' ) );
/**** For Awesome Support Ticket creation, make Origine category mandatory ****/
add_filter( 'wpas_get_custom_fields', 'wpas_make_product_required' );
/**
* Make the products field required
*
* @param array $custom_fields Registered custom fields
*
* @return array
*/
function wpas_make_product_required( $custom_fields ) {
if ( isset( $custom_fields['my_custom_origines'] ) ) {
$custom_fields['my_custom_origines']['args']['required'] = true;
}
return $custom_fields;
}
Thanks again.