Closed cornelisonc closed 8 years ago
The behavior we were seeing is that the first time the following code is run, we get an input filter returned that composes input filters for each of the three fields in Ceili's comment above:
$packageProductFilter = Utility::generateInputFilter($productsModel->getPackageProductFields(), $package['package_product']);
The second time that the above code is run, we get an input filter that composes only a single input filter for the name field, but input filters for the item_code_id and item_enabled fields are not included, resulting in the unexpected behavior of the associated data being removed from the input.
The generateInputFilter() method you guys are referencing is not part of Dewdrop, but actually part of Group 10:
The only Dewdrop code referenced in that method is Db\Field::
getInputFilter(), which could certainly have a bug. That seems unlikely to me because that method is pretty straightforward but also because I can't see how a problem in Db\Field::getInputFilter() would alter the number of inputs added in that loop.
I attempted to reproduce the issue in the context of Group 10 itself with the attached page file but was not able to trigger the bug. My page just calls generateInputFilter() multiple times with the same set of fields. After each call, I output the number of fields and the number of inputs in the filter. In both cases, I get 8 for of those counts.
Could you help me get this InputFilter.php file updated so that it reproduces the issue you're seeing? What am I missing? InputFilter.txt
In this use case, it's (weirdly) returning all fields for the first time it is getting called, but every subsequent time it is only returning $this->field('name'). The other fields are getting errored out silently. It looks like someone has already encountered this issue (see commented note on price) but it was mistakenly diagnosed as an issue with the price filter rather than any addt'l fields after 'name'. Not sure if there is something special about 'name' or if it just takes whatever the first field is.