replace diffAssoc with diff so the method is removed when there are parameters in front of it#2299
replace diffAssoc with diff so the method is removed when there are parameters in front of it#2299TomNealBorneman wants to merge 1 commit intoorchidsoftware:masterfrom
Conversation
…are parameters in front of it
|
Hi @TomNealBorneman, could you add some tests to test this case? |
|
When using Model bindings in your screen method (say the save function for example) you get a 404 when trying to save a new instance of a child relation: This happens because it tries to use the method as a key for finding the model. And a model with the key 'save' does not exist. Changing the diffAssoc to diff makes it so the method is removed from the parameters regardless of its position within the collection. The following dumps (made after src\Screen\Screen.php:220) show the different results. This still does not work when you use extra url parts like This fix could cause issues if you have models with string keys that could overlap with methods, say if you have a model with the key This has no effect on saving existing models like so: edit: add clarification of parameters dumped in screenshots. |
Used the workaround proposed in this [PR](orchidsoftware/platform#2299)
* Install prometheus exporter * Add prometheus service provider * Add census metrics * Add setup agent script * Ignore agent * Add production dockerfile * Add agent config * Add install agent composer task * Add agent worker * Move setup agent to post install * Add prometheus service to compose * Run linter * Implement collectors * Fix prometheus network * Add agent doc * Add laravel scrape config * Run lint fix * Add gauge helpers * Convert site insights to gauge * Override screen handle to fix save method params Used the workaround proposed in this [PR](orchidsoftware/platform#2299) * Add seed allocation gauge * Add model typehint * Convert batch insights to gauge * Remove redundant crop metric * Convert crop insights to gauge * Add Grafana dashboard export jsons * Change values to float * Remove unnecessary cast * Add crop profit dashboard * Convert farmland insights to gauge * Run lint fix * Add farmland dashboard * Add estimated yield amount metric * Convert farmer report insights to gauge * Add farmer report dashboard * Add site dashboard
|
Changing to diff fixes the issue for me :). If this isn't going to get merged, then please provide anther solution. |





Fixes #2216