XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
77 stars 134 forks source link

Custom instance attribute not applied to repeat template #686

Open lindsay-stevens opened 5 months ago

lindsay-stevens commented 5 months ago

Software and hardware versions

pyxform v2.0.0 Python v3.8

Problem description

Custom instance attribute not applied to repeat template.

Steps to reproduce the problem

If a user adds a survey column like instance::testAttribute, the attribute value specified in the begin repeat row will be copied into the first repeat instance, but not the repeat template. So presumably, any subsequent repeat copies will not have the attribute.

Expected behavior

Both the first repeat and the repeat template should have the custom attribute. Multiple instance attributes should work too, e.g. instance::testAttribute, instance::testAttribute2, etc. The repeat template should continue to have the jr:template="" marker attribute.

Other information

As mentioned in #685 there was a test called AttributeColumnsTest which had not been run by default for a while. So this is not a new regression. It seems to have been introduced in #380 (2019), which changed repeat behaviour from only inserting the repeat template in the instance, to additionally inserting the first repeat. From reviewing #380 and the related issue ticket, this attribute behaviour change does not seem to have been intentional.