I have been trying to deploy a form I have been using since 2022, but since last week it has been returning an error Server 500 Error, checking on online ODK the error "Error: ‘str’ object has no attribute ‘items’ " , has something changed?
I’ve been digging into this today, and it appears you may have hit a regression in the new pyxform version. We just updated this in the last release, which is why you probably didnt hit it till now.
As best I can tell, the problem lies in the unfortunate circumstance that you happen to have a column called ‘media’ in your choice list (!). If you change this to, say ‘mediaXYZ’ everything is fine (of course, you then also have to change your choice_filters to match).
I also note that your initial note question (presumably to display your logo) doesn’t have any text; this will also now cause a pyxform error. So I’ve put in a stub label to make it happy. And finally, I’ve edited your label language settings slightly, otherwise you’ll get a warning about missing languages… After all this, your form deploys nicely:
As I said, I believe you’ve hit a regression in pyxform such that it now misbehaves if you inadvertently happen to have a choices column called ‘media’. It probably just so happens to use this for some internal purposes, but AFAIK its not explicitly documented as a reserved word anywhere… I’m investigating further and will open a pyxform defect as appropriate - thanks for bringing it to our attention! In the mean time, hopefully just renaming your column to something else, as I have done, will get you going again.
I’ve tried but I havent been able to reproduce this with ‘model’ as a column title in the choices sheet, either on Kobo Global or XLSForm Online using this form:
But I wholly agree: any pyxform ‘reserved words’ need to be explicitly documented, with non-obscure error messages if you happen to inadvertently use them.
Thanks for the reference @wroos . This appears to be a somewhat unrelated issue - at least to the above - where using ‘model’ for a field/question name causes issues for Enketo [and I’ve confirmed still does].
But you are correct, using ‘model’ is also something of a no-no in certain form contexts. It seems to be fine for choices columns but not for field names, at least at present. We are investigating the latter.