Custom taxonomy and Query editor error

Description:

Selecting custom taxonomy in the query editor doesn’t work correctly.
Made template changes are restored and a new template in format “TAXONOMY PRODUCT CAT N” is created.

Logs have this error:

[22-Feb-2023 10:55:53 UTC] PHP Notice: Undefined index: group in /home/public_html/wp-content/plugins/cwicly/core/includes/dynamic/query/args.php on line 60
[22-Feb-2023 10:55:53 UTC] PHP Notice: Undefined index: group in /home/public_html/wp-content/plugins/cwicly/core/includes/dynamic/query/args.php on line 68

  1. Open the Query Editor and select custom taxonomy. Taxonomy is created using CPT UI.

  1. Save the template.

  2. Go to Cwicly → Themer, find new “TAXONOMY PRODUCT CAT N+1” template.

  3. Modified template is restored, no changes are saved.

Taxonomy code made by CPT UI

function cptui_register_my_taxes_brand() {

/**
 * Taxonomy: Brands.
 */

$labels = [
	"name" => esc_html__( "Brands", "cwicly" ),
	"singular_name" => esc_html__( "Brand", "cwicly" ),
];


$args = [
	"label" => esc_html__( "Brands", "cwicly" ),
	"labels" => $labels,
	"public" => true,
	"publicly_queryable" => true,
	"hierarchical" => false,
	"show_ui" => true,
	"show_in_menu" => true,
	"show_in_nav_menus" => true,
	"query_var" => true,
	"rewrite" => [ 'slug' => 'brand', 'with_front' => true, ],
	"show_admin_column" => false,
	"show_in_rest" => true,
	"show_tagcloud" => true,
	"rest_base" => "brand",
	"rest_controller_class" => "WP_REST_Terms_Controller",
	"rest_namespace" => "wp/v2",
	"show_in_quick_edit" => false,
	"sort" => false,
	"show_in_graphql" => false,
];
register_taxonomy( "brand", [ "product", "brands", "optikos" ], $args );

}
add_action( ‘init’, ‘cptui_register_my_taxes_brand’ );

I have removed all custom post types and taxonomies, have disabled all the plugins (except WooCommerce and Cwicly) and I still have the same issue. When I save modifications for the “Products by Category” template first time - changes are saved. When I make modifications again and save it for the second time, then the template is reverted to the previous revision and a new “TAXONOMY PRODUCT CAT N+1” template is created.

My newrlic is full of errors pointing to URL path

/wp-json/cwicly/v1/single_make_css

Error message mysqli_real_connect(): Passing null to parameter #7 ($socket) of type ?string is deprecated.

I do not get what is going on.

Hi @Audrius,

Sorry to hear you’re experiencing trouble with this.

Unfortunately I cannot reproduce this issue on my end.

Could you possibly provide support@cwicly.com a temporary access to this installation so we may take a closer look at what’s going on?

Thank you in advance.

I have sent you a temporary link to your email.

Ok, what actually is happening.

Every second time editing “PRODUCTS BY CATEGORY” template, a new template “TAXONOMY PRODUCT CAT N” is created, and “PRODUCTS BY CATEGORY” template is restored to its initial state.

And every second time editing “PRODUCTS BY CATEGORY” template and saving it, everything works as it should be, and the template is updated. But only till the next save. Because saving again it will come back to its initial state again and a new template “TAXONOMY PRODUCT CAT N” will be created.

1 Like

Thank you for the access @Audrius!

In fact, I have been able to reproduce this issue exclusively with WooCommerce templates.

Unfortunately this is out of our hands.
I would suggest you bring this up with the WooCommerce team for them to take a look.

Moving this to general as it isn’t Cwicly related.

Do you have any temporary solution for that? Maybe somehow I can use custom templates to show categories?

Until the bug is addressed by the WooCommerce team, I would suggest to create a custom template by setting the visibility condition shown in the screenshot below.

Great, it works, thank you.

1 Like