πŸ‡©πŸ‡ͺGermany @heavystonehead

Account created on 5 August 2017, over 7 years ago
#

Recent comments

πŸ‡©πŸ‡ͺGermany heavystonehead

I tried to make the effect reproducible, so I used a block of module views. But it basically affects everything. I created a custom block that fills a slider via an interface and doesn't update. Or at least it does when logged in, but not when guest.
custom block like this:
https://www.drupal.org/docs/creating-modules/creating-custom-blocks/crea... β†’

I wanted to test it again today:

- Currently it was 2:43 p.m. and I set the time to 2:45 p.m.
- Entry in list as: Admin not visible; Guest not visible
- It was now 2:45 p.m. - Entry in list as: Admin visible; Guest not visible
- As a guest I triggered $this->cacheBackend->invalidateAll(); and entry in list as: Guest was visible

now

- Currently it was 2:50 p.m. and I set the time to 2:52 p.m.
- Entry in list as: Admin not visible; Guest not visible
- It was now 2:52 p.m. - Entry in list as: Admin visible; Guest visible!!!

the positive effect after $this->cacheBackend->invalidateAll(); only lasts for a certain time. Today's test was again with old symptoms. That means that a certain time after $this->cacheBackend->invalidateAll(); everything is always displayed live, as it should.

πŸ‡©πŸ‡ͺGermany heavystonehead

This is the same case, but it does not only affect views but all blocks that are dynamic. It is also possible that a block has been created that has nothing to do with the views module.

πŸ‡©πŸ‡ͺGermany heavystonehead

The main problem is that blocks do not update, as in the example when a news list is displayed where content is only supposed to be visible in 1 minute, i.e. in the future, and the 1 minute passes, it is not displayed afterwards. The effect is particularly noticeable as a guest. (Time less than or equal to now)

I have had various situations, but they all lead to the same problem:
- A block created using a module where max-age was set, it should not actually save this, but it has no effect and is cached
- Calendar list, using view, here the cache option was removed, but it is saved here too
- Various other variations using some caching modules, e.g. to deactivate the cache of a page, but here too this did not lead to the desired result

The problem here is more that when you are logged in, the pages are sometimes actually updated, but as a guest they remain old. As written above, the guest only has a fresh page if the cache is completely emptied or new content is created, and it doesn't matter what content it is, i.e. it can be of any content type, it can also be contextless. A cron job does not trigger an update with the Drupal Core crone jobs.

Strangely enough, if I execute the code I posted, i.e. once, then I can create new future news and when the time passes this is immediately displayed.

I haven't done a long-term test yet, but whether I create content or new views with blocks and integrate them, everything is up to date, that's mindblowing and don't understand the mechanics.

Note: The focus here should be on the guest, i.e. an unregistered user.

I think it's basically the same as the post you linked: https://www.drupal.org/project/drupal/issues/2352009 β†’
max-age manipulation is not the solution here.

πŸ‡©πŸ‡ͺGermany heavystonehead

Apparently the problem is permanently solved if you trigger the following as a guest. (once)
$this->cacheBackend->invalidateAll();
I don't understand it. After you've done that, you can add new views, new content types and it updates everything immediately (Blocks). The question now is, does that fix it or does it break something?

I generated the codes in the attachment with claude.ai and modified them slightly. You can generate a token URL (/admin/config/system/av-cache-flush), first save the form so that you can use the link afterwards, then run it as a guest (without logging in). V1 only has the code mentioned above and V2 deletes even more caches or executes various codes to delete various caches. (if necessary, look at CacheFlusher.php - flushCache / flushAllCaches)

πŸ‡©πŸ‡ͺGermany heavystonehead

@quietone thank you very much, it's it is. (#3)

It didn't occur to me that a patch was causing this, sorry for the trouble.

πŸ‡©πŸ‡ͺGermany heavystonehead

The reordering issue appears to be resolved. Now only the 2nd anomaly remains.

If there is a taxonomy β€œTest 1” with ID 5 and a taxonomy β€œTest 1 (2)” with ID x, test 1 is selected and saved normally.
If there is a taxonomy "Test 1" with ID 5 and a taxonomy "Test 1 (5)" with ID x, then Test 1 will be saved as "Test 1 (5)" with ID x.

Thesis:
The terms are compared here and the ID is added as soon as terms exist. The existing IDs are not used here. This probably even happens afterwards, because correctly saved content is replaced with the wrong term after saving.

πŸ‡©πŸ‡ͺGermany heavystonehead

small note, I only recently noticed the problem (I've been looking for the cause for a week now) but it seems to have existed since version 1.x to 2.x and dev. I have had anomalies in the DB since December

πŸ‡©πŸ‡ͺGermany heavystonehead

I think I found the part

\datafield-2.0.2\datafield\src\Plugin\Field\FieldType\DataField.php
Line: 608
Missing:

      if ($item['type'] == 'entity_reference' && empty($value)) {
        return TRUE;
      }

After I added the part to the current one, everything worked perfectly again.

πŸ‡©πŸ‡ͺGermany heavystonehead

It is exactly the same as before that the 1st entry is not correct. Previously the taxonomy ID-1 appeared to have been inserted, but now it feels partly arbitrary. For the most part I have the feeling that it filters the type and takes the 1st ID of the vocabulary, on the other hand it is e.g. for country and city still incorrect vocabulary and with the ID 1.

I suspect that he sets the first datafield with id 1, filters all the others by vocabulary and uses its first sorted ID. It's confusing and currently incomprehensible to me.

I still have a backup of the working dev, is there any way to show what's different? I'll add that.

πŸ‡©πŸ‡ͺGermany heavystonehead

Version 2.0.2 is different from the developer. Same problem, only this time completely confusing.

see screenshots

old dev works fine, now its broken again and different.

πŸ‡©πŸ‡ͺGermany heavystonehead

same, can't login.
it is drupal 10.2 issue?
I think I only had the problem after the update. I have 10.2.5

πŸ‡©πŸ‡ͺGermany heavystonehead

My skills are very manageable and probably wouldn't be any help.

Thank you for the time you sacrificed for the great module.

πŸ‡©πŸ‡ͺGermany heavystonehead

I'm using Drupal version: 10.2.5
Yes, Dev works fine in the test instance. I'm not sure if I should test this again in the production version (backup). When would the next release be?

In any case, I'm glad I could use dev if needed

By the way, thanks for integrating it with JSON API

πŸ‡©πŸ‡ͺGermany heavystonehead

That really doesn't look bad, I'll take a closer look at it when I get the chance. Thx for sharing.

πŸ‡©πŸ‡ͺGermany heavystonehead

I have a complex converter that imports individual records from an old database as Drupal content. This worked fine until the update to version 2. I tried to determine what the problem was and wrote the module so that it could be narrowed down. The problem is as described. So when you create and save again, the first data record is correct again. The β€œform” contains static data, so it’s not actually possible to say that something is going wrong. I have it on 2 different Drupal instances with the same effect.

πŸ‡©πŸ‡ͺGermany heavystonehead

thanks for the reply. I was hoping there was something more elegant that I didn't see. I will then do it this way (have to do it this way) by first searching for the word in the taxonomies, having a list of the IDs returned to me in order to filter the content based on the IDs. It's my first attempt with json api, I hope the many mini queries don't matter. (JavaScript)

πŸ‡©πŸ‡ͺGermany heavystonehead

Thanks for the answer, but the question was how I filter the term. when I filter by the pattern I need to know the taxonomy ID, but I want to enter the name, which leads to an error.

http://yourDrupal.host/jsonapi/entity_type/bundle?filter[field_n_od_work...field_n_od_work.work_taxonomy&filter[field_n_od_work][condition][value]=123

http://yourDrupal.host/jsonapi/entity_type/bundle?filter[field_n_od_work...field_n_od_work.work_taxonomy.name&filter[field_n_od_work][condition][value]=test not working

πŸ‡©πŸ‡ͺGermany heavystonehead

If you use a media library and this overlay opens, i.e. via the paragraph overlay (or replaces it), then it will not be re-aligned in size and you cannot scroll. I don't know if that plays a role here at the moment. For me the overlay is too big after adding the image.

Production build 0.71.5 2024