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

OptionsetField_holder.ss is not conform with template changes introduced in 3.2 #5319

Closed
anselmdk opened this issue Apr 14, 2016 · 8 comments

Comments

@anselmdk
Copy link
Contributor

anselmdk commented Apr 14, 2016

OptionsetField_holder.ss is still using id="$Name" whereas FormField_holder.ss is using id="$HolderID" as was introduced in 3.2 I believe.
This causes non-consistent holder naming (see image) and thus breaks modules such as display logic (cc @unclecheese).
I'm not sure if this is by design (as it might have other implications?) or an oversight.

screenshot 2016-04-14 19 57 04

@anselmdk
Copy link
Contributor Author

@unclecheese just a note that I went away from using the checkboxsetfield for display logic, as it just felt too buggy. I'm instead using individual checkboxes now, which works just fine.

Above still feels a little inconsistent however.

@tractorcow
Copy link
Contributor

Yes I think it needs to be fixed; I'm not happy to leave it as id="$Name" but it would be hard to change it without breaking existing 3.x.

Can we fix this in 4.x?

@tractorcow tractorcow added this to the 4.0.0-alpha2 milestone Apr 20, 2016
@dhensby
Copy link
Contributor

dhensby commented May 21, 2016

This is a bug, surely. Not a feature... I'd fix in 3.2

@tractorcow
Copy link
Contributor

It can't be fixed in 3.2 without change in behaviour. Yes it's a bugfix, but semver requires it to be fixed without regressions. We've already broken a lot of templates in the new form IDs, which we promised we wouldn't under semver.

@dhensby
Copy link
Contributor

dhensby commented Jul 14, 2016

I thought we had an "old form markup" config fallback?

@tractorcow
Copy link
Contributor

Not that I recall!

@tractorcow
Copy link
Contributor

A whole bunch of changes have been merged with #5826.

I've applied this fix to both templates (one for default and cms-forms theme):

New cms-forms theme version: https://github.com/open-sausages/silverstripe-framework/blob/bdb8e4016a82129de791fead4e5daccd3079111a/admin/themes/cms-forms/templates/forms/OptionsetField_holder.ss

Legacy (front-end theme) version: https://github.com/open-sausages/silverstripe-framework/blob/bdb8e4016a82129de791fead4e5daccd3079111a/templates/forms/OptionsetField_holder.ss

@dhensby
Copy link
Contributor

dhensby commented Jul 25, 2016

Not that I recall!

yep: FormTemplateHelper_Pre32 is what you need for this old (broken) behaviour. so users should be using that if they want the broken markup and using the default otherwise

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

No branches or pull requests

4 participants