-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel 9.36.3: Illegal offset type in isset or empty #58
Comments
If you send a PR I'd be happy to merge :) |
Hi, unfortunately I only found the source of the problem but I do not know how to solve it in a correct way so it still / again works. |
Hi, Please, can you give us a solution to this? Thanks in advance. Richard |
Just for your information: I temporarily "solved" this by fixing my Laravel Framework to the latest 9.35 version "laravel/framework": "9.35.1", The critical commit was added in the first 9.36 release. Unfortunately I also have not really found a solution, so I hope for @Flynsarmy to better understand how it should be right. |
I will try this in a couple of days... I hope it will be fixed soon. Thanks! Richard |
Is this issue solved ? i found this also on this 9.40.1 version. @Flynsarmy @hoekie |
i can propose a quickfix for someone to include in this package: in Flynsarmy/DbBladeCompiler/DbBladeCompilerEngine.php add
and update \Flynsarmy\DbBladeCompiler\DbView::getContents to
maybe this could be improved but it works for now |
Cool! Thanks @Marcel-Sass I will try this in the next few days! |
Is anyone fixing this, otherwise we have no option we need to remove the dependency? Because we need to update the dependencies for our users. |
No Solution Until Now ?? |
I'm fixing it with change laravel version to "laravel/framework": "9.35.1" in your_app_name/composer.json and changing APP_URL in .env from APP_URL=http://localhost:8000 to APP_URL=http://127.0.0.1:8000. Might this help you all |
The problem is with the path src/Illuminate/View/Engines/CompilerEngine.php in the function get() line 61 inside As solved is if(!isset($path)) |
Hey for everyone trying to render blade, you could use: https://laravel.com/docs/9.x/blade#rendering-inline-blade-templates |
Thank you for sharing. It solved the issue. |
It looks like you closed the PR. Was there a problem with it? |
If someone could test and confirm the issue is now fixed I'll close this issue. |
I'm getting an error on Laravel 10 (using @section) |
The only quick solution for this specific issue on Laravel 10, is adding the View Factory class to the data variable on vendor/flynsarmy/db-blade-compiler/src/Flynsarmy/DbBladeCompiler/DbBladeCompilerEngine.php public function getContent(string $compiled_path, array $data) And updating function getContents() on the the file (@Marcel-Sass suggestion): vendor/flynsarmy/db-blade-compiler/src/Flynsarmy/DbBladeCompiler/DbView.php protected function getContents()
} |
Could you please publish a new release with the fix merged in |
It sounds like there's an issue on Laravel 10 (latest version). That'll need to get fixed before I'll make a new release. If someone wants to send a PR I'll merge. |
The package does not work with Laravel 9 & Laravel 10 for now |
Done |
Hi,
with an update from Laravel 9.34.0 to 9.36.3 I get this error when creating a view from database: Illegal offset type in isset or empty
I compared the files before and after the update and this is the commit that breaks this project:
laravel/framework@331bf9c
In DbView (https://github.com/Flynsarmy/laravel-db-blade-compiler/blob/master/src/Flynsarmy/DbBladeCompiler/DbView.php) the path is set to be the model: $this->path = $model;
Later the content is set to $this->path->__db_blade_compiler_content_field which is then passed over getContents() to the engine:
$this->engine->get($this->path, $this->gatherData())
Laravels compiler engine expects a string in "public function get($path, array $data = [])" and since that commit they even use that path an array key, which fails in the end, was currently a model is used.
I am not so deep into all the internal template handling, so I hope my findings can at least help you to fix this.
Marcus
The text was updated successfully, but these errors were encountered: