Account created on 21 February 2010, over 15 years ago
#

Merge Requests

More

Recent comments

🇷🇴Romania amateescu

Thanks for reviewing :)

🇷🇴Romania amateescu

Postponing on Add back 'disabled' redirects Active so the upgrade path doesn't clash. This MR uses redirect_update_8111() and the other issue uses redirect_update_8110().

🇷🇴Romania amateescu

Here's a patch from the current MR that applies on top of Add back 'disabled' redirects Active , for folks that need Workspaces support :)

🇷🇴Romania amateescu

Decided to drop the behavior change for disabling redirects instead of deleting them on path alias updates, I think that should be discussed in a separate issue. This is fully ready for review now :)

🇷🇴Romania amateescu

Thanks @daffie for the review! Addressed most points in the MR, replying below to the other ones:

Can we use the upsert also for Drupal\Core\KeyValueStore\DatabaseStorage::setIfNotExists()?

Nope, because that method relies on the return status of the merge query, and upsert doesn't support that.

Can we replace all calls to Drupal\Core\Database\Query\Merge? If so, can we deprecate Merge?

Not sure, we can explore that in a separate issue.

The parameter $fields, is that only an array with values or can it also be an array with keys and values?

It's only an array with values.

Can we do some performance testing to make sure that with this patch Drupal becomes faster.

I ran time ddev drush si demo_umami -y three times before and after this change:

Before:
0,06s user 0,02s system 0% cpu 22,412 total
0,06s user 0,02s system 0% cpu 22,000 total
0,06s user 0,02s system 0% cpu 22,642 total

After:
0,05s user 0,03s system 0% cpu 21,223 total
0,05s user 0,03s system 0% cpu 20,941 total
0,06s user 0,02s system 0% cpu 20,550 total

So it definitely improves things :)

🇷🇴Romania amateescu

The MR looks good, thanks!

Made some code style fixes, added an upgrade path for the new config values and merge to 4.x

🇷🇴Romania amateescu

amateescu made their first commit to this issue’s fork.

🇷🇴Romania amateescu

Thanks @avpaderno!

🇷🇴Romania amateescu

This should be fixed properly after some upcoming changes in Drupal 11.3, but in the meantime the quickest fix is to not purge any data when deleting sub-workspaces. Thanks for reporting this!

🇷🇴Romania amateescu

As far as I know the proposed resolution hasn't happened in another issue in the meantime, so this would be still be worthwhile :)

🇷🇴Romania amateescu

Missed by one day, but still interested :)

🇷🇴Romania amateescu

Merged into 3.x, thanks everyone for the discussion and patience with this bug :)

🇷🇴Romania amateescu

Looked a bit into this and it seems like it's actually a core problem: CM sets the load_latest_revision = TRUE param even on the delete route, which I think is wrong.

Undoing that in a core issue might take a while though, so for expedience let's add a quick fix in Trash for now.

🇷🇴Romania amateescu

amateescu changed the visibility of the branch 3320566-lawxen to hidden.

🇷🇴Romania amateescu

amateescu changed the visibility of the branch 3.x to hidden.

🇷🇴Romania amateescu

An interaction with another module is my guess as well. I think what would need to happen for this error to appear is for an entity class to use the entity type manager instead of the entity field manager in FieldableEntityInterface::getFieldDefinitions(), in which case that entity class needs to be updated.

Closing for now but feel free to reopen if you bump into it again and can point to the problematic entity type.

🇷🇴Romania amateescu

I also can't reproduce this. What entity type were you trying to generate?

🇷🇴Romania amateescu

That's right.. I'll see what we can do about it.

🇷🇴Romania amateescu

This was recently fixed in 🐛 Deleting a workspace may lead to live data deletion Active , you'll need to update to the latest dev version :)

🇷🇴Romania amateescu

We decided to handle the root cause of this problem in WSE: 🐛 Deleting a workspace may lead to live data deletion Active

🇷🇴Romania amateescu

Still interested...

🇷🇴Romania amateescu

This MR adds a lot of code for something that would be more easily done when we replace the trash overview pages with views. I'm sorry but I'm going to close this. The views overview work will probably happen in Add bulk restore function Active .

🇷🇴Romania amateescu

I know that the Group module does some pretty advanced query altering, but Trash's entity query alter is just adding a regular field condition, so I'm a bit surprised there's a possible clash.

Let me know whether you manage to reproduce this on a more vanilla site, otherwise I'll try to check it myself soon :)

🇷🇴Romania amateescu

Thanks for testing! Merged into 3.x.

🇷🇴Romania amateescu

While looking into @catch's suggestion and realizing that we can't use DeprecatedServicePropertyTrait because that's specific to variables that store services (objects), I figured out that we can actually provide a proper deprecation strategy for this. Wrote a CR as well.

Ready for reviews again :)

🇷🇴Romania amateescu

One solution could be for the system menu block to add a "fake" condition to the query (like system_menu_block = TRUE), and workspaces could check for that parameter condition before removing the enabled one.

🇷🇴Romania amateescu

Well.. that's very much internal to the content entity storage and I don't really see a reason for outside code/storage overrides to do something with it.

The alternative would be to add a new method specifically for clearing it, but I don't think that's preferable to the current approach from the MR. Core committers can decide I guess :)

🇷🇴Romania amateescu

Okay, sorry about that :)

🇷🇴Romania amateescu

Right, but this request is for transferring the project ownership, that's why I only took @rötzi into account.

🇷🇴Romania amateescu

I've tried to reproduce this quickly by putting this code in a template, and the output was correct, trashed nodes were not displayed:

{% if drupal_view_result('frontpage', 'page_1') is not empty %}
  <h2 class="section-heading">Publications</h2>
  {{ drupal_view('frontpage', 'page_1') }}
{% endif %}

Does your view have a filter on the deleted field? Because that's the only way to bypass Trash's Views query alter, see https://git.drupalcode.org/project/trash/-/blob/3.x/src/ViewsQueryAlter....

🇷🇴Romania amateescu

You can create paragraph entities in a workspace if you have WSE installed or this patch, but they're not tracked by that workspace :) The CRUD part mostly means "allow any operation for this entity type but don't track it".

🇷🇴Romania amateescu

I've read through the latest comments and I agree that having access to enable/disable queues through the update permission is problematic.

However, I think it's an advanced enough use-case that we can use the administer entityqueue permission instead of adding a new one. Updated the MR to do that and also fixed a few other things.

Merged into 8.x-1.x, thanks for all the work on this!

🇷🇴Romania amateescu

I tried to reproduce this using the steps in the issue summary and I couldn't get the view to display anything after adding the second contextual filter. Can you please update the steps with actual values? Even node title and values for the body field would help to ensure that I'm testing your specific scenario.

And you can leave out the parts about adding the modules, installing the site, etc. as they're not necessary :)

🇷🇴Romania amateescu

Or XB would need to pick up the message from some generic source that Trash altered :)

That's exactly what needs to happen :) Trash alters the description message of \Drupal\Core\Entity\EntityDeleteForm (actually coming from its parent: \Drupal\Core\Entity\EntityConfirmFormBase::getDescription()), and XB's xb_page entity type declares that it's using that form, but the message from the screenshot seems to be provided by a JS file instead: ui/src/components/navigation/Navigation.tsx

🇷🇴Romania amateescu

Committed to 3.x, thanks for reporting it! I'll tag a new release as well :)

🇷🇴Romania amateescu

We still need to handle deprecated routes somehow, per #5 and following discussion :)

🇷🇴Romania amateescu

Thanks for opening this (very detailed!) bug report :)

Automatically purging nodes would require a batch operation for that form, so I'd prefer to let the system work as intended and prevent the deletion of that content type instead.

🇷🇴Romania amateescu

Thanks for opening this issue. While I agree that this case needs to be handled better, I don't agree with the AI that generated the solution (and the issue summary by the looks of it), and I think we need to throw a helpful exception in order to make the developer aware of the problem.

🇷🇴Romania amateescu

Yup, that's the correct way to bypass trash and purge entities directly :)

🇷🇴Romania amateescu

Bulk purging (and restoring) will be implemented in Add bulk restore function Active :)

🇷🇴Romania amateescu

Oops, I wasn't looking at the changes tab. Not sure what happened there but I couldn't do anything with that branch so I opened a new MR instead.

🇷🇴Romania amateescu

@smustgrave, not sure why you think so, the MR was applying just fine. Merged the latest 11.x though just in case.

🇷🇴Romania amateescu

Merged into 3.x, thanks!

🇷🇴Romania amateescu

amateescu made their first commit to this issue’s fork.

Production build 0.71.5 2024