🇺🇸United States @brad.bulger

Account created on 12 June 2006, over 18 years ago
#

Recent comments

🇺🇸United States brad.bulger

It's specifically the lack of create permission that we were hitting - group editors don't get the button to create new subgroups. Even if that user has a Drupal role granting create access on that group type, they get an access denied error on the link that would appear in the button. If we display the actual ultimate path for creating the subgroup, the people with Drupal permission can use that. So far there doesn't seem to be any way to give a group member access to create subgroups of that specific group only.

🇺🇸United States brad.bulger

This is an AJAX callback in the form that is getting the name field value at runtime. Nothing is being written to the db. The relevant part is that $form_state->getValue('field_mynamefield') returns "_none" as the value for select list components.

What I'm not clear on is if that's intended. Does the change here only acts on submit or something like that. Should the value be "_none" or "" for field validation? For an entity constraint on the field?

I guess the change from blank to "_none" already went out in 1.0, I don't see any notes about the incompatibility change.

🇺🇸United States brad.bulger

I am testing this using the MR diff as a patch on Name 1.0. We have code that runs in an ajax callback function that builds a fullname string to store in another field. $form_state->getValue('field_name') is returning "_none" in the array of components. So the name.formatter service's format() function treats those like strings - we get "_none John Doe _none".

Is this the intended behavior? Anyone else who was counting on empty components returning empty strings is going to have a similar incompatibility problem.

🇺🇸United States brad.bulger

To #9, these aren't Drupal relative paths, they are HTML relative links. The href value does not start at the root of the site, it's relative to the current URL.

It is not a question of preference. /base and /base/ have different semantics. In many cases, the difference is unimportant. But it is important when there are relative URLs.

  • child relative to /base/ is /base/child.
    on https://my.site/base/ <a href="child">child</a> links to https://my.site/base/child
  • child relative to /base is (perhaps surprisingly) /child.
    on https://my.site/base <a href="child">child</a> links to https://my.site/child

- When should I use a trailing slash in my URL? (Examples added)

For SEO, as far as I can tell, the important thing is to be able to have a single canonical version that you use throughout the site. Maybe any kind of global setting is in conflict with that. I don't think you can define aliases that end with a slash, so I don't know how you would be able to define one item as ending with a slash and another item not.

🇺🇸United States brad.bulger

The path /group/[group ID]/subgroup/create is requiring create ggroup:[group type plugin ID] entity permission. Only admins can pass that requirement. This applies even though the user has access to /group/[group ID]/subgroup/create/[subgroup type].

🇺🇸United States brad.bulger

We could also copy the way that Block Exclude Pages does it:

Basic example where a wildcard is used to display the block on pages under the user path:

/user/* <-- this will make the block visible on all pages under the path.

But let's say you want to exclude a specific page or another path directory under the path "/user/?":

!/user/jc <-- now you will be able to specifically exclude the "jc" page

or/and:

!/user/jc/* <-- exclude on all pages under "jc/?"

That changes what's there now, we'd have to convert any excluded form IDs.

🇺🇸United States brad.bulger

Should this maybe be closed and another ticket opened? The change of status to "Needs review" implies that the changes are not yet released, but from what I can tell that's not true. I got the impression that 3.4 was a rollback of this, but it doesn't seem to be.

🇺🇸United States brad.bulger

I don't see the advantage. All this is doing is surfacing what was actually being done in the code, as far as only looking at form IDs that match those patterns (sort of - it would have matched on any form ID containing "user_", I changed it to match form IDs that start with "user_").

Being able to say "Match all of these except this one and this one" seems like a useful thing to be able to do.

🇺🇸United States brad.bulger

I can tell you that it has nothing to do with DDEV, we are running Drupal 10.3 on Ubuntu / Apache and we see this error constantly. It's caused by bots making GET requests to /contextual/render. They seem to come directly to that URL, no referral.

Personally, I wish it would just return NULL or some such instead of throwing an exception. I don't know why bots are trying to crawl /contextual/render like that.

🇺🇸United States brad.bulger

I've pushed some changes to the issue fork, do you want to review it there or as a merge request? I have not written tests for it yet.

🇺🇸United States brad.bulger

There needs to be at least an item in the README file and preferably a config form.

🇺🇸United States brad.bulger

The patch in #24 does not apply to 2.0.0 or to the current 2.x-dev. The patch from #20 still works.

🇺🇸United States brad.bulger

Until I (or someone) gets a fork set up, this is a patch file that corrects the problems.

🇺🇸United States brad.bulger

I am no kind of expert on image files or cameras but this is what the file command shows for one of the .JPG files that is giving us the 'Unknown format 0x300' error:

JPEG image data, JFIF standard 1.01, resolution (DPI), density 72x72, segment length 16, Exif Standard: [TIFF image data, big-endian, direntries=12, manufacturer=Canon, model=Canon EOS 80D, orientation=upper-left, xresolution=178, yresolution=186, resolutionunit=2, datetime=2019:05:16 23:51:45], baseline, precision 8, 3657x3033, components 3

That looks like a jpeg to me?

I am just wondering if in fact the two errors in the description both stem from the same problem, or if they are actually different problems.

🇺🇸United States brad.bulger

Is this really only one problem? I never see the Canon error and I see the Unknown format: 0x300 error constantly.

🇺🇸United States brad.bulger

I am getting this error on Drupal 10.3.10, PHP 8.2, Git Deploy 2.x-dev (2.5+1-dev). The patch fixes it.

🇺🇸United States brad.bulger

I recreated the patch again against 11.x. It applies cleanly to 10.3.x as well.

🇺🇸United States brad.bulger

Where is my dashboard? Where do I log in? How do I use the site to actually do things, as opposed to browse it while waiting in the dentist's office?

🇺🇸United States brad.bulger

It doesn't seem like the documentation has changed at all? The video is no substitute as always, but I found it difficult to follow in its own right. It seemed useful for people who already understood everything about the previous version of the module.

What is "stackable"? Is that explained anywhere?
What is the partial split? Why would you use it? Are there any examples?

Trying to find any examples of the most basic cases, like having the Devel module enabled automatically on a local development installation, it seems like most writeups say they are for Drupal 10 but are actually documenting the 1.x version of the module. Or maybe not?

🇺🇸United States brad.bulger

The workarounds are helpful, but the available tokens need to be expanded. For example, in Drupal 7 we were using %view-%exposed-%timestamp-full.csv for the filename. Including the query parameters - the %exposed filters - is very useful to have in the filename of the export.

🇺🇸United States brad.bulger

I am new to composer and trying to update only core Drupal. I have both drupal/core and drupal/core-recommended in my composer.json file. Is that bad? Should it be only one or the other? I could not get it to update until I found a note in Slack that mentioned doing composer update drupal/core "drupal/core-*" and that worked. As far as I know this composer.json is what we got from drupal/recommended-project.

🇺🇸United States brad.bulger

brad.bulger made their first commit to this issue’s fork.

🇺🇸United States brad.bulger

Maybe I'm misunderstanding the dismissal of the problem? I don't have a subdirectory in the URL to the site, it is just https://mydomain.local/, and when drupal_build_js_cache() tries to load the jQuery files, it is doing a file_get_contents() call on literally what is in the jQuery Update config - eg "/sites/all/libraries/jquery/jquery-3.7.1.min.js". That fails as you would expect.

🇺🇸United States brad.bulger

to follow up, in our case, we got that same curl 60 error as a result of a firewall (from Fortinet, hence their cert showing up) that was blocking the domain it was trying to reach. nothing to do with certificates at all, only a misleading symptom.

🇺🇸United States brad.bulger

we are getting this cURL error in relation to validating a remote video URL at youtube.com on a site running in a fake domain (the domain is only defined on our local hosts files at the server's IP). nothing suggested here is making a difference. trying to fetch the same URL that Drupal is trying to fetch gives this error from wget:

ERROR: cannot verify www.youtube.com's certificate, issued by ‘emailAddress=support@fortinet.com,CN=FG441FTK21900407,OU=Certificate Authority,O=Fortinet,L=Sunnyvale,ST=California,C=US’:
  Unable to locally verify the issuer's authority.
🇺🇸United States brad.bulger

I was getting the same error, and what fixed it for me was using www.googletagmanager.com rather than googletagmanager.com, even though theoretically the www. version is supposed to match the simple domain version.

I applied the patch but it did not change this - using googletagmanager.com in script-src-elem explicitly produced the same error.

🇺🇸United States brad.bulger

The class Drupal\Core\Render\Element\FormElement provides a base class for form element plugins.

That is linking directly to a page from Drupal 8.7. That base class is deprecated, I believe -  RenderElement and FormElement base plugin classes are deprecated and renamed to RenderElementBase and FormElementBase

The replacement looks like it is \Drupal\Core\Render\Element\FormElementBase - I don't know if that's true or if there would be a better starting point to match the original intention, though.

🇺🇸United States brad.bulger

This page used to be a useful partial list of element types

Form and render elements - 9.5.x - drupal
https://api.drupal.org/api/drupal/elements/9

But in version 10 it is reduced to one type, Component. Version 11 splurges on two types, Component and Ajax.

If there was some kind of link to some other place to find the information that would be one thing. This is subpar.

🇺🇸United States brad.bulger

The Drupal API docs provides a comprehensive list of Drupal form and render elements.

No they don't. It's ridiculous how hard it is to find a list of form element types. I still haven't succeeded since Drupal 8 first came out. There are some partial lists in some places, maybe, though they change from version to version.

🇺🇸United States brad.bulger

Ah ConfigImporter.php is from core, I was making assumptions. So even though I am trying to use the drush cdi1 command from config_devel to import a single config file, it is still going through some core stage that is having these problems?

🇺🇸United States brad.bulger

That's interesting but I'm not sure how it relates to this issue?

There is another module, Log Entity Operations , that has some capabilities like what the issue describes. It doesn't appear to be maintained.

Otherwise I think you would do grouping in the view. But I don't think there are any fields that tie changes together as being from the same update.

🇺🇸United States brad.bulger

This is quite out of date as far as I can tell.

🇺🇸United States brad.bulger

As of 2.3.0 at least, I'm running this module in a Drupal 10 installation with Drush 12.5.2.0, and I am not having any problems using drush. On the other hand, Drush doesn't see this module's generators at all. I started to try to write a new version but didn't get very far.

Should this issue be closed and a new one opened for the task of upgrading the generator code? Or repurpose this one? It matches the title but not the current description.

🇺🇸United States brad.bulger

This information is missing from the 9.x API documentation as well now, for what that's worth.

This seems like a serious problem, in that most of the pages we look for in the API are implementations of something else, and because of whatever problem there is, none of them document their parameters, return values, etc.

🇺🇸United States brad.bulger

Yes, this looks like it's working. I did a new install of Drupal 10 with ggroup 3.0.x and saw the original problem, then installed the issue fork branch. It only shows the types of subgroups that installed on the group type, and when there is only one it defaults to the form for it.

🇺🇸United States brad.bulger

Domain Source isn't dependent on Domain Access (at least it isn't anymore). I separated the changes made for the fields of each module so that it will work for either or both.

🇺🇸United States brad.bulger

There's an additional unrelated problem, that I have to fix to do anything about this issue. In DomainMicrositePathProcessor::processOutbound(), there is a line:

$domain_source = array_shift(array_column($entity->get('field_domain_source')->getValue(), 'target_id'));

The argument for array_shift() is passed by reference, so it has to be a variable. The array_column() call has to be stored and then passed to array_shift().

$target_ids = array_column($entity->get('field_domain_source')->getValue(), 'target_id');
$domain_source = array_shift($target_ids);
🇺🇸United States brad.bulger

OK. This may be a duplicate of some existing API issue, I'll keep looking.

🇺🇸United States brad.bulger

Yes, either 📌 Information is missing from the API pages Active is a duplicate of this, or I need to find/create another issue for API, or it's not an API issue (seems unlikely).

I don't know if it is strictly about interfaces. We would have to find a class that extends another class and overwrites a parent class function not defined in the interface. I have done some searching but that's tricky to find.

🇺🇸United States brad.bulger

I don't quite understand what this issue is reporting, but it looks like {@inheritdoc} is not working. Child class method pages don't show the annotations from the parent class method. Is that this issue?

🇺🇸United States brad.bulger

I wondered about that, how would I know which is the case? The copy of the API at api.druphelp.com would imply that the code itself is fine, I'd guess. ContentEntityBase::get() is {@inheritdoc} and the parent is FieldableEntityInterface::get() and that has all of the relevant information. So is this an API module processing bug?

🇺🇸United States brad.bulger

fwiw, we have a few dozen domains each with their own menu on our site, and we had to change route_param_key to a longblob - some values are over 10K.

🇺🇸United States brad.bulger

I hope I did that properly, I'm still new to using issue forks instead of patches.

🇺🇸United States brad.bulger

I think I know why you had that absolute URL logic in there. In the unpatched code, links to nodes that are tied to other domains with Domain Source show correct URLs to that domain. With the patch, they all come out in the current microsite domain. These are links generated by Linkit in CKEditor 5.

🇺🇸United States brad.bulger

May be related to this other long standing issue.

🇺🇸United States brad.bulger

Maybe. That issue seems oriented towards trying to prevent the problem. I am thinking more of how to document it. I am just not sure if there is a way to describe what's happening. Maybe not in 100% of the cases, but would "don't load an entity in this hook" be accurate?

🇺🇸United States brad.bulger

+1 on adding this. I needed to wrap the included view output in custom HTML that included values from other fields in the outer view, but not if the included view output is empty. The only way to do that is to do the custom HTML in the view field. This patch applied to 1.0.0-beta5 with only some whitespace warnings.

🇺🇸United States brad.bulger

I'm running Drupal 9.5 (9.5.12-dev ) and Drush 11.7.0-dev. Domain 2.0.x-dev. Still see this behavior.

🇺🇸United States brad.bulger

Can users detect the E_NOTICE from an unserialize() error with an error handler? That wouldn't mean that they are now, of course.

🇺🇸United States brad.bulger

@cmlara I suppose that it is unlikely that the comment would be updated now while a code change that moots it is being considered. That would be the only reason to split the bug off, I think.

🇺🇸United States brad.bulger

The issue is to spell out that any non-string scalar values will be stored as strings. Something like

mixed $value: The value to store. Non-scalar values are serialized automatically. Scalar values are stored as strings.

I don't doubt that this is as designed, the issue is to make it explicit.

Actually using the real service demonstrates this easily:

> $userData = \Drupal::service('user.data');
= Drupal\user\UserData {#9804}

> $userData->set('test', 1, 'testbool', FALSE);
= null

> $userData->set('test', 1, 'testint', 3);
= null

> $userData->set('test', 1, 'testfloat', (10/3));
= null

> $b = $userData->get('test', 1, 'testbool');
= ""

> $i = $userData->get('test', 1, 'testint');
= "3"

> $f = $userData->get('test', 1, 'testfloat');
= "3.3333333333333"

> var_dump(compact('b','i','f'));

array(3) {
  'b' =>
  string(0) ""
  'i' =>
  string(1) "3"
  'f' =>
  string(15) "3.3333333333333"
}
= null

If there are other places where values are handled in the same way, then yes, it would be helpful to note this there as well.

🇺🇸United States brad.bulger

The core form doesn't because it's the whole browser page, so submitting a form gives you the normal feedback of a POST - the spinning wheel of internet delay etc. I get why it seems like a feature request, but I would never give this to my users without something to tell them "yes the form was submitted, please wait".

I wonder if there is some common way that this works for modal popups.

🇺🇸United States brad.bulger

I've changed my installed copy to dev-3.x so I had to make a couple small changes to the patch to remove code that was already there. It seems to work fine.

🇺🇸United States brad.bulger

Can someone who understands this paragraph expand it with examples, and confirm that it works as described?

The path type will create a symlink to your local copy. To clone your local copy instead, set the type to vcs. If your local copy does not contain a composer.json file, you must use the package type and set the actual path in the dist part (to symlink) or the Git URL in the source part (to clone).

When it says "set the type to vcs", which type is "the type"? Can we point to any documentation for creating a composer.json file for a module?

I have a local copy of a contributed module. I'm trying to use a package repository entry of type "drupal-module" to get composer to install it into web/modules/contrib/ like a normal contrib module. But there doesn't seem to be any way to get it to make a copy, rather than a symlink.

🇺🇸United States brad.bulger

Not for me. Not clearing the cache with drush, at any rate. And the site does not come up at all to try to clear the cache through the UI. Trying to access /core/rebuild.php does not repair the problem. Running /update.php does repair the problem.

🇺🇸United States brad.bulger

Would that be better than trying to segregate that functionality into another module?

🇺🇸United States brad.bulger

This is off-topic, but has there been any thought of adding the start and end date values as separate field choices, similar to how for multivalue fields your choices are field_myvalue and field_myvalue:delta?

🇺🇸United States brad.bulger

I spun up a test site on simplytest.me using 10.2 and extended_html_filter 1.0.x, applying the patch https://git.drupalcode.org/project/extended_html_filter/-/merge_requests... (that link should be good for 12 hours, then you will need to recreate the site)

This shows the first issue I described: if you enable the filter and try to save the format, you get an error that <* style> is missing.

Trying to enable Source editing and add <* style> to the allowed tags fails:

The following attribute(s) are already supported by enabled plugins and should not be added to the Source Editing "Manually editable HTML tags" field: Global `style` attribute (<* style>).

I can't attach config for this text format because I can't save these changes due to the error.

🇺🇸United States brad.bulger

I don't have the change to the ckeditor5.yml file around anymore, unfortunately. Our development is stuck in 9.5 for the moment, I don't think it's worth testing in this too much. I'm attaching config files for what it's worth.

🇺🇸United States brad.bulger

Ah, I had missed that change.

Yes, it seems complicated. Possibly the changes in Match the filter_html <> ckeditor5 integration in Drupal core Needs work address this, or need to do so.

🇺🇸United States brad.bulger

The only AJAX change from the core "Limit allowed HTML" filter that I see is from the default elements allowed without CKEditor5
<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>

to the default elements allowed with CKEditor5
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em>

Adding <p> and <br> to the settings for "Extended HTML filter" just moves to another error:

The current CKEditor 5 build requires the following elements and attributes:
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em>
The following elements are not supported:
<a href hreflang> <cite> <blockquote cite> <code> <ul type> <ol start type="1 A I"> <li> <dl> <dt> <dd> <h2 id="jump-*"> <h3 id> <h4 id> <h5 id> <h6 id> <* style lang dir="ltr rtl">

That <* style> is wrong, in that it would allow any value for the style attribute, instead of the whitelisted values in the plugin config.

And in any case, trying to add <* style lang dir="ltr rtl"> to the Allowed HTML tags causes a fatal error in the validation:

Uncaught PHP Exception InvalidArgumentException: ""__zqh6vxfbk3cg__" is not a valid HTML tag name." at /path/to/drupal/web/core/modules/ckeditor5/src/HTMLRestrictions.php line 177,

There is core code expanding wildcards to that arbitrary string value, which is fine for attributes but not so much for elements.

🇺🇸United States brad.bulger

This patch file spells out the changes that worked for me.

🇺🇸United States brad.bulger

Is comment 17 above saying that at the moment there is no edit capability, only create? That's how it is working for me.

🇺🇸United States brad.bulger

Should this work in CKEditor 5 on Drupal 9.5 using version 2.1.x-dev? I am not seeing a toolbar button. No errors in the log or the browser.

🇺🇸United States brad.bulger

I ended up having to change extended_html_filter.ckeditor5.yml to set the <* style> element to match the styles I defined on the Extended HTML config page. Otherwise, it seems it wants that unrestricted style attribute and gives a validation error on the restricted style values from the plugin config.

🇺🇸United States brad.bulger

I wasn't using the issue fork code properly. I've moved to a vanilla Drupal 10 installation, with none of the other CKEditor modules I had installed in the first instance. I create a new text format, that uses CKEditor. The only buttons enabled are the default ones: Headings, bold, and italic. The only filter enabled is Extended HTML Filter. Now the "Allowed HTML tags" field of the Extended HTML filter settings is read-only, like the core Limit HTML filter. The tags enabled are <br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em>. Trying to save this, I get an error:

The current CKEditor 5 build requires the following elements and attributes:
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em> <* style dir="ltr rtl" lang>
The following elements are missing:
<* style>
🇺🇸United States brad.bulger

The core "Limit allowed HTML" filter is taking other plugins into account in the read-only list of allowed HTML that it generates. The "Extended HTML Filter" is not, at least not for me.

For example, in the Alignment plugin settings, I have all of the available alignments enabled: left, center, right, and justify. In the HTML tags allowed by "Limit allowed HTML", it includes alignment classes on the header tags: <h2 class="text-align-left text-align-center text-align-right text-align-justify"> etc. The tags for "Extended HTML" only include the "id" attribute for the header tags - except for <h2 id='jump-*'> which I don't recognize offhand.

🇺🇸United States brad.bulger

Maybe make these choices configurable in the text format? I would add a suggestion to add a "link text" field or some better name. If the user has selected text in the field being edited, default to that, if not, maybe default to the entity title. Add a configuration option to choose the base path, the alias if exists, or the title as the default. This is very typical capability in text editors.

Production build 0.71.5 2024