Fist of all thank you very much for all new improvements and features - you are doing such a fantastic job! The new themer now loads all the templates everytime without the whitescreen issue, that sometimes happend before.
There is just a little new issue:
I have a simular problem with the new template previews like @sunnyTemplate previews don't show in Firefox but also in chrome (tested with the latest chrome and firefox developer browser).
Furthermore, on my side there is an empty template message on all templates (all of them are cwicly made templates with content):
@Louis, with the latest Cwicly version, this is happening for us on a site with WPML installed.
We have an almost identical site without WPML installed that seems to work fine, so that combined with the error itself will hopefully give you a starting point:
api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
GET https://xyz.com/wp-json/cwicly/v1/render?_locale=user 500
j @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
h @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
P @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
a @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
P.method.r @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
a @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
t @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
g @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
A @ api-fetch.min.js?verā¦4dabf8bf2c7adf21a:2
(anonymous) @ index.js?ver=1.2.9.9.5:171
Ur @ react-dom.min.js?ver=18.2.0:10
El @ react-dom.min.js?ver=18.2.0:10
(anonymous) @ react-dom.min.js?ver=18.2.0:10
v @ react.min.js?ver=18.2.0:10
ce @ react.min.js?ver=18.2.0:10
Just confirming this issue is still present with 1.3.0.3. We have replicated this on a second website and it may possibly be to do with using the latest WooCommerce plugin. It seemed to be fine before upgrading to this although their may be other factors involved.
I am facing the same issue for months now. I donāt have WPML plugin installed. Debug log below.
The SQL erros do not look good at all . Maybe in my case we are hitting the DB too hard.
[11-Oct-2023 08:14:46 UTC] Error: Call to a member function format() on bool
[11-Oct-2023 08:14:46 UTC] Error: Call to a member function format() on bool
[11-Oct-2023 08:14:46 UTC] Error: Call to a member function format() on bool
[11-Oct-2023 08:14:46 UTC] Error: Call to a member function format() on bool
[11-Oct-2023 08:14:46 UTC] Exception: SQLSTATE[HY000] [1226] User 'xxx' has exceeded the 'max_user_connections' resource (current value: 25)
[11-Oct-2023 08:14:46 UTC] Exception: SQLSTATE[HY000] [1226] User 'xxx' has exceeded the 'max_user_connections' resource (current value: 25)
[11-Oct-2023 08:14:46 UTC] Exception: SQLSTATE[HY000] [1226] User 'xxx' has exceeded the 'max_user_connections' resource (current value: 25)
[11-Oct-2023 08:14:46 UTC] Exception: SQLSTATE[HY000] [1226] User 'xxx' has exceeded the 'max_user_connections' resource (current value: 25)
[11-Oct-2023 08:14:47 UTC] PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, string given in /wp-includes/class-wp-query.php:2202
Stack trace:
#0 wp-includes/class-wp-query.php(2202): array_map()
#1 wp-includes/class-wp-query.php(3800): WP_Query->get_posts()
#2 wp-includes/class-wp-query.php(3932): WP_Query->query()
#3 wp-content/plugins/cwicly/core/includes/classes/class-query.php(372): WP_Query->__construct()
#4 wp-content/plugins/cwicly/core/includes/dynamic/render.php(178): Cwicly\Query::front_prep()
#5 wp-content/plugins/cwicly/core/includes/blocks/query/query.php(155): cc_render()
#6 wp-includes/class-wp-block.php(258): cc_query_render_callback()
#7 wp-includes/class-wp-block.php(244): WP_Block->render()
#8 wp-includes/class-wp-block.php(244): WP_Block->render()
#9 wp-includes/class-wp-block.php(244): WP_Block->render()
#10 /wp-includes/blocks.php(1133): WP_Block->render()
#11 /wp-content/plugins/cwicly/core/includes/api/class-themer-api.php(119): render_block()
#12 /wp-includes/rest-api/class-wp-rest-server.php(1188): Cwicly\Themer_API->theme_render()
#13 /wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request()
#14 /wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch()
#15 /wp-includes/rest-api.php(418): WP_REST_Server->serve_request()
#16 /wp-includes/class-wp-hook.php(310): rest_api_loaded()
#17 /wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#18 /wp-includes/plugin.php(565): WP_Hook->do_action()
#19 /wp-includes/class-wp.php(398): do_action_ref_array()
#20 /wp-includes/class-wp.php(779): WP->parse_request()
#21 /wp-includes/functions.php(1335): WP->main()
#22 /wp-blog-header.php(16): wp()
#23 /index.php(17): require('/...')
#24 {main}
thrown in /wp-includes/class-wp-query.php on line 2202
Suggest to have a category in Themer template page, when i creat a big site with many templates, plus the woo commerce default ones, itās hard to find them, and the preview all need download data, and itās easy to get problems. too many template on one page really need improved, i think.
maybe give a preview, no preview on template page button will also be helpful :
for me , i donot think there are too much value for the preview here.
by the way, i am not sure this is in right way or not. just a kindly hint
once you have a big site, each time regeneration whole site will take much time and use much cpu sources, after put the templates on different category , i do not know whether it is a better idea, to add one more regeneration button on difference template category page only regeneration for couple of templates will good a solution.
Shortcodes always return a string, but the āInclude Postsā filter expects an array. This causes the below exception to be thrown and prevents templates and template-parts from being rendered in the Themer.
PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, string given in /wp-includes/class-wp-query.php:2202
Stack trace:
#0 wp-includes/class-wp-query.php(2202): array_map()
#1 wp-includes/class-wp-query.php(3800): WP_Query->get_posts()
#2 wp-includes/class-wp-query.php(3932): WP_Query->query()
#3 wp-content/plugins/cwicly/core/includes/classes/class-query.php(372): WP_Query->__construct()
#4 wp-content/plugins/cwicly/core/includes/dynamic/render.php(178): Cwicly\Query::front_prep()
#5 wp-content/plugins/cwicly/core/includes/blocks/query/query.php(155): cc_render()
#6 wp-includes/class-wp-block.php(258): cc_query_render_callback()
#7 wp-includes/class-wp-block.php(244): WP_Block->render()
Please note that the exception prevents all template and template parts from rendering, even thought the exception is thrown while rendering a specific template.
After removing the shortcode dynamic argument, template and template parts are now rendered correctly in the Themer.
@msteinlein , you might want to check the logs for an exception thrown when loading the Themer. If you find one, itās a matter of narrowing down the offending block.
@Araminta , maybe we can consider not allowing shortcodes as dynamic arguments for āInclude Postsā filter?
On another note, I need to dynamically fetch the posts to be included in a query, and since using shortcodes isnāt possible as explained above, it would be great to be able to use a return Function in Query Dynamic Args.
With the Themer rework coming up, previews will not be displayed anymore (resource intensive on setups with a lot of templates/parts), as this was a common request.
thanks a lot for the quick fix. It feels like you were never away. But please donāt fall back into the old habit of fixing all bugs within a day. Itās super cool when you do that, but itās not necessary to stress yourself over such small issues. Itās perfectly fine to work with 6.5 for a few days longer and only upgrade to 6.6 in a week or two. Any serious website operator should have automatic updates turned off and check if the updates work beforehand.
Anyway, I still want to thank you for the quick fix. Everything works perfectly!