Class '\Concrete\Block\Event\Controller' not found Problem

Permalink
I am a newbie to Concrete5 and I am having an issue and I am running 5.7.5.3

Everything seemed to be working fine. I added Content Designer 4.0 to build a block for events on my event page. I added the block everything worked fine, but I had a couple of things that I wanted to do over. I created a new block (event) in Content Designer and deleted the old block folder (event_item) and finished the block. I then went to edit the page and got
Class '\Concrete\Block\Event\Controller' not found. I have since deleted the custom block and uninstalled and deleted Content Designer to see if it would fix the problem. It didn't.

I have also cleared my cache

1. How do I fix this? Any page I try to delete I am getting this error.
2. What is the proper way to delete custom blocks I don't want to use anymore?

keydin
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi keydin,

I am not aware of a Content Design 4.0 add-on for concrete5 5.7. Do you have a link for more information about it?
keydin replied on at Permalink Reply
keydin
https://github.com/jordanlev/c5_designer_content
keydin replied on at Permalink Reply
keydin
I may have given you the wrong link:https://github.com/MichaelTaylor3D/c5_designer_content...
MrKDilkington replied on at Permalink Reply
MrKDilkington
@keydin

I recommend contacting the author for more information.

In the future, I highly recommend using an add-on from the marketplace that has been PRB approved. One add-on for building blocks that I can highly recommend is Block Designer by ramonleenders. It has 30 five star reviews and outstanding customer support. While not free, the quality of the add-on, the time you will save using it, and the support available if you break something makes it a steal at $30.
https://www.concrete5.org/marketplace/addons/block-designer...
keydin replied on at Permalink Reply
keydin
I was thinking the same thing. I will get it.

In the meantime, how do I get rid of this error?
keydin replied on at Permalink Reply
keydin
Any ideas?
WebcentricLtd replied on at Permalink Reply
It sounds as though you've removed a block's files without uninstalling it first.
Do you still have the files for the block?
keydin replied on at Permalink Reply
keydin
No I don't have the files.

Are you saying that you can't delete the blocks until the add-on is uninstalled or before the content of the block is deleted?
Is there a way to fix that now that I have deleted the files?
JohntheFish replied on at Permalink Reply
JohntheFish
You always need to uninstall a block (or package or theme) before you can delete its files. Not doing so is a guaranteed way to break a site.

As you have unfortunately made that mistake, there are a some ways round it.
- hack the tables in the database (not advised unless you know what you are doing with the database because there will be several related tables to hack)
- create a minimal stub for the block's code (a set of files that provide similar code to what you had before, but not needing all the details), that provides enough for the core to uninstall the block properly

You can sometimes also recover a broken page by reverting its version in the dashboard site map to a version before you even added the block and deleting all subsequent versions. However, even though you have recovered the page, c5 will still think the faulty block is installed, so it wouldn't be a compete fix and would leave a potential trap for later.
keydin replied on at Permalink Reply
keydin
So, with Content Designer installed create a new block named "Events" with a field to create the block again. Then uninstall Content Designer and have it delete all the files?
keydin replied on at Permalink Reply
keydin
I added the new block and I get: "Error: Block Handle is already in use by another package or block type (or block files already exist in the "blocks" directory of your site)!", but if you look in application/blocks nothing is there.
keydin replied on at Permalink Reply
keydin
I tried creating another differently named block and it creates it, I cleared the cache, but I still get the original error.

The weird thing is that when I uninstall the Content Designer with it deleting all of the files . Then I delete the folder for the test block I just created it shows that block as the error. This error is coming up on every page.

"Class '\Concrete\Block\TestBlock\Controller' not found"

I would be willing to PM FTP access if someone could help me fix this.
WebcentricLtd replied on at Permalink Reply
ok - your problem is you cannot install a new block with the same name.

It is already installed - even if the files no longer exist.

You basically want to put a block in the blocks directory with the same name etc as the one you want to remove and 'trick' C5 into uninstalling it.

Does that make sense. This would be a lot easier to do if you have a local dev environment on your PC.
keydin replied on at Permalink Reply
keydin
Ok,

1. put a folder named "blocktest" in application/blocks
2. In the folder put a view.php, controller.php, and db.xml because they are required. Does there need to be any code in those files?
3. Then install the plugin?
WebcentricLtd replied on at Permalink Reply
no - you don't need to install anything else.

Your problem is the opposite - you want to uninstall something but you don't have the files for it.
WebcentricLtd replied on at Permalink Reply
I can take a look if you like (no guarantees though) and I wouldn't change anything without letting you know first.
WebcentricLtd replied on at Permalink Reply
plus - before giving me access make sure you take a backup.
keydin replied on at Permalink Reply
keydin
That didn't work either. Let me pm you the FTP credentials
keydin replied on at Permalink Reply
keydin
I just sent them to you.