Vienna
Account created on 15 May 2017, over 7 years ago
#

Merge Requests

More

Recent comments

🇦🇹Austria arthur_lorenz Vienna

Also fixed CS and phpunit issues. Merged

🇦🇹Austria arthur_lorenz Vienna

It was a blast, big thanks to the organizers and speakers!

🇦🇹Austria arthur_lorenz Vienna

Commented and added tests for altered paths.

🇦🇹Austria arthur_lorenz Vienna

Thank you! ['/ce-api?param=1', '', TRUE] actually failed. Fixed it and added a couple of test cases.

🇦🇹Austria arthur_lorenz Vienna

Added a simple unit test to check if base paths are considered.

🇦🇹Austria arthur_lorenz Vienna

The resulting pipeline does still not pass.

I can not confirm this. The pipeline is passing

Otherwise you are right, this should rather be handled and documented in a separate issue 🐛 Respect installations with base paths Needs review .

🇦🇹Austria arthur_lorenz Vienna

Argh, that didn't make any sense. The fields i was accessing were generated by a magic getter.

🇦🇹Austria arthur_lorenz Vienna

Thx, good catch, I improved the string replacement.

🇦🇹Austria arthur_lorenz Vienna

P.S. I applied this patch.

You should've applied the patch from the referenced merge request :)

🇦🇹Austria arthur_lorenz Vienna

I assume the issue is similar to this: https://www.drupal.org/project/lupus_decoupled/issues/3395669 📌 Make the gitlab-ci pipeline pass Needs review

We need to make the middleware consider possible path prefixes!

🇦🇹Austria arthur_lorenz Vienna

I fixed the middleware to work with path prefixes.

🇦🇹Austria arthur_lorenz Vienna

After some debugging I'm confident that I have located the issue: The BackendApiRequest middleware is checking for the /ce-api prefix in the server's REQUEST_URI. Since the base url in gitlab ci is http://localhost/web, the actual uri that is checked at that point is /web/ce-api/node/1 which the middleware does not recognize as a valid ce api request and therefore passes the request through without altering it.

I did not have time fix it yet though.

🇦🇹Austria arthur_lorenz Vienna

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

🇦🇹Austria arthur_lorenz Vienna

For me still doesn't work. When enabled MR38 it works as before, when i submit the field edit form, only argument and pager can be enabled in Enable extra settings.

In the config export i see this:

enabled_settings:
argument: argument
limit: 0
pager: pager
offset: 0

Hmm, looks like the schema did not get updated. Did you clear the cache?

If i change to

enabled_settings:
argument: argument
limit: 1
pager: pager
offset: 1

and import the new config nothing happens, i don't see the limit and offset options in the entity where the field is included.

Of course, the value should match the key, as for argument and pager. So you'll need to change it to

  enabled_settings:
    argument: argument
    limit: limit
    pager: pager
    offset: offset
🇦🇹Austria arthur_lorenz Vienna

The config schema for the field settings was off and expected integer values instead of strings. The config is saved using the option value instead of some integer/boolean, e.g.:

enabled_settings:
    offset: 'offset'
    limit: 'limit'
🇦🇹Austria arthur_lorenz Vienna

but I'm kind-of weirded out by the notion that anonymous/authenticated roles would not exist

In the end both roles are just some config. If the config was not yet applied, the roles won't exist. But I should add the user module as dependency.

and a little afraid that now they won't get the "restful get rest_menu_item" permission assigned as they should.

don't be :) Usually this should only occur during site install with existing config. Then the permission should be applied in the config files and imported later on. Otherwise the roles should already exist. If not there might be a reason for it and it should not fail.

But I'm wondering if it makes more sense to check the `$is_syncing` and skip the step if it's true to not mess with any config.

🇦🇹Austria arthur_lorenz Vienna

Thank you, testing previews on a fresh D10.1 with our nuxt kickstarter frontend was successful.

Tested:

  • Preview Button in node form
  • Responsive Preview modal in node form
  • Responsive Preview modal in layout form
🇦🇹Austria arthur_lorenz Vienna

I found a couple of small issues in the MR

🇦🇹Austria arthur_lorenz Vienna

That's a valid point the amount of menu items might easily get out of hand. I'm thinking of moving it to a submodule to use at one's own risk since most use cases might cover a handful of podcasts max.

🇦🇹Austria arthur_lorenz Vienna

How to reproduce on a fresh D10 install:

$options = [
  'query' => [
    'uri' => 'foo/bar',
    'page' => '/test',
  ],
];
$url = new \Drupal\Core\Url('<front>', [], $options);
(string) \Drupal::service('link_generator')->generate('Example link', $url)

will result in

<a href="/?uri=foo/bar&amp;page=/test">Example link</a>

🇦🇹Austria arthur_lorenz Vienna

Thx, cleaned up the code and fixed cs issues.

🇦🇹Austria arthur_lorenz Vienna

I added a new config to enable/disable a check if the selected log group or stream is valid.

🇦🇹Austria arthur_lorenz Vienna

I extended patch #5 enable the users to create their own message format providing more metadata.

🇦🇹Austria arthur_lorenz Vienna

This patch only works well on simple fields like text fields. On more complex fields, e.g. entity_reference_revisions, you are not able to translate the referenced entity and its fields.

🇦🇹Austria arthur_lorenz Vienna

argh, sry for spamming, the last file contained a line that should not've been there.

🇦🇹Austria arthur_lorenz Vienna

The problem: The layout builder loads the blocks by the referenced block revision id, that is saved in the layout field. As soon as we add a translation to the block, a new revision is created, becomes the default revision and the one referenced in the layout field becomes outdated. If we now update the block in the original language it creates a new revision that is based on the outdated revision and therefore has no effect on the translations.

Solution: Update the referenced revision in the layout when a translation is created or updated. Also update all nodes that have translations so all block translations are in sync again. This will cause the original language to be set back to the point where the revision got outdated (because the translation was created). My solution to this so far is to create a new node revision in the update hook to be able to revisit the latest version of the block. But the content has to be updated manually.

🇦🇹Austria arthur_lorenz Vienna

It's not a Drupal local-task, what could be confusing if the API returns it as local task then.

True. But imo from a user's point of view it is much nicer to have this in the local tasks then rendering an additional link in spot that is only used for this exact link. This link would also need to be taken care of in the frontend to be sure it's styled etc. To me it's equivalent to the Edit link in core's local tasks, that's why I want to have it there.

Then, it's not nice to special case code of individual routes in there.

Well, the node module basically does the same in a hook_page_top. Just the outcome is worse imo.

Drupal has APIs for adding local tasks for routes, so if anything we should use them. But that might show up when not using drupal-ce as well.

Exactly, we don't want to interfere with the core functionality here. My goal is to avoid overcomplicating the task. I think the question is whether we want to map Drupal's functionality 1:1, or if we use the gathered flexibility of our custom renderer to add tiny UX improvements like this without having to create a core issue or similar. But the more I think about it I come to the conclusion, that this module might not the right place for this change. Let's discuss it in the next weekly

🇦🇹Austria arthur_lorenz Vienna

Thx, updated MR and additionally uploaded a patch file.

🇦🇹Austria arthur_lorenz Vienna

MR !34 enables the frontend redirect for node preview and revision routes.

🇦🇹Austria arthur_lorenz Vienna

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

🇦🇹Austria arthur_lorenz Vienna

Tested on a fresh ddev installation. Works as expected!

🇦🇹Austria arthur_lorenz Vienna

Yes, you are right, I did not find the time yet to properly document the module. You'll need to have the Geolite 2 city database file in web/libraries/geolite2/GeoLite2-City.mmdb

You can either download and manually place it there, or add the following repository to your composer.json and run composer require podcast-publisher-analytics/geolite2

        {
            "type": "package",
            "package": {
                "name": "podcast-publisher-analytics/geolite2",
                "version": "1.0.0",
                "type": "drupal-library",
                "dist": {
                    "url": "https://cdn.jsdelivr.net/npm/geolite2-city@latest/GeoLite2-City.mmdb.gz",
                    "type": "gzip"
                }
            }
        }
🇦🇹Austria arthur_lorenz Vienna

On install the service provider is called before config is added to DB -> added a fallback

🇦🇹Austria arthur_lorenz Vienna

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

Production build 0.71.5 2024