I don't know if this was intentional or not, but the access logic ("All conditions must pass" / "One condition must pass") was removed in 77871ad1 (search "access_logic"). In 8.x-1.x-dev, Selection criteria are now evaluated with only AND.

Comments

steveoliver created an issue. See original summary.

steveoliver’s picture

lahode’s picture

Hi any evolution on this issue?

The last comment on #2561341: Formal UX rethinking of the Page Manager UI has been posted almost a YEAR ago...

tim.plunkett’s picture

Priority: Normal » Major

It was (wrongly) removed in #2550879: Use CTools Wizard API to add/edit Pages (and move plugin UI using PluginWizardInterface), which I tried to block multiple times.

arosboro’s picture

Status: Active » Needs work
StatusFileSize
new3.86 KB

This feature is invaluable for my usage of page_manager so I cooked up a patch.

There needs to be some work done related to caching but I noticed this morning that it started to work, so I'm sharing here.

andypost’s picture

It's very useful! Good start

+++ b/page_manager_ui/src/Form/PageAccessForm.php
@@ -67,11 +67,62 @@ class PageAccessForm extends ManageConditions {
+      '#type' => 'markup',
+      '#prefix' => '<div id="configured-conditions">',
+      '#suffix' => '</div>',
+      '#theme' => 'table',

use `theme_wrapper` here

arosboro’s picture

@andypost, actually that's a copy paste job from parent::buildForm(). I was thinking rather than repeating code it would be more useful to add what we need and just call the parent to handle the rest:

<?php
  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $cached_values = $form_state->getTemporaryValue('wizard');
    $page = $cached_values['page'];
    $form['items'] = [];
    $form['access_logic'] = [
      '#type' => 'radios',
      '#options' => [
        'and' => $this->t('All conditions must pass'),
        'or' => $this->t('Only one condition must pass'),
      ],
      '#default_value' => $page->getAccessLogic(),
    ];
    $form['conditions'] = [];
    $form['add'] = [];
    return parent::buildForm($form, $form_state);
  }
?>

Also, do you have any thoughts as to why the page status is 200 but still displaying "You are not authorized to access this page." message from from the 403 handler?

arosboro’s picture

I found the issue with 403 errors was related to the overridden callback's dynamic route handler setting an invalid regex for the _permission key in Route::setRequirement().

I did notice it is possible to set $this->access_logic using $page->set('access_logic', $form_state->getValue('access_logic'));
instead of adding setAccessLogic() explicitly. If feedback warrants, I can revert to this method.

Here is an updated patch with changes to buildForm().

arosboro’s picture

Status: Needs work » Needs review

The last submitted patch, 5: page_manager-restore_access_logic_options-2785251-5.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 8: page_manager-restore_access_logic_options-2785251-8.patch, failed testing.

leopinzon’s picture

Please don't let this correction die!!!! pleaseee

chertzog’s picture

Status: Needs work » Needs review
StatusFileSize
new2.77 KB

Reroll against dev.

japerry’s picture

Status: Needs review » Closed (outdated)

Page Manager 8.x-1.x is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.