Fatal error: Class 'BlockRecord' not found in […]

Permalink
Hello folks,

I am working on a new website and I have a problem with an add-on (Sortable Fancybox Gallery). I have (over)used it on past versions (5.5 and less) without problems but a nasty bug play with my nerves with the 5.6. I have already posted a support question to jordan but I think he is a busy man then I try the community…
If I try to add a new gallery block I get the edit popup. But when I have to choose the collection I get a beautiful
Fatal error: Class 'BlockRecord' not found in /path_to_the_website/packages/sortable_fancybox_gallery/tools/get_thumbnail_items.php on line 10

If I go further despite the error and try to add the block I get an SQL error:
An unexpected error occurred. mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1),(17, , 2),(17, , 3),(17, , 4),(17, , 5)' at line 1] in EXECUTE("INSERT INTO btSortableFancyboxGalleryPositions VALUES (17, , 1),(17, , 2),(17, , 3),(17, , 4),(17, , 5)") < Back to Home


Thanks guys in advance to light my lanterns on this!
Regards,
marc

1 Attachment

marcsublet
View Replies: View Best Answer
JohntheFish replied on at Permalink Reply
JohntheFish
Why is there 'ms_gallery' as the package part of the path in the error message?
marcsublet replied on at Permalink Reply
marcsublet
Because I have duplicated the add-on and renamed it (other blocks/models names and database tables) to be sure it's a code related problem and not an installation one. But I get the same error for both.
aitalmac replied on at Permalink Reply
getting the same error after updating to 5.6

someone know how to fix this?

my fancybox is installed from concrete5, i try remove and install again but still the same problem!

Help please!
peterrr replied on at Permalink Reply
Have you tried this?

<?php
Loader::model('block_record');
?>
marcsublet replied on at Permalink Reply
marcsublet
Hi kodde,
Thank you for the idea but it doesn't work.
I have also tried to install the 5.6.0.1 with no luck.
Ale replied on at Permalink Reply
In /packages/sortable_fancybox_gallery/tools/get_thumbnail_items.php add comments as following:
//$block = new BlockRecord('btSortableFancyboxGallery');
//$block->Load("bID={$bID}"); //Loads empty object if bID=0


And add this after those lines:
$block = Block::getByID($bID);
firepixel replied on at Permalink Reply
firepixel
This class should be in /concrete/libraries/block_view.php file. I would start by checking that this file exists in your active concrete folder (in the updates folder if you updated it), and that the BlockRecord class is in there.

Or following marcsublets idea above try Loader::library('block_view') in the get_thumbnail_item.php file, although this shouldn't be necessary.
mkly replied on at Permalink Best Answer Reply
mkly
In 5.6 I believe you are going to need to add
Loader::model('block');

Maybe there is something going on with the new autoloader.
abra100pro replied on at Permalink Reply
abra100pro
Sorry, can you tell me, in what file on what line this has to be inserted?
Thanks.

I have this issue with another add-on: backgrounds extended.

Does it have to be solved in c5 itself or in each add-on affected?
pakigreenl replied on at Permalink Reply
pakigreenl
Can you please be more specific on where and how this gets added? I really need to try this now. Thanks
mkly replied on at Permalink Reply
mkly
Bug Report has been placed here

http://www.concrete5.org/index.php?cID=380195...

If you could mark this to confirmed as well, that would help. I've commited the needed change to the git repo in this commit/pull request

https://github.com/concrete5/concrete5/pull/647...
Barra replied on at Permalink Reply
I was having the same issue with 5.6 and mkly's solution works - 100%
Fantastic!
mkly replied on at Permalink Reply
mkly
Upvoting this on the bug tracker helps the core team triage bugs.

http://www.concrete5.org/index.php?cID=380195...
pakigreenl replied on at Permalink Reply
pakigreenl
IS my error(Catchable fatal error: Object of class BlockRecord could not be converted to string in /home2/messiah4/public_html/updates/concrete5.6.0.2/concrete/libraries/3rdparty/Zend/Cache/Core.php on line 361
)

related to this fix?
pakigreenl replied on at Permalink Reply
pakigreenl
can you please tell me exactly how you implemented this fix thanks
AndyJ replied on at Permalink Reply
Hi,
this answer is confused as the guthub repo has been renamed.

The solution you want is actually at:

https://github.com/concrete5/concrete5-legacy/pull/647...