| [13:26:40] | <edbob[m]> | fyi - i tried enabling the https://www.drupal.org/project/webhooks module and wiring it up on asset create/update. but when i edited my dog (animal asset) it threw an error: |
| [13:26:40] | <edbob[m]> | > TypeError: strpos(): Argument #1 ($haystack) must be of type string, null given in strpos() (line 101 of /opt/drupal/web/profiles/farm/modules/core/geo/src/Normalizer/ContentEntityGeometryNormalizer.php). |
| [13:26:40] | <edbob[m]> | i'm guessing this means it tries to build a field payload and just b/c an asset "can" have geometry, it assumes it "does" ..? anyway i can make an issue somewhere if you want, but i may just consider this the first of (too?) many hurdles and move on to something else for now. webhooks would be nice to have someday perhaps but it's not really vital for my use case |
| [13:28:31] | <mstenta[m]> | Actually that looks like a minor bug in farmOS... |
| [13:28:51] | <mstenta[m]> | Would be an easy pull request if you want to contibute :-) |
| [13:29:11] | <edbob[m]> | hm i assumed it was part of "core" as in drupal core.. |
| [13:29:19] | <mstenta[m]> | https://github.com/farmOS/farmOS/blob/955695115602aa7efaa25f26c69d9d20ff... |
| [13:29:24] | <mstenta[m]> | That's the line |
| [13:29:31] | <edbob[m]> | maybe i'll take a closer look then, after a break. thanks for the link! |
| [13:29:59] | <mstenta[m]> | It's checking strpos($format, 'geometry_') === 0 ... but strpos() doesn't allow NULL arguments, and $format is NULL in your case. |
| [13:30:24] | <mstenta[m]> | So that's just bad type checking in that code |
| [13:30:37] | <edbob[m]> | also i still need to get a dev setup for farmOS, i've been running w/ podman locally as well as prod. this is a good excuse to finally get over that hump i guess |
| [13:30:59] | <mstenta[m]> | Maybe should be something like: |
| [13:30:59] | <mstenta[m]> | `return $data instanceof ContentEntityInterface && !is_null($format) && strpos($format, 'geometry_') === 0;` |
| [13:31:13] | <mstenta[m]> | (checking !is_null($format) first) |
| [13:33:08] | <mstenta[m]> | (There's also a better way to check if the string starts with geometry_ too: str_starts_with($format, 'geometry_')) |
| [13:33:29] | <mstenta[m]> | (That was added in PHP 8, our code could be updated to make use of that) |
| [13:34:33] | <mstenta[m]> | Regarding "webhooks" more generally... yea! It feels like that would be a nice core feature of farmOS! |
| [13:35:04] | <mstenta[m]> | Whether we use https://www.drupal.org/project/webhooks or roll our own is the question... so testing that module out is a good first step :-) |
| [14:56:10] | <mstenta[m]> | Someone make this test failure make sense to me... 😆 https://git.drupalcode.org/project/log/-/jobs/8852217 |
| [14:56:41] | <mstenta[m]> | ACTION sent a code block: https://matrix.org/oftc/media/v1/media/download/AdkS5unW6f-wlTkXcJvSKU-4... |
| [15:33:55] | <edbob[m]> | yikes good luck with that |
| [15:49:32] | <edbob[m]> | PR submitted - that did fix the error, so will continue on this path further :) thanks again for the info |
| [15:49:50] | <edbob[m]> | i did not attempt to write any tests..not sure how strict you are on that |
| [15:55:33] | <mstenta[m]> | awesome thanks edbob! |
| [15:56:00] | <mstenta[m]> | no worries - tests are always good, but this is a pretty minor one... you're the first to run into it in all the years it's been there! :-) |
| [15:56:11] | <mstenta[m]> | thanks for the PR! |
| [17:00:32] | <symbioquine[m]> | <edbob[m]> "PR submitted - that did fix..." <- IMHO, PR (and commit message) could use some of the context that's in the chat here... Stack trace, link to webhooks module, that the actual fix is the null check, etc |
| [17:13:58] | <edbob[m]> | no prob / good point - updated |