Open BobRay opened 13 years ago
splittingred submitted:
The logic is there mainly to help deal with checkboxes, which don't submit their value if unchecked. This would require a large rewrite of how TV checkboxes are handled; postponing until 2.2.1 or so.
bobray submitted:
NewsPublisher now has a workaround for this, but it may affect other add-on components.
dinocorn submitted:
Bob, any pointers on the work around for NewsPublisher? I think I've ran into something similar with ImportX: https://github.com/Mark-H/importX/issues/48
dinocorn submitted:
I think I squashed the ImportX bug https://github.com/Mark-H/importX/pull/50
bobray created Redmine issue ID 5965
I believe this code in the resource update processor will remove the values of existing TVs that are not sent in $scriptProperties['tvs']:
foreach ($tvs as $tv) { /* set value of TV */ if ($tv->get('type') != 'checkbox') { $value = isset($scriptProperties['tv'.$tv->get('id')]) ? $scriptProperties['tv'.$tv->get('id')] : $tv->get('default_text'); } else { $value = isset($scriptProperties['tv'.$tv->get('id')]) ? $scriptProperties['tv'.$tv->get('id')] : ''; }
If the user sends only TVs 1 and 3, TV2 will have its value changed to ''. We could require that all TVs be sent in the argument, but it seems inefficient to make up an array containing all TVs and then process them all when a user only wants to change one or two on a page with many TVs.