WI, USA
Account created on 12 December 2012, about 12 years ago
#

Merge Requests

More

Recent comments

🇺🇸United States mglaman WI, USA

Looks like the same ask in Changes to session breaks access to masquerading user. Needs review but titled better

🇺🇸United States mglaman WI, USA

MR up but test needs to be finished

🇺🇸United States mglaman WI, USA

Thanks, everyone.

🇺🇸United States mglaman WI, USA

Approved by all codeowners

🇺🇸United States mglaman WI, USA

I read this and was confused, thinking it was the Page entity title, adding block to issue title

🇺🇸United States mglaman WI, USA

Needs tests, but we have a basic code change that could use review and feedback

🇺🇸United States mglaman WI, USA

Pushed https://git.drupalcode.org/project/experience_builder/-/merge_requests/6..., I can update the @todo when it is added. This feels like a perfect case for content moderation and a specific workflow. If the state is archived, we will not make published. Or if we do not want content moderation, it's another use for a trinary state field: 0=TO_BE_PUBLISHED, 1=PUBLISHED, 2=ARCHIVE. On "Publish all changes" all items in 0=TO_BE_PUBLISHED are published.

🇺🇸United States mglaman WI, USA

Approved by @wim leers

🇺🇸United States mglaman WI, USA

There are some big assumptions here. That ApiPublishAllController should take all entities which are \Drupal\Core\Entity\EntityPublishedInterface and call \Drupal\Core\Entity\EntityPublishedInterface::setPublished.

How can something remain "Archived" then? Since new entities cannot be staged, we are creating them as unpublished to start.

🇺🇸United States mglaman WI, USA

Thanks @wim leers – enforced on config makes more sense. I'll update the test

🇺🇸United States mglaman WI, USA

Makes sense to me. Approved.

🇺🇸United States mglaman WI, USA

Tossed up quick, need to manually test

🇺🇸United States mglaman WI, USA

Whoops didn't realize I closed this with a pending question 😅

🇺🇸United States mglaman WI, USA

That makes sense, and it is being done there. Should we keep this open to have createContent invalidate the "Content" tag work being done over there?

🇺🇸United States mglaman WI, USA

So maybe it is accidentally being published by that other bug? Probably fix that first then double check here

🇺🇸United States mglaman WI, USA

You're experiencing this bug https://www.drupal.org/project/experience_builder/issues/3503199 🐛 "Published" checkbox is always checked even if the entity is not Active

It's not actually published.

🇺🇸United States mglaman WI, USA

I pushed to the MR with changes to use AutoSaveManager for handling simple config changes. It's not 100% done but enough to review and validate as an approach.

🇺🇸United States mglaman WI, USA

I need to update the issue summary with changes on the approach from the MR

🇺🇸United States mglaman WI, USA

CI is failing, but I'd rather get reviews on the approach before fixing.

🇺🇸United States mglaman WI, USA

Why not just let the last save win?

Perfectly acceptable to me!

🇺🇸United States mglaman WI, USA

Drupal Core added the cookie_samesite to session.storage.options service parameter. This should be used over an override by autologout. Same with the cookie_lifetime value.

🇺🇸United States mglaman WI, USA

That's one reason we have this in the PageTrait for tests: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/path/...

  protected static function assertSaveWithoutViolations(Page $page): void {
    // Path field is always invalid for new entities.
    // @see \Drupal\path\Plugin\Field\FieldWidget\PathWidget::validateFormElement().

From Core:

    $element += [
      '#element_validate' => [[static::class, 'validateFormElement']],
    ];

and in validateFormElement


      foreach ($violations as $violation) {
        // Newly created entities do not have a system path yet, so we need to
        // disregard some violations.
        if (!$path_alias->getPath() && $violation->getPropertyPath() === 'path') {
          continue;
        }
        $form_state->setError($element['alias'], $violation->getMessage());
      }
    }

🇺🇸United States mglaman WI, USA

Okay, I think this jumps the shark a bit as we have no way to stage configuration changes.

Approach 1: base field on xb_page

- There is a new "hidden"/internal boolean flag on pages called homepage
- Mark as homepage actually toggles a base field, which goes to auto save
- On preSave we see if homepage === TRUE, change system.site and remove the value of homepage

problem: how to prevent marking multiple as homepage in autosave data?

Approach 2: make ApiPublishAllController aware of frontpage concept

- the concept of what would be the new homepage cannot live in the entity data
- needs to be part of staged config changes

create a one-off snowflake concept in AutoSaveManager to track changes for the homepage (system.site.path.front) only

🇺🇸United States mglaman WI, USA

To _me_ we'd want to show the base path because that's the site and it's a super edge case to use Drupal in a subdirectory. But laurrii would like it removed.

🇺🇸United States mglaman WI, USA

I thought we had an issue about this, sorry! It's documented in https://git.drupalcode.org/project/experience_builder/-/blob/0.x/tests/s... and we ran into it while working on Creating a page generates the URL path dynamically when editing. Active

    // Path field is always invalid for new entities.
    // @see \Drupal\path\Plugin\Field\FieldWidget\PathWidget::validateFormElement().

The widget excludes the violation if it's a new entity. I was hoping JSON:API had a fix for this

🇺🇸United States mglaman WI, USA

Correct. I think we can close this. I opened tickets with an idea of how things would be developed and merged. Then things went differently and I forgot about this issue 😅. Closing as outdated.

🇺🇸United States mglaman WI, USA

We want the full URL generation. But subdirectory wasn't accounted for. This falls on laurii to decide.

🇺🇸United States mglaman WI, USA

We have some problems here:

  • The code needs to move into the editor, how should we handle transliteration? Should we bubble the settings into the XB mount so it is accessible via configSlice?
  • How would we access and use the transliteration library within React?
  • I'm assuming this code needs to live within InputBehaviorsEntityForm for the path input, but can we know the value of the title from there? What is the best approach?
  • We can't actually publish these entities due to the fact path fields are always invalid for new entities! See \Drupal\path\Plugin\Field\FieldWidget\PathWidget::validateFormElement().
      foreach ($violations as $violation) {
        // Newly created entities do not have a system path yet, so we need to
        // disregard some violations.
        if (!$path_alias->getPath() && $violation->getPropertyPath() === 'path') {
          continue;
        }
        $form_state->setError($element['alias'], $violation->getMessage());
      }
    }

I honestly don't know how to move forward here

🇺🇸United States mglaman WI, USA

MR is ready for an initial review!

🇺🇸United States mglaman WI, USA

I'm confused by #3500046 had the ambition to be as xb_page-agnostic as possible but not this one?

Because creating an entity is more easily made generic than listing entities. Because pages do not have a bundle. But XB will support nodes, taxonomy, etc. And per the design there is a grouping for Pages and then other CMS content. So the assumption has been multiple endpoints.

🇺🇸United States mglaman WI, USA

Our team has an upcoming ticket for this.

🇺🇸United States mglaman WI, USA

Now that Show page information in top bar Active we can put the component in that popover

🇺🇸United States mglaman WI, USA

Woo! We're unblocked to build the in-editor page navigation.

🇺🇸United States mglaman WI, USA

MR approved! here's my attempt at issue credits, other maintainers fix as needed!

🇺🇸United States mglaman WI, USA

🫡 ready for reviews

🇺🇸United States mglaman WI, USA

Created 📌 Followup: tokens for page title in SEO settings Postponed as the follow up. Tests were added.

🇺🇸United States mglaman WI, USA

Going to help push this through over the finish line

🇺🇸United States mglaman WI, USA

Leaving in review for the backend code. But @attilatilman can you add a button to the editor's topbar?

In ui/src/components/topbar/Topbar.tsx let's add a "New" button right before <DemoPublishButton />

You'll need a new mutation for the onclick handler, see something like ui/src/services/preview.ts to POST to your new endpoint,

I'm not 100% sure how to handle routing to the new page once it has been clicked.

🇺🇸United States mglaman WI, USA

Ready for review. I'm going to ping laurii about:

If Open navigation modal by clicking on page title in XB navigation Postponed isn't ready, place the "New" button in the XB top bar.

🇺🇸United States mglaman WI, USA

I discussed with @amangrover90 and it is brushing on the edge of "can be difficult" and adjusting the scope of this issue.

Production build 0.71.5 2024