-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Call to undefined method stdClass::unsetRelation() #2671
Comments
$item is assumed to be a Model because it is coming from a relationship/query, which should absolutely have this method, why are you getting a stdClass instead of a model? Did you somewhere maybe force the relation |
Hard to tell, can't dive deep down this now. But it's a block editor with many repeaters and related browsers to multiple modules: Browser::make()
->name($browserName ?? 'linked_item')
->label('Internal page')
->modules(Constants::BROWSER_ALL_ENDPOINTS)
->connectedTo($prefix . 'type', 'internal', ['keepAlive' => true]), |
This might be coming from this line which is doing something it shouldn't twill/src/Repositories/BlockRepository.php Lines 46 to 59 in 3297066
|
Yes, I just saw that |
@antonioribeiro by "when rendering blocks", do you mean inside Twill's editor, or your frontend controllers? |
For some reason we only have this on preview, @ifox, I forgot to add to the ticket |
This other PR might be related: #2535 |
I was looking at it but it's not this, it's the code I pointed to that stores objects into the relatedItem relation, sending a PR in 3 minutes |
Btw @ifox I see a lot of Is there any actual case where this table would not exist? Isn't related a non disableable feature? |
This was for backwards compatibility when the migrations were not all loaded automatically like they are now. This can be safely removed. |
@antonioribeiro Any chance you could give a try to the PR? Adding to your composer.json "repositories": [
{
"type": "vcs",
"url": "https://github.com/tofandel/twill"
}
],
"require": {
"area17/twill": "dev-patch-18 as 3.4.1"
} And then |
Sorry, I was already out of the office, I will try to look at this later,
as I also don’t have my local environment with me 😁
|
Description
We re getting this error when rendering blocks on preview. This is the line that might have introduced the bug.
Steps to reproduce
It's being generated by having browsers to related items in the block editor.
Versions
Twill version: 3.4
Laravel version: 11
PHP version: 8.3
/cc @Tofandel
The text was updated successfully, but these errors were encountered: