Closed rafaponieman closed 6 years ago
I partially fixed wagtail-geo-widget compatibility with b8e3cdd2a1310ec83b843c8c46cc040dc5a7d73d.
Now, going to a page with a GeoBlock
works. However, a 'NoneType' object is not subscriptable
is yield when saving two times a GeoBlock
.
It has to do with the clean
method that’s being called when it shouldn’t, but I didn’t figure out yet what was wrong with my code, especially since every other block type now works.
I should be able to fix it, but maybe the cleanest solution in the end will be a change to wagtail-geo-widget to add the value_from_datadict
method and folks.
Partial fix released in 0.8.3.
After some digging, I have to set this as a “won’t fix”.
Now that the Python part is correctly handled, there are still some value loading issues, because the library didn’t correctly implement the required internal API methods value_for_form
and value_from_form
.
The new StreamField renders widget templates only once per block type, thus decreasing dramatically the server response time. So we rely on value_for_form
to set widget value after cloning the empty widget template, while the current StreamField relies mostly on render_form
that itself relies on value_for_form
.
Apart from value_for_form
, that module contains some hacks to link an external address block with the coordinates block. These hacks will either have to be updated, or replaced with a cleaner solution.
I’m not happy with that conclusion, but it’s not possible to support all hacks of undocumented behaviours.
This may be a problem in wagtail-geo-widget and not in wagtail-react-streamfield, however I'm reporting it in case it is the latter.
When using a GeoBlock, I'm getting an error on page load:
Versions: Latest wagtail-react-streamfield (79606df), Wagtail 2.2.1, Python 3.6.5.
Thank you!!