{"id":16171899,"date":"2022-11-07T08:51:24","date_gmt":"2022-11-07T08:51:24","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/broken-block\/"},"modified":"2022-11-07T08:51:24","modified_gmt":"2022-11-07T08:51:24","slug":"broken-block","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/broken-block\/","title":{"rendered":"Broken block"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I&#8217;m currently testing the plugin and I&#8217;m having an issue where the phraseanet block isn&#8217;t working properly.<\/p>\n<p>I use the free version of the plugin, with wordpress 6.1 and php 8.1, and firefox as a browser. I&#8217;m testing the plugin locally on my laptop, so unfortunately I can&#8217;t link to the page.<\/p>\n<p>Steps to reproduce :<\/p>\n<p>&#8211; create a new post<br \/>\n&#8211; insert a &#8220;phraseanet client block&#8221;<br \/>\n&#8211; edit the block settings in the side bar, for exemple add a block title<br \/>\n&#8211; publish the post<br \/>\n&#8211; view the page<\/p>\n<p>Initially everything is displayed correctly, with a mosaic of thumbnails. However, if I click any of the thumbnails, instead of the image popping up, the whole phraseanet block disappear, with the following error in the browser console :<\/p>\n<p>TypeError: d[0].color_palette is undefined<\/p>\n<p>The issue seems to come from the post meta : if I delete  _phraseanet_client_post_asset_details_color_palette from the postmeta table in the database, then the phraseanet block works correctly again.<\/p>\n<p>And if I skip the step &#8220;edit the block settings in the side bar&#8221;, then the meta isn&#8217;t defined in the database in the first place, and the block works correctly.<\/p>\n<p>Another hack that fixes the issue is to edit public\/class-phraseanet-public.php, and delete the line 320 :<\/p>\n<p>$assetDetailsColorPalette = get_post_meta($page_id, &#8216;__phraseanet_client_post_asset_details_color_palette&#8217;);<\/p>\n<p>All this seems to point to a meta that doesn&#8217;t get initialized correctly. Hopefully you can reproduce the bug and fix this upstream with something better than my hack.<\/p>\n<p>(By the way, in gutenberg I don&#8217;t see the control corresponding to this color_palette meta, is it a premium feature ?)<\/p>\n","protected":false},"template":"","class_list":["post-16171899","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16171899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16171899\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16171899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}