We are still seeing this error happen on our staging & prod multisites and this is the corresponding fatal error 500 log entry:
2023/11/16 16:30:57 [error] 106374#106374: *19746 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Object of class Code_Snippets\Snippet could not be converted to string in /www/domain/public/wp-content/plugins/code-snippets/php/snippet-ops.php:245
Stack trace: 0 /www/domain/public/wp-content/plugins/code-snippets/php/snippet-ops.php(245): array_diff(Array, Array) 1 /www/domain/public/wp-content/plugins/code-snippets/php/snippet-ops.php(555): Code_Snippets\update_shared_network_snippets(Array) 2 /www/domain/public/wp-content/plugins/code-snippets/php/rest-api/class-snippets-rest-controller.php(270): Code_Snippets\save_snippet(Object(Code_Snippets\Snippet)) 3 /www/domain/public/wp-includes/rest-api/class-wp-rest-server.php(1193): Code_Snippets\REST_API\Snippets_REST_Controller->update_item(Object(WP_REST_Request)) 4 /www/domain/public/wp-includes/rest-api/class-wp-rest-server.php(1041): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/code-snippets/…', Array, NULL) 5 /www/domain/public/wp-inclu" while reading response header from upstream, client: 141.213.165.186, server: domain.com, request: "POST /wp-json/code-snippets/v1/snippets/1?network=true HTTP/2.0", upstream: "fastcgi://unix:/var/run/php8.1-fpm-rossweb.sock:", host: "domain.com:17905", referrer: "https://domain.com/wp-admin/network/admin.php?page=edit-snippet&id=1"
Different from ours, which fails on the database update when saving a snippet.
2023/11/15 10:39:13 [error] 106009#106009: *2244666 FastCGI sent in stderr: "PHP message: WordPress database error Unknown column 'revision' in 'field list' for query UPDATE wp_ms_snippets SET name = ...
We deleted all code snippets tables, uninstalled the plugin, and re-installed the plugin.
The individual site tables are created as expected, but the multisite table (wp_ms_snippets) is not.
It feels like the plugin install/update functions are not recognizing these sites as being multisite networks.
I’ve been having the same problem for sometime and decided to try an address it today.
I suspect they don’t want this used in a multisite environment and forgot to tell the multisite users that this would no longer be available.
Makes you just want to jump up and buy Pro with confidence right? It’s not even addressed as a multisite feature on Pro – so I suspect an oversight.
Oh, well, it used to be nice and work
-
This reply was modified 2 years, 2 months ago by
Jim Walczak.