-
-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource Update processor wipes missing TVs #5965
Comments
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: |
dinocorn submitted: I think I squashed the ImportX bug modmore/importX#50 |
As I read the history here, both NewsPublisher and ImportX have workarounds for this, but the bug still exists. |
Excuse me, If this bug is still exist why it was closed? |
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.
The text was updated successfully, but these errors were encountered: