Open pbauer opened 4 years ago
Copy them into the add-on?
Copy what into the addon? The bundle, the pattern or only the registration?
May we should peel out the pickadate pattern from plone-editor-tools and make it available as a seperate bundle? That's to be done in plone.staticresources. Then collective.easyform could just enable that bundle via the registry. /cc @agitator
I'm open for further splitting of bundles @pbauer remind me at the sprint ;-) But please no generic auto-enable from easyform ...
Copy what into the addon? The bundle, the pattern or only the registration?
I meant the pattern, but @thet ‘s idea is much better
Actually, if the pattern isn’t heavy, why not move it into the non logged in bundle?
one can always extend the condition for the bundle to something like python: member is not None or context.portal_type in ('EasyForm')
Depending on the usecase putting "everything" into a bundle doesn't make sense because it adds unnecessary load and therefore slows down the experience. We did that wrong with Plone for too long!
Is it ok to mention a non core content type? That dredges up the question: why not include EasyForm in Plone buildout.cfg but commented out, as used to be the case with PloneFormGen (maybe in the unified installer)
Maybe I misunderstood the issue (is it a datepicker problem?) but I just tried on a clean Plone 5.2 buildout with Python 3.7.3: Date and Datetime fields work as expected.
@davide-targa probably only if you're logged-in, as the pickadate pattern is part of the plone-editor-tools bundle, which itself is only available to logged in users?
@thet I was not logged-in.
Check out this public test form for exmple: https://bit.ly/2vOBRGb I have no issue filling the Date and DateTime fields.
Plone 5.2.0 (5207)
CMF 2.4.0
Zope 4.1.1
Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.3.0]
PIL 6.1.0 (Pillow)
WSGI: On
Server: waitress 1.3.0
@davide-targa That's weird. Can you try to do the same for 5.2.1? Maybe it it still worked in 5.2.0.
@pbauer @davide-targa yes, 5.2.0 is probably the reason why it's working for you. We did the bundle-splitting @ ploneconf in Ferrara, where 5.2.0 was out since some months: https://github.com/plone/plone.staticresources/pull/46
... not the best semantic versioning scheme for cmfplone here ;)
I just confirmed this. In Plone 5.2 the date and datetime fields still work for anonymous users. After upgrading to 5.2.1 they stop working.
I can also confirm that you can work around that by changing the condition of the bundle plone-logged-in
in /@@resourceregistry-controlpanel
to python: member is not None or context.portal_type in ('EasyForm')
@thet @pbauer I confirm that in Plone 5.2.1 Date and DateTime fields don't work for anonymous users. Sorry for the noise.
+1 same issue
We had this issue and solved it extending (in our own product ATM) the existing easyform bundle as follows:
If this other solution can work for collective.easyform too we would be happy to create a pull request.
@parruc have you tried changing the condition for the bundle to check on EasyForm as well?
If you want to help other users, you could create a separate bundle for the datepicker in staticresources and extend it's condition in the profile.xml of the EasyForm. So no need to include the datepicker bundle in Easyform as well.
We did not need to change the condition because we included the mockup-patterns-pickadate needed by EasyForm into the easyform bundle along with other js and css we needed.
If the idea here is to move datepicker to its own bundle inside staticresources it makes absolutly sense and I will gladly share the minimal code to do it as soon as possible.
At least it would allow the datepicker to be enabled through the resource registry without loading the whole logged-in-bundle. As we did that for datatables https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/static/plone-datatables.js
@thet what do you think?
In the meantime I opened a ticket in plone.staticresources: https://github.com/plone/plone.staticresources/issues/96 given that the needed changes are to be done there, ok?
It's not only date/time fields/pickers that are not working. All other JS that validates fields on blur is also missing.
For instance logged in users see a "Required input is missing." (when blurring a mandatory field, leaving it empty) while logged out users see nothing.
Just test clean install Plone 5.2.3 the date/time fields/pickers that are not working.
Also test clean install Plone 5.2.4rc the date/time fields/pickers that are not working.
5.2.4 by changing the condition of the bundle plone-logged-in in /@@resourceregistry-controlpanel to python: member is not None still not working any idea?
I have created an add'on that should include the date picker pattern and also inline validation to public views.
https://github.com/collective/collective.anonymouseditpatterns
It is a first attempt that seems to work for me locally in a plain Plone 5.2.4 coredev plone site. I first tried to get the add'on working in a customer project, but I ran into strange issues of missing resources in the compiling bundle stage.
The anonymouseditpatterns imports the pickadate patterns' less code, but in the mockup pattern these imports failed until I changed bootstrap to bootstrap3:
when I added the add'on to a 5.2 coredev checkout, the paths worked again for /bootstrap/ :-S
I've tried to reduce the bundle size by adding js stubs, but the pickadate pattern pulls in select2. Maybe it doesn't add more js if I also add pat-select2 to collective.anonymouseditpatterns.
how about adding a profile to change the condition for that bundle to python: member is not None or context.portal_type in ('EasyForm')
within easyform?
And what happens to the condition for that bundle when it is merged into the meta-bundle?
imho it's will be merged...
@thet ping?
we're sprinting tomorrow, as every Wednesday, join us if you need some pointers
What's the status on this issue?
What's the status on this issue?
@oxygenius I think the status is what you see here on github. Do you have the same problem? Which Plone versions. Did you try collective.anonymouseditpatterns?
Okay. So the workaround with the anonymouseditpatterns is still the way to go. I'll try collective.anonymouseditpatterns.
Hi @fredvd, works like a charm!
In Plone 6 there is still no datepicker for anonymous users. You have to enter the date manually.
Hi @fredvd, works like a charm!
Same here (on 5.2.13). Thank you! 🙌
The pickadate-pattern is only part of the of the bundles
plone-editor-tools
andplone-tinymce
which are only available for logged-in users. Is there a way to work around this?