Tasmania
Account created on 5 February 2007, over 18 years ago
#

Merge Requests

More

Recent comments

🇦🇺Australia imclean Tasmania

It would be good to filter out the outdated content. I'm using this patch with a slight change.

  if ($entity instanceof ParagraphInterface) {
      $hierarchy = [];
      $parentEntity = $this->getParentEntity($entity, $hierarchy);
      $isOutdatedParagraph = empty($parentEntity) || !$this->isReferencedInCurrentRevision($parentEntity, $hierarchy);
    }

    if ($isOutdatedParagraph) {
      return [];
    }

I don't want outdated content checked at all.

🇦🇺Australia imclean Tasmania
🇦🇺Australia imclean Tasmania

imclean created an issue.

🇦🇺Australia imclean Tasmania

Drupal\google_analytics_reports\Plugin\views\filter\GoogleAnalyticsNumeric needs some work to get it working properly and support min max, which currently generates an error.

I'm out of time to work on this, but for my current project I just removed support for min and max.

🇦🇺Australia imclean Tasmania

This still has problems with min/max causing errors.

🇦🇺Australia imclean Tasmania

I'm changing the scope of this to focus on properly supporting numeric filters. At the least, GoogleAnalyticsQuery needs to use the following classes:

Google\Analytics\Data\V1beta\Filter\NumericFilter
Google\Analytics\Data\V1beta\Filter\NumericFilter\Operation

🇦🇺Australia imclean Tasmania
🇦🇺Australia imclean Tasmania
🇦🇺Australia imclean Tasmania

In the meantime, I've found a problem where the correct filter wasn't being selected due to checking for lowercase "metric". This is a quick fix for all metrics.

🇦🇺Australia imclean Tasmania

@gilmord, that is a bit cleaner. I'll use it for an eventCount field but ideally all field types would be handled automatically.

🇦🇺Australia imclean Tasmania
🇦🇺Australia imclean Tasmania

Google\Analytics\Data\V1beta\MetricType has a static function for looking up the names.

🇦🇺Australia imclean Tasmania
🇦🇺Australia imclean Tasmania

imclean created an issue. See original summary .

🇦🇺Australia imclean Tasmania

Can you create an MR for this?

Also, is your other issue necessary: 💬 Upgrade module to use Microsoft Graph Apis instead of old windows apis Active

🇦🇺Australia imclean Tasmania

But of course Drupal scaffolding likes overwriting such files. To prevent this, add a "file-mapping" under drupal-scaffold (under extra) in your root composer.json:

        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            },
            "file-mapping": {
               "[project-root]/.gitattributes": false
            }
        },
🇦🇺Australia imclean Tasmania

A another approach is to convert the format to a timestamp and leave the data_type as it is. This allows you to select the date display format within the view.

/**
 * Implements hook_views_post_execute().
 * 
 * @param ViewExecutable $view
 */
function MY_MODULE_views_post_execute(ViewExecutable $view) {
  if ($view->id() === 'VIEW_ID' ) {
    foreach ($view->result as &$result) {
      $result->date = strtotime($result->date);
    }    
  }
}
🇦🇺Australia imclean Tasmania

When this problem triggers an error, it doesn't seem to pass on the field name to the logger. This then results in another error: 🐛 TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given Needs review

🇦🇺Australia imclean Tasmania

Here's what I needed to do to resolve the "fail to push limit" issue, with a working local copy. Pretty much based on previous replies, with an extra step.

Added to the top of the root .gitattributes file:

vendor/google/** -text

Then the following git commands:

git add .gitattributes
git add --renormalize vendor/google/

Then commit and push as needed.

🇦🇺Australia imclean Tasmania

@johnv,

- The buildConfigurationForm from the Event is removed. IMO events have no configuration

The event for core's Workflows transition includes optional configuration for the from and to state.

🇦🇺Australia imclean Tasmania

I can't get this to work properly and I've run out of time at the moment.

@johnv:

- The buildConfigurationForm from the Condition - I do not understand how the UI gets its values. The code has no default values, but the UI has

When using the WorkflowFieldValue condition after detecting a transition event, the selected items (field name, field value, expected value etc.) can't be found and all end up empty, therefore always returning true no matter what is set in the config form.

The config form has the correct values.

🇦🇺Australia imclean Tasmania

OK BPMN.iO is working fine.

However, the transition event is firing more than once for each transition.

🇦🇺Australia imclean Tasmania

MR created but it probably still needs some work.

There are a lot of things in the repository which shouldn't be, such as .local-dev and links to other repositories.

🇦🇺Australia imclean Tasmania

Another problem is that the transition event can be triggered multiple times.

For example, on a workflow transition with the condition "compare workflow field value" set to "Published" , the action "Publish content item" is fired.

Publishing the content item then triggers another transistion event. Comparing the previous and and current states in HookHandler shows they are still different, even though they probably shoudn't be.

🇦🇺Australia imclean Tasmania
+    $configuration = $form_state->getValues();
+    // The $values are not set to the latest values, so read from $input.
+    $configuration = $form_state->getUserInput()['configuration'];

$configuration is assigned twice.

Also, that last line should be:

$configuration = $form_state->getUserInput()['condition'];

This is using ECA Classic Modeller because BPMN.iO doesn't seem support the "PMT: compare workflow field value" condition.

I'm using this to send an email on state change, however the email is sent twice. I'm not sure why at this stage.

🇦🇺Australia imclean Tasmania

If you're not logged in, you can inspect the login button with your browser's deveoper tools and change <code>type="button"</code> to <code>type="submit"<?code>.  Leave developer tools open and the submit button will function as expected.

🇦🇺Australia imclean Tasmania

From the IS: "Let's say, I made changes of link setup and now I want to confirm that it works as I expected."

I missed the significance of this. OK this makes sense.

🇦🇺Australia imclean Tasmania

@joelpittet, that's fine, I'm just struggling to understand the use case for the original issue, which makes it hard to review.

Going back to first principles, can the IS be updated with a detailed explanation beyond just avoiding cron. For example, when a link on an entity is no longer valid - what are the next steps?

And, as I said, we don't need another "rescan all links" button, because there already is one.

🇦🇺Australia imclean Tasmania

There already is a button for rescanning on demand: "Clear link data and analyze content for links"

What problem is this issue addressing? (Taking into account my previous comments above.)

🇦🇺Australia imclean Tasmania

I'm using the views field to recheck individual links, but the link is no longer valid so always returns an error.

🇦🇺Australia imclean Tasmania

I mean, what's the objective of the MR? For example, say you have some external links on your site which are no longer working. How does this MR help?

🇦🇺Australia imclean Tasmania

@joseph.olstad

For us we want to do a full scan with button press without waiting for cron.

Yes, that's what we want as well.

The current MR allows you to check the remote links again, however usually the problem with remote links is that they've changed so rescanning the links stored in the database will continually return the same error.

Dead/broken links are changed by updating the entity with new links, or just removing the broken links. After that, the entity needs to be checked again.

There is already a way to do a full scan of all entities. On the linkchecker config screen, under "Maintenance", it's the button "Clear link data and analyze content for links". This could take a while on larger sites.

Being able to rescan individual entities on demand could be useful. It would need to also verify the dead link isn't on any other pages before removing it from the broken link report.

That said, I'm curious as to how you are using this MR. Are you checking internal, external or both types of links? How does the MR help?

🇦🇺Australia imclean Tasmania

Ignore the above, I'm having patching issues.

🇦🇺Australia imclean Tasmania

Should this work with forms loaded via ajax? I've applied the patch to the 4.0.x branch but it hasn't made any difference.

In my case, the target fieldset and controlling fields are within a paragraph type. When adding a new paragraph the fields are correctly shown or hidden while the fieldset wrapper is always visible.

🇦🇺Australia imclean Tasmania

I guess this would probably be a more appropriate status.

🇦🇺Australia imclean Tasmania

Sounds good, but that's not quite how open source works. Rather than requesting someone give you something for free, you can contribute to ensuring this is the correct solution.

In this case, the bare minimum would be to apply the MR to your own code to see if it's usable with D10/D11.

🇦🇺Australia imclean Tasmania

@joelpittet, yes I'm using MR !114 on 2.1.x.

🇦🇺Australia imclean Tasmania

There's a problem with this approach.

When there's a broken link on a page, usually the page needs to be updated with the new link or the link is removed altogether.

Using this MR, you can recheck a single link or all links, which it does, but it will continue to return the same error if the remote link isn't valid any more.

It might be more useful to rescan the entity/entities the link was on.

In other words, the broken link itself isn't the problem, the problem is the entity which contains the broken link.

🇦🇺Australia imclean Tasmania

Adds support for filtering on empty and not empty. There may be a neater way to do this but it is functional.

🇦🇺Australia imclean Tasmania

This is actually possible. EmptyFilter() works as advertised, just need to work out how to negate it, presumably with a notExpression.

🇦🇺Australia imclean Tasmania

Or not. Google's AI states:

The Filter.Empty filter in Google Analytics Data API v1beta is not a standard filter type and doesn't exist as a defined object or class within the API's documentation. It's likely a placeholder or a reference to a filter that does not apply any filtering logic, essentially representing an unfiltered view of the data.

Looking at the code, it doesn't look like it does anything.

🇦🇺Australia imclean Tasmania

@megan_m I've created a new issue: Add support for EmptyFilter Active

🇦🇺Australia imclean Tasmania

I'm also having this issue when using a string filter on a custom dimension.

Other things I've tried result in #3346317-7: Views filter string not working :

Error occurred! Google\ApiCore\ApiException: { "message": "Unsupported regular expression syntax in value. See https:\/\/github.com\/google\/re2\/wiki\/Syntax for supported syntax. invalid perl operator: (?!", "code": 3, "status": "INVALID_ARGUMENT", "details": [] }

🇦🇺Australia imclean Tasmania

Clearing the links and rechecking fixed the problem.

🇦🇺Australia imclean Tasmania

Using the MR with 2.1.x, I'm seeing the following error when trying to view a report:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 142 of /web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

The issue seems to come from here:

/web/modules/contrib/linkchecker/src/LinkCheckerLinkAccessControlHandler.php(68): Drupal\linkchecker\Entity\LinkCheckerLink->getParentEntity()
/web/modules/contrib/linkchecker/src/LinkCheckerLinkAccessControlHandler.php(58): Drupal\linkchecker\LinkCheckerLinkAccessControlHandler->checkParentEntityAccess()

Does the view need to be modified before this feature can be used?

🇦🇺Australia imclean Tasmania

@jonathanshaw I'm not sure what you mean, can you explain the exact scenario and how to replicate the problem?

🇦🇺Australia imclean Tasmania

Too late for this issue, but this looks like it could be a useful library for parsing a string of email addresses: https://packagist.org/packages/mmucklo/email-parse (github repository).

🇦🇺Australia imclean Tasmania

Although, when using a custom field formatter for file fields it's not clear how to set this option within the field formatter. The link URL object is generated in the preprocess function, and there's no way to pass additional attributes to the link element, only the warapper element.

🇦🇺Australia imclean Tasmania

Confirming #60 by setting the target for the link to _blank, which was my main use for this. I can't comment on anyone else's requirements.

function MY_THEME_preprocess_file_link(&$variables): void {
  $attributes = $variables['link']['#url']->getOption('attributes');
  $attributes['target'] = '_blank';
  $variables['link']['#url']->setOption('attributes', $attributes);  
}
🇦🇺Australia imclean Tasmania

Never mind, the error was all mine.

🇦🇺Australia imclean Tasmania

Thanks, I got around the immediate problem by moving Adminimal and Seven under custom themes.

The main issue is how to progress this issue. There can't be an official D11 release before Seven has one.

🇦🇺Australia imclean Tasmania

Still needs tests.

At the very least this should be updated as it's simply incorrect.

 *   - attributes: An associative array of attributes to be placed in the a tag.
 */
function template_preprocess_file_link(&$variables): void {}

file-link.html.twig:

<span{{ attributes }}>{{ link }}</span>
{% if file_size %}
  <span>({{ file_size }})</span>
{% endif %}

The attributes are applied to the wrapper element, not the a tag. See file.module for what's done with attributes.

🇦🇺Australia imclean Tasmania

How does this work without a base theme? Contrib Seven doesn't have a Drupal 11 version yet 📌 Automated Drupal 11 compatibility fixes for seven Needs review , and it was removed from core in D11.

🇦🇺Australia imclean Tasmania

Well, I applied the patch and upgrade_status is happy.

🇦🇺Australia imclean Tasmania

I've added a few questions to the MR. Given the related issue is stalled, what can be done here?

🇦🇺Australia imclean Tasmania

That shouldn't make a difference. To start with, have a look at the information in the links I posted. This isn't an issue with the module itself.

🇦🇺Australia imclean Tasmania

I mean Google may require OAuth2:

Are you using your full email address as the username?

do you mean drupal/oauth2? Because it doesn't have a stable version.

Whether to use it or not is up to you, that's not something I can help you with.

That said, it looks like there is a stable release, as well as a module on Github which integrates the OAuth2 module with PHPMailer SMTP.

🇦🇺Australia imclean Tasmania

Are you using Basic authentication? Your Gmail account may require OAuth2.

🇦🇺Australia imclean Tasmania

Committed to 2.3.x along with some other minor tidying. Markdown in Drupal doesn't yet have coding standards: 🌱 Adopt CommonMark spec for Markdown files Needs work

🇦🇺Australia imclean Tasmania

D11 is already supported, the change here has been added to the 2.3.x branch.

🇦🇺Australia imclean Tasmania

Not directly but you could integrate it with GeoIP API to provide that information.

🇦🇺Australia imclean Tasmania

Under "Debug level" select "Full communication.

Your username is your full email address and your password is case sensitive.

🇦🇺Australia imclean Tasmania

There is a core issue which might be related: 🐛 Issue with HTML ` ` not being correctly filtered out from URLs Active

🇦🇺Australia imclean Tasmania

The problem also occurs when using a "REST Export" display and selecting "Data export" as the style.

render() in Drupal\views_data_export\Plugin\views\style\DataExport uses core's serializer so I guess ultimately the problem should/could be fixed there, but it would be useful if this module supported the option to decode HTML entities.

🇦🇺Australia imclean Tasmania

Reopening as a feature request. It would be great to be able to filter based on numbers and dates, as per #5. NW for the 2.0.x branch.

🇦🇺Australia imclean Tasmania

#76:

+++ b/core/modules/file/file.module
@@ -1435,7 +1435,7 @@ function file_managed_file_save_upload($element, FormStateInterface $form_state)
-    \Drupal::logger('file')->notice('The upload directory %directory for the file field %name could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.', ['%directory' => $destination, '%name' => $element['#field_name']]);
+    \Drupal::logger('file')->notice('TThe upload directory %directory for the %name field could not be created or is not accessible, so the uploaded file was not saved.', ['%directory' => $destination, '%name' => $element['#field_name']]);

From the issue summary:

The problem being that on non-entity forms #field_name is not set

This issue is about removing the reliance on $element['#field_name'] being set.

Another way this problem shows itself is if the %name parameter is NULL when file.module logs an error, then the dblog page displays a white screen with the text "The website encountered an unexpected error. Try again later." The only way to fix this is to delete the entry in the watchdog table.

🇦🇺Australia imclean Tasmania

Here's a slightly different view based on a specific situation. I'm a maintainer of https://www.drupal.org/project/file_upload_options and accepted a Tata employee as co-maintainer. I looked into this person and the company they work for and noticed all the requests to be a co-maintainer, many of which were rejected.

The module has very low usage and I haven't been maintaining it as much as I'd hoped to. As expected, so far only D11 compatibility has been addressed but I'm hoping he will show more interest in improving the module. Either way, I'm monitoring commits and issues and if it doesn't work out I'll remove him as co-maintainer.

This is something I've done in the past when people have offered to help, even ones with experience, then done absolutely nothing apart from getting their name on the maintainers list.

🇦🇺Australia imclean Tasmania

This is possible by creating a view. There are a number of ways but I've used a view of "products".

- Add a relationship to Product Variation
- Add a relationship to Stock Location using the above relationship
- Add required fields (Product title, Stock Location: Name, Local Stock Location Level: Quantity)

Make sure you've run cron after stock transactions as that's when the data gets added to the commerce_stock_location_level table.

🇦🇺Australia imclean Tasmania

Bunny.net's oembed response doesn't return thumbnail dimensions so resulted in an error when trying to add a video. After applying the changes in the patch manually the oembed resource was accepted.

One related problem is that Bunny.net returns a thumbnail URL, which means it should also return the thumbnail dimensions according to the oEmbed specs, but it doesn't.

🇦🇺Australia imclean Tasmania

This would be a task, see Issue Categories .

Production build 0.71.5 2024