Hungary
Account created on 13 June 2008, over 16 years ago
#

Merge Requests

More

Recent comments

🇭🇺Hungary mxr576 Hungary

Removing the tag, since this has not been merged before 10.4.0 got released. :-(

🇭🇺Hungary mxr576 Hungary

🐛 The content overview Views view filters out unpublished content Active is still on RTBC, but hopefully the final-final-final stab was made on it minutes ago.

A related Slack thread: https://drupal.slack.com/archives/C079NQPQUEN/p1733181222760849

🇭🇺Hungary mxr576 Hungary

Thanks all, especially @mxr576 for sticking with this one.

:beers:

A backport to 10.3.x or 11.0.x would also require a backport of Improve Dynamic Page Cache header assertions in JSON:API tests Needs review which as a task isn't eligible for backport, so marking this as fixed.

Does this highlight an edge case in the backporting policy? Here’s the dilemma:
This fix cannot be backported to 11.0.x due to its dependency on a non-backportable issue. As a result, the upgrade path from 10.4.x/10.5.x to 11.0.x could lead to unexpected and unforeseeable feature or bugfix losses unless projects skip directly to 11.1.x.

🇭🇺Hungary mxr576 Hungary

It seems Improve Dynamic Page Cache header assertions in JSON:API tests Needs review has not been backported to 11.0.x yet, so that should be backported first.

🇭🇺Hungary mxr576 Hungary

Can we solve this by implementing a \Drupal\symfony_mailer\Processor\EmailProcessorInterface and enabling the bypasser in build() and deactivating it in postSend()?

🇭🇺Hungary mxr576 Hungary

Exciting news! Thanks for everyone who got involved, this is an important step to fix the dependent issue.

🇭🇺Hungary mxr576 Hungary

Thank you to everyone following this issue and to those who join the conversation in the future!

We’ve just published a blog post that explains why we believe this topic is critically important. The post also serves as a release announcement for two contributed modules we developed in-house to address this challenge:

These modules do not require any API changes in Drupal core but aim to provide immediate, practical solutions. Ideally, a comprehensive solution would involve robust new APIs for managing personally identifiable information (PII), including but not limited to usernames.

We hope these contributed modules can help move the discussion forward and pave the way for the necessary enhancements in core.

🇭🇺Hungary mxr576 Hungary

Rebased again, due to random test failure fixed in upstream: https://www.drupal.org/project/drupal/issues/3478621#comment-15875919 📌 Add a filecache-backed attribute parser Active

🇭🇺Hungary mxr576 Hungary

Looks good so far, we only have those changes in the MR that we should be, no changes on ResourceTestBase that was fixed in the spin-off issue.

🇭🇺Hungary mxr576 Hungary
❯ git rebase origin/11.x
Auto-merging core/.phpstan-baseline.php
Auto-merging core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
CONFLICT (content): Merge conflict in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
error: could not apply 07987b49a5... Cherry-picked "Improve Dynamic Page Cache header assertions in JSON:API tests"

I am going to use git merge origin/11.x instead of rebase in a hope that we do not need to restart the review process here.

🇭🇺Hungary mxr576 Hungary

Now that Improve Dynamic Page Cache header assertions in JSON:API tests Needs review is in 11.x, this needs a rebase because the MR does not apply anymore, because it had a cherry picked version. Maybe I just drop the cherry picked commit and see what happens...

🇭🇺Hungary mxr576 Hungary
+    langcode:
+      type: string
+      label: Language

Do we need to update existing plugin instances in an update hook due to this config schema change? Will the stored config schema remain valid?

🇭🇺Hungary mxr576 Hungary

Moving back to needs work since the "needs test" tag is on the issue and I haven't seen any test coverage in MR#3891 so far.

🇭🇺Hungary mxr576 Hungary

isNew() can be tricked, it most likely does not help PHPStan to narrow down the actual type of $node->id(), but I agree, let's follow the Drupal Way here -- funny, I wanted to use that originally, but I ditched the idea for some reasons, I hope not because tests started to fail :)

  public function isNew() {
    return !empty($this->enforceIsNew) || !$this->id();
  }
🇭🇺Hungary mxr576 Hungary

Yes they were random failures, restart make them disappear.

Test fails seem to be random ones, so if you can ping @bbrala or @larowlan for a final approval then it's RTBC in my book.

+1

🇭🇺Hungary mxr576 Hungary

No longer a Starshot blocker now that WASM is out.

For other curious ppl like /me who would like to what this means and why: 📌 Remove the WebAssembly trial Active

🇭🇺Hungary mxr576 Hungary

Thanks for the additional feedbacks, I have pushed back on some with answers and accepted one. Back to review

🇭🇺Hungary mxr576 Hungary

Yes, you may want to suggest the user to log in because afterwards they **may** get access to something, but at the same time, you may not want to disclose information about the entity behind the scenes, like the title/label could already hold such information.

So in this cases you actually would like to expose a Call To Action based on a deliberate decision and driving the user.

🇭🇺Hungary mxr576 Hungary

> I was able to open the unpublished node in view mode, but attempting to edit it triggered the error.

This behavior is indeed possible because the entity parameter converter basically relies on `Node::load()` with the given node ID, rather than performing an entity query that would respect query-level access control (`node_access`). Specifically, entity access handler and even `hook_entity_access()` implementation can grant access to a node even if hook_node_grants()/hook_node_access_records() does not. In practice, permissions like "view own/any unpublished node" are evaluated earlier than node access checks. If access is granted at this stage, node acess won’t be called.

And I assume the path based access checking relies on entity query... but I haven't checked.

🇭🇺Hungary mxr576 Hungary

I think it should be fairly simple setting up a failing test in this issue as a next step. That should also eliminate questions like which contribs or other Drupal patches were contributed to this problem on this and that project.

Based on what I have read so far my Spidey-senses say that the issue could be related to hook_node_grants()/hook_node_access_records() because when an node access module (like view_unpublished) is enabled then access control logic applied to nodes changes "drastically" on a site. Nodes that the current user does not have (view) access gets filtered out from query results so Node::load()/Node::loadMultiple() does not even get those to load. The current repro steps also does not say anything about whether the given user had _view_ access to the unpublished node or not, it just say they had edit access, which is an other clue for me, especially since I dealing with node access related wtf for a long time ( Grant query level access to own unpublished nodes Active ).

Steps to reproduce
* Create a role with permissions to edit nodes.
* As a user with that role, create a new node with a path alias
* Edit the node again and remove the "Published" checkbox. Try to save.

🇭🇺Hungary mxr576 Hungary

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

🇭🇺Hungary mxr576 Hungary

There are no merge conflicts atm but this branch is behind HEAD with 100+ commits, so I am rebasing to ensure whoever reviews the latest changes can review an up to date state.

#goForTenDotFourDotZero

🇭🇺Hungary mxr576 Hungary

So I don't think we can remove or warn about its usage.

+1

For changing the world, please join this other issue to brainstorm on how to make node grants and entity access work better together (less confusing to use): https://www.drupal.org/project/drupal/issues/3452449 Grant query level access to own unpublished nodes Active

🇭🇺Hungary mxr576 Hungary

+1 on #17, we should not reinvent the super admin definitionan. Maybe your findings in #18 means that the is admin parameter can be marked as deprecated and removed in D12.

🇭🇺Hungary mxr576 Hungary

What about user selection widgets with autocomplete? They use to show the username

Those are tricky ones indeed. Most likely they can only list usernames of users that the given user (current user) has view access to their usernames. For stored values, when the given user (current) user does not have access to view the other user's username it must display a placeholder (or just the user id, this is what we have in our solution).

🇭🇺Hungary mxr576 Hungary

The outcome of this issue could make the following one "closed, won't fix".

🇭🇺Hungary mxr576 Hungary

Thanks for the review, let me start with a the rebase since there is work to be done it seems.

❯ git rebase origin/11.x
Successfully rebased and updated refs/heads/3278759-access-cacheability.
🇭🇺Hungary mxr576 Hungary

mxr576 changed the visibility of the branch master to hidden.

🇭🇺Hungary mxr576 Hungary

Thanks for the review!

Let me start with a no-brainer rebase to ensure this MR remains up to date.

❯ git rebase origin/11.x
Successfully rebased and updated refs/heads/3473374-improve-resourcetestbase.

No conflicts.

🇭🇺Hungary mxr576 Hungary

however the content did not present. It wasn't until we removed the "Content Published status or admin user" filter and re add it did the content get presented as normal.

My questions:

* If the patch is to remove the additional Criteria on the queuery, why after apply the patch does the content not show up?
* Why does the content show up after I remove and re add the filter?

My gut says that this is some kind of stale cache or the lack of cache clear between the patch is being applied and site was visited. But as @morvaim said, some more context could came handy for reproducing this, for example, the source of the View block.

Currently I do not believe that the reported issue is blocking the merge of the MR.

🇭🇺Hungary mxr576 Hungary

kewl! This is fixed, now only crediting is missing and issue can be closed.

🇭🇺Hungary mxr576 Hungary
  Failed to clone https://github.com/composer/installers.git via https, ssh p  
  rotocols, aborting.                                                          
                                                                               
  - https://github.com/composer/installers.git                                 
    Cloning into bare repository '/root/.composer/cache/vcs/https---github.co  
  m-composer-installers.git'...                                                
    fatal: unable to access 'https://github.com/composer/installers.git/': Fa  
  iled to connect to github.com port 443 after 130169 ms: Couldn't connect to  
   server                                                                      
                                                                               
  - git@github.com:composer/installers.git                                     
    Cloning into bare repository '/root/.composer/cache/vcs/https---github.co  
  m-composer-installers.git'...                                                
    error: cannot run ssh: No such file or directory                           
    fatal: unable to fork                          

Ahh, so previously the pipeline failed due to transient errors.

🇭🇺Hungary mxr576 Hungary

Interesting, there were no conflicts. Back to Needs review.

Thanks for your feedback @nathanhealea, I have asked my colleague to try to reproduce the issue you reported. Thanks to the test coverage in the MR I am quite confident that the solution works, but there is always a chance for unknown issues.

❯ git checkout -b '3449181-content_overview_access_fix' --track drupal-3449181/'3449181-content_overview_access_fix'
Branch '3449181-content_overview_access_fix' set up to track remote branch '3449181-content_overview_access_fix' from 'drupal-3449181'.
Switched to a new branch '3449181-content_overview_access_fix'
❯ git fetch origin
remote: Enumerating objects: 2408, done.
remote: Counting objects: 100% (1905/1905), done.
remote: Compressing objects: 100% (743/743), done.
remote: Total 960 (delta 575), reused 516 (delta 178), pack-reused 0 (from 0)
Receiving objects: 100% (960/960), 523.33 KiB | 1.27 MiB/s, done.
Resolving deltas: 100% (575/575), completed with 285 local objects.
From https://git.drupalcode.org/project/drupal
   4e0ce97be7..75ea8e8bf9  10.2.x     -> origin/10.2.x
   72b94a8a0e..b53484abb1  10.3.x     -> origin/10.3.x
   d2ca6921a8..7bbceff8c4  10.4.x     -> origin/10.4.x
   0701817796..70c1b4f59a  11.0.x     -> origin/11.0.x
   49a3c28eaf..2ad947f2f3  11.x       -> origin/11.x
❯ git rebase origin/11.x
Successfully rebased and updated refs/heads/3449181-content_overview_access_fix.
🇭🇺Hungary mxr576 Hungary

Also, it looked like page cache became more chatty in X-Drupal-Cache since that change and probably this was the reason behind those changes in ResourceTestbase originally, but they weren't aligned with the original design,see my previous comment.

🇭🇺Hungary mxr576 Hungary

A recently merged changed the original behavior in the assert function, including what false means. More details are here:

https://git.drupalcode.org/project/drupal/-/merge_requests/9465#note_386330

So I decided it is better if I clean this up as well to avoid future confusion and replace FALSE|STRING with NULL|STRING.

🇭🇺Hungary mxr576 Hungary

Rebased and brought in latest changes from [##3473374] which also had to be rebased, but we found other regressions in 11.x in that: https://git.drupalcode.org/project/drupal/-/merge_requests/9465#note_386330

🇭🇺Hungary mxr576 Hungary

Moving back to needs review due to additional changes performed after rebase.

🇭🇺Hungary mxr576 Hungary
❯ git rebase origin/11.x
Auto-merging core/.phpstan-baseline.php
Auto-merging core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
CONFLICT (content): Merge conflict in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
error: could not apply 5ae7c67a39... Introduce generateDynamicPageCacheExpectedHeaderValue
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".

Rebase only impacted ResourceTestBase but due to this inherited problem more changes became necessary. all changes since the previous RTBC on ResourceTestBase are here: https://git.drupalcode.org/project/drupal/-/merge_requests/9465/diffs?st...

🇭🇺Hungary mxr576 Hungary

Tests to be written in a later phase.

But still in this issue, am I right?

🇭🇺Hungary mxr576 Hungary

Left a suggestion.

I also checked and it seems to me that the modified code has no test coverage, so there is nothing to extend. Covering TextField processor with tests should be a dedicated issue/effort.

🇭🇺Hungary mxr576 Hungary

MR failed on automated qa, back to needs work.

🇭🇺Hungary mxr576 Hungary

Hiding the redundant patch then.

🇭🇺Hungary mxr576 Hungary

(It looks like UUID vs revisioning supported is tracked under this Drupal core issue: Add UUID support for entity revisions Needs work . Bumped that with a quote from comment 9.)

🇭🇺Hungary mxr576 Hungary

Thank you for reporting this; turns out Paragraph entities do not have proper revisioning support: as Paragraph items are referenced not only by their entity ID, but also their revision ID, and revisions do not have UUIDs, there is no way to properly import references to Paragraphs' revisions. Because of that, even exporting Paragraph revisions is useless.

Based on this comment in #3421812-9: Support exporting/importing revisions , Paragraphs and import/export solutions especially could also benefit from UUID support in revisioning.

🇭🇺Hungary mxr576 Hungary

I do not think there is a use case for unsetting, only overriding.

🇭🇺Hungary mxr576 Hungary

Let's see if this idea and solution stands before test writing.

🇭🇺Hungary mxr576 Hungary

I take the opportunity that after so many back and forth code reviews with Kristiaan, mark this as RTBC. My changes since his last changes mainly impacted failing tests after his changes, that were changed by me previously.

🇭🇺Hungary mxr576 Hungary

Did a check on the changes and I generally agree with those. I hope nobody is going to raise scope creep just because for consistency reasons not on the view operation was touched.

There are some tests that needs to be fixed, I am going to working on that.

🇭🇺Hungary mxr576 Hungary

The issue here is that we're dealing with a passed in account rather than the current user so any user.foo cache context is technically not correct here.

YES...YES...YES!!! And I always feel bad when I have to bubble up cache per current user in anyways in an entity access handler method just to ensure things "do not get broken" but semantically that is completely incorrect. That said, this is what we have currently... :(

Thanks for the review, to be honest, I have lost a bit now... :) Could you please commit the expected change to the MR?

And before you do that, let's remember that we try to avoid cache per user as long as we can, this is the reason why user.roles:antonymous or user.roles:authenticated (in the current version) s the primary driver to differentiate access for logged in and non-logged in users instead of returning something that varies per user. We only do this as long as we can, so when a node_access module enabled than we have add user.node_grants: that basically makes every result vary by user in a different way.

🇭🇺Hungary mxr576 Hungary

Could you RTBC this then? Thanks!

🇭🇺Hungary mxr576 Hungary
🇭🇺Hungary mxr576 Hungary

user.roles:authenticated context bugs me since the latest change... maybe I can delay that and first check instead whether the user has the given permission, if yes, I can double check whether it is anonymous or not and only add that context, otherwise just vary per permissions.

🇭🇺Hungary mxr576 Hungary

Do you have concrete suggestions for code adjustments? I know those new methods will bring improvements but with the current tooling I tried hard in the latest commits to return as early as possible, but also keeping collected cacheability instead of ignoring them. But the chance is there that something can be still further improved

🇭🇺Hungary mxr576 Hungary

I see a new container_rebuild_required in the MR#6290, that needs a change record, maybe a documentation update about info.yml keys as well.

Production build 0.71.5 2024