fix(core): [FIX] share addDataToView data with Blade views#2322
fix(core): [FIX] share addDataToView data with Blade views#2322middleDuckAi wants to merge 1 commit intoevolution-cms:3.5.xfrom
Conversation
|
I tried your changes locally, it's works great. Thank you ! |
|
Always happy to help, and thank you for testing it locally! If you run into any other bugs, missing pieces, or ideas for things you would like to see improved in Evolution CMS, feel free to open an issue or mention me there. I will be glad to look into it and help get it done. |
|
I also found a bug with DocLister with php, can you tell me who is in charge ? I saw in evo extra that the code hasn't changed since 2020 ... when I disconnect from the manager, I don't get the error and the website is loading correctly. |
Summary
Fixes #2321.
evo()->addDataToView()already stored the payload in the internal view-data buffer, but that data was only passed directly to the top-level Blade template render. The data was not also shared through the Laravel view factory, so nested or separately rendered Blade views could miss the values and debugging showed the privatedataForViewbuffer instead of a public access path.This keeps
dataForViewencapsulated and exposes the data through the view layer instead of making the property public.What changed
Core::addDataToView()now validates array input, keeps returning the Core instance for chaining, stores the data, and shares it with the bound view factory.getDataForView()and shares the merged core document data plus added view data with both the main view factory and DLTemplate blade bridge.Verification
php -l core/src/Core.phpphp -l core/tests/Unit/CoreAddDataToViewTest.php./vendor/bin/pest tests/Unit/CoreAddDataToViewTest.phppassed locally after installing dev dependencies for the test run.Database matrix
Not applicable. This change does not touch schema, migrations, seed data, or update-time database repair.