Block with custom code preventing any edition on the site
Permalink
Hello,
I have added in an HTML block in one of my global areas and it turns out that the script in the content is causing issue on the page. It generates no error but it no longer to update any page as the top bar with is no longer visible (white) and all the areas are not accessible for edition.
I tried to go from the "Stack & Global Areas" menu as well, it worked for all blocks except the one causing the issue, the "Clear Global Area" button does nothing and the "Version History" button fails to render the history.
I am currently stuck I could not find where this is stored neither in the DB nor on the server. Any help to get rid of this broken block would be more than welcome !
Thanks
I have added in an HTML block in one of my global areas and it turns out that the script in the content is causing issue on the page. It generates no error but it no longer to update any page as the top bar with is no longer visible (white) and all the areas are not accessible for edition.
I tried to go from the "Stack & Global Areas" menu as well, it worked for all blocks except the one causing the issue, the "Clear Global Area" button does nothing and the "Version History" button fails to render the history.
I am currently stuck I could not find where this is stored neither in the DB nor on the server. Any help to get rid of this broken block would be more than welcome !
Thanks
Hello,
I tried without success with my faulty block (the workaround worked fine for the other blocks of the same type, so it was a very good suggestion, thanks!).
For my particular block, I tried also to do the same trick with the type "Content" in case I had used that type of block, same issue. Seems I have a bigger problem as I do not recall what type of block I used... Anybody knows how I could find what block is linked to "Footer Lvl2 Col5" Global Area ?
Thanks
Marie-Eve
I tried without success with my faulty block (the workaround worked fine for the other blocks of the same type, so it was a very good suggestion, thanks!).
For my particular block, I tried also to do the same trick with the type "Content" in case I had used that type of block, same issue. Seems I have a bigger problem as I do not recall what type of block I used... Anybody knows how I could find what block is linked to "Footer Lvl2 Col5" Global Area ?
Thanks
Marie-Eve
try this.
Open your file application\bootstrap\app.php and add this code to it
Then open a page which uses the global area you're trying to check. Once that's done go to the Logs page in your dashboard and you should see all handles for all blocks in that area.
Open your file application\bootstrap\app.php and add this code to it
Then open a page which uses the global area you're trying to check. Once that's done go to the Logs page in your dashboard and you should see all handles for all blocks in that area.
Hello,
i've added the code to the page as suggested, but it throws an error in the log:
Exception Occurred: .../application/bootstrap/app.php:5 Call to a member function getBlocks() on null (0)
I tried to see what was wrong but I am not familiar enough with the API to identify the problem. Any clue ?
Thanks !
i've added the code to the page as suggested, but it throws an error in the log:
Exception Occurred: .../application/bootstrap/app.php:5 Call to a member function getBlocks() on null (0)
I tried to see what was wrong but I am not familiar enough with the API to identify the problem. Any clue ?
Thanks !
Try this. replace this line
With
Where you replace xxx with the ID of a page that contains the area. For instance the homepage has an ID of 1.
$page = \Page::getCurrentPage();
With
$page = \Page::getByID(xxx);
Where you replace xxx with the ID of a page that contains the area. For instance the homepage has an ID of 1.
Hello,
No more error, but my log stays empty... But, as in the meantime I found in the database the faulty code (a missing < in a script) I no longer need to identify the faulty block.
Thank you so much for having tried to help ! It is much appreciated.
No more error, but my log stays empty... But, as in the meantime I found in the database the faulty code (a missing < in a script) I no longer need to identify the faulty block.
Thank you so much for having tried to help ! It is much appreciated.
If you are using html blocks to add snippets of script, there are better (ie much safer) ways to do it.
With an HTML block, use my Safe HTML block template
https://www.concrete5.org/marketplace/addons/safe-html...
Or use @mesuva's Script Output block https://www.concrete5.org/marketplace/addons/script-output/...
With an HTML block, use my Safe HTML block template
https://www.concrete5.org/marketplace/addons/safe-html...
Or use @mesuva's Script Output block https://www.concrete5.org/marketplace/addons/script-output/...
this easiest way would be to go to the block itself and disabled the part that outputs the code to the page so you can delete it.
Look for the file concrete\blocks\html\view.php or the same one in the updates folder if you have updated concrete5 and comment out this line:
Or even better replace it with
So you can still see it.
The delete the block from your page and save.
Don"t forget to change your block's view file back the way it's supposed to be afterward.