Skip to content
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

Open
BobRay opened this issue Oct 26, 2011 · 3 comments
Open

Resource Update processor wipes missing TVs #5965

BobRay opened this issue Oct 26, 2011 · 3 comments

Comments

@BobRay
Copy link

BobRay commented Oct 26, 2011

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.

@splittingred
Copy link

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
Copy link
Author

BobRay commented Nov 11, 2011

bobray submitted:

NewsPublisher now has a workaround for this, but it may affect other add-on components.

@modxbot
Copy link
Owner

modxbot commented May 10, 2013

dinocorn submitted:

Bob, any pointers on the work around for NewsPublisher? I think I've ran into something similar with ImportX:
modmore/importX#48

@modxbot
Copy link
Owner

modxbot commented May 10, 2013

dinocorn submitted:

I think I squashed the ImportX bug modmore/importX#50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants