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

FieldtypePage: Selectability of unpublished pages depends on chosen input field class #2

Closed
rwetzlmayr opened this issue Sep 25, 2016 · 5 comments

Comments

@rwetzlmayr
Copy link

Steps to reproduce with a recent devns clone:

  1. Add a field of type 'Page' to a template.
  2. Configure its input field type to 'Select Multiple'
    screenshot - 11 08 2016 08_53_35
  3. Uncheck 'Allow unpublished pages?'
  4. Unpublish one of the eligible pages, e.g. 'Child page example 1' from the stock basic site profile.
  5. Create a page using this template and find that 'Child page example 1' is not an available option
    screenshot - 11 08 2016 08_38_30
  6. Configure the 'Page' field's input field to one of 'PageListSelect', 'PageListSelectMultiple', 'PageAutocomplete'.
  7. Create a page using this template and find that 'Child page example 1' is an available option
    screenshot - 11 08 2016 08_43_03
    screenshot - 11 08 2016 08_49_58

I think this confuses users as the unpublished pages, while selectable, are not persisted when 'Allow unpublished pages?' is unchecked.

(This issue is a resurface attempt for ryancramerdesign/ProcessWire#1973, as suggested in #1)

@isellsoap
Copy link
Collaborator

I tried to reproduce your issue with the latest ProcessWire version (3.0.34) from the new repository, and I had to stop at step #5, because the unpublished page appears in the page field:

bildschirmfoto 2016-09-26 um 09 05 28

Please specify your exact ProcessWire version ("recent devns clone" isn’t very specific). Can you try it also with the newest ProcessWire version and confirm my observation? If you can, please upgrade to the latest ProcessWire version. In the meantime, I will label this issue "not reproducible".

@rwetzlmayr
Copy link
Author

I can reproduce this issue's step 5 w/ PW 3.0.34 from the new repo while I cannot confirm your observation.

I believe that the code building the selector which excludes unpublished pages from the InputfieldSelectMultiple element is here.

I think that this code path is executed when the Page field is configured to not Allow unpublished pages? and has a Template of selectable page(s) set, and thus the situation in step 5 should be reproducible.

Would you mind re-checking whether your PW instance uses the Page field with these two settings in effect?

@isellsoap
Copy link
Collaborator

isellsoap commented Sep 26, 2016

Sorry, I didn’t fully comprehend the issue you were having. You are right, I can reproduce the issue.

The end result is correct (after saving the page the selected page, which shouldn’t be selectable, isn’t persisted), but I agree that from a user perspective it is a bit confusing that it is still possible to select the page in the first place.

@ryancramerdesign
Copy link
Member

This feature was added awhile back at Teppo's request (if I recall), and it's something that FieldtypePage supports, but not all page selection Inputfield types. I may be able to have the autocomplete one just omit unpublished pages for this case, but if not then certainly a strikethrough on the label (or something like that) would be worthwhile. We can't omit unpublished from the page tree just because a parent may be unpublished while the children might not be. Because support really depends on the Inputfield type (whether or 3rd party), I'll solve this issue by having it issue a save warning that unpublished pages aren't allowed to be stored in the selection. I'm also thinking in some cases we may be able to automatically append "(unpublished)" label to the selected label for additional clarity.

ryancramerdesign added a commit to processwire/processwire that referenced this issue Oct 4, 2016
… of unpublished pages in certain Page input types when unpublished pages are not allowed in the field.
@ryancramerdesign
Copy link
Member

I've pushed a fix for this issue. For PageListSelect types it provides a warning when the page is saved. For Autocomplete, I was able to have it suppress showing of unpublished pages.

foobarlab pushed a commit to foobarlab/processwire that referenced this issue Sep 15, 2017
… of unpublished pages in certain Page input types when unpublished pages are not allowed in the field.
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

3 participants