πŸ‡ΊπŸ‡ΈUnited States @laboratory.mike

Account created on 2 April 2007, about 17 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

Currently I have this in a cron job:

$now = new DrupalDateTime('-90 days');
$delete = \Drupal::database()->delete('mail_safety_dashboard');
$delete->condition('sent', $now->getTimestamp(), '<');
$delete->execute();

We could set this up in a container with dependency injection, and add a config to set the retention time.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

Hi there Katy, I'm glad to explain both what the overall issue is, how I solved it when setting up the module, and will add some instructions on what to do for the ECK content.

Problem

The root issue concerning paths also extends to the names of routes used by certain entity types. For example, the route name for adding a node is "node.add" but for a user its "user.admin_create" . Some entities have bundles, which features into access and the add process, and further, certain entities in contrib modules, like Group, have further considerations beyond that.

IOW, there isn't a universal way to do entity creation.

Solution

To manage this, I set up a plugin system, with the most relevant folder to check out being here:

views_add_button/src/Plugin/views_add_button

The ViewsAddButtonDefault.php file contains the default logic you are observing. It tries its best, but as you saw, it can't cover everything.

Next, I created Node, Taxonomy, and User specific plugins, which handle specifics for each entity type.

There's also a views_add_button_group contrib module for Groups and Group Content.

For ECK

If you're in a position to do so, try creating a custom module, adding an src/Plugin/views_add_button folder, and copying in one of the contrib module's plugins, and modifying it to suit your case. Otherwise, I know ECK's pretty popular and I could add a submodule to support ECK entities. I would just need your help to QA it.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

Looks good, I'll check it out and get it merged after QA.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

laboratory.mike β†’ made their first commit to this issue’s fork.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

I'm starting to do some updates for VAR, and went ahead and included the existing commits and move to support D9/D10 in the 2.0.x version. Thanks all for the feedback and working through this.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

laboratory.mike β†’ made their first commit to this issue’s fork.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

At this point I'm ending further support for the D7 version due to the coming EOL, but if another developer would like to reopen this, please do so.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

At this point I'm ending further support for the D7 version due to the coming EOL, but if another developer would like to reopen this, please do so.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

Thank you for your contribution @tobiasb! I've merged this into the codebase, and will include it in the next release.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

@manoj-rajr it looks great, thanks.

I've merged it in, and will include in 2.0.5 .

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

laboratory.mike β†’ made their first commit to this issue’s fork.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

Thanks Tobias for the patch. I'll review it in the near future and get it merged in.

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

Yes, its fixed. Thanks to Stefanos for the patch!

πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

I recently ran into this on my d10 site, using a fresh install. I tried the commerce_cart workaround, and got it working.

Production build 0.69.0 2024