Account created on 20 February 2007, over 17 years ago
#

Merge Requests

Recent comments

Tested MR40, Duplicate option appear and work as expected

Just tested MR35 and it works great. New 2 options "Between (Inclusive)" and "Between (exclusive)" appear in the "Shipment > Shipment Weight -> Operator"

Tested #24 with latest dev and works.

Thanks,

You can use "Raw value from URL" in "provide default value" in version 1.x.

More information can be read from here (You can also use patch in that issue if you want to.) -> https://www.drupal.org/project/eca/issues/3351738 📌 "Entity : Load" with multivalue entities OR condition "Not Current Node" Fixed

I think this is the same issue here -> https://www.drupal.org/project/rules/issues/2816033 🐛 Rules registers no listeners on rare occasions. Needs review

Thank you for explanation.

I still think at least, have something to distinguish it like font color. Or display a warning if trying to over ship. With current UI, chance to make a mistake is very high especially with a store that usually make multiple shipments.

Thanks,

Patch #21 does what the title described which is to add quantity in front of the label in this format :

"2.00 × Product One"

However, quantity shows only in Edit Shipment which is kind of strange. So, I modified code a bit to also show quantity when Add Shipment too. ( MR !20 )

I just have time to test this problem again and found that in "ShipmentForm.php", this line:

in_array($order_item->id(), $already_on_shipment, TRUE)) {

cause the problem in this issue. I can either remove "TRUE" or convert a value to be the same type. I decided to convert it. So, the code will change to

in_array(intval($order_item->id()), $already_on_shipment, TRUE)) {

Tested and work but since I don't know how to program, patch, etc. So, I hope, I did this correctly.

Thanks,

just tested MR361 and now it works, no more scrolling back to Ajax.

Thank you mxh,

I think this is a bug in Core. Ajax will not work correctly with Text Field / Text Area -> https://www.drupal.org/project/drupal/issues/2627788 🐛 Focus state bug on text field AJAX calls Fixed

Yes, you are right, I have a view of nodes using paragraphs as relationships. I then, tried to use paragraphs as a base table and ran into a bug in Entity Reference Revisions ( https://www.drupal.org/project/entity_reference_revisions/issues/2799479 🐛 Views doesn't recognize relationship to host Needs work ). If I remember correctly, this is the reason I always created Views using node (content) as the base table all the time.

Anyway, when create a new Views using paragraphs as a base table, it works now.

Regarding, "Entity: get field value" and "Entity: load via reference", this is good, I'm sure I will need it soon since I plan to use ECA to replace many of my work flow.

Thank you mxh,

Just tested MR5 from #187 and it fixed this issue for me.

Thanks,

Just tried Entity: load via reference which is also work great. But I found a problem when working with multiple paragraphs and relationship. When I tried to set value using ECA VBO, the first paragraph is always set. Even though the row I selected in Views is second paragraph. Is there anyway to make it work?

Thank you,

The problem here is that when I enter the value in Text area before patched to Text field, I can put in 208 characters in it. (Token) Once patched, Text field default maxlength is only 128 characters, which cause this error.

I think that many arguments in the form of Token can be long and 128 characters might not be enough in some case. I think it's better to increase that value (if possible) to hold more characters. ( Search API did this here -> https://www.drupal.org/project/search_api_field_map/issues/3189604 )

Thanks,

Just tested patch #8 again with Drupal 9.5.8 , Drupal Commerce 8.x-2.x-dev updated 7 Apr 2023

The patch still works.

I also found another module that can do the same thing here -> https://github.com/gnikolovski/commerce_gnikolovski

The module might be better for existing site since it provided you another new option Limit by shipment weight range in case you don't want current config to mixed up and got an error "Invalid weight unit "" provided." after patched.

Just tested by applied both patches (#16, #23) , no more error. Everything seems to work great now.

Thanks mxh, jurgenhaas

I think I found another problem after patched. If I put Preload Content Entity / Load Content Entityinto the model, it's still working, but once I point it to an action. (Here is Display A Message to The User) The only text to display is "Test". Then, the error below appear :

[Wed Apr 19 17:53:52.516161 2023] [proxy_fcgi:error] [pid 10665:tid 140248222541568] [client xxx.xxx.xxx.xxx:0] AH01071: Got error 'PHP message: Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceCircularReferenceException: "Circular reference detected for service "eca.service.condition", path: "eca.service.condition"." at /xxx/xx.xxx.com/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php line 147', referer: https://xx.xxx.com/

Just tested patch #16 and I don't get any error with Log Level "Debug" anymore.

Thanks jurgenhaas,

I think I just found what cause this problem. (In my case) It's about Log Level. I can set to anything except "Debug". If I set Log Level to "Debug", then, error will appear.

@jurgenhaas, I just added "PreLoad Content Entity", and save it, once I saved, my site went down immediately. Need kill switch to get back online.

Also, just tested "Load Content Entity", site went down too but with different error :

[Tue Apr 18 19:06:41.571995 2023] [proxy_fcgi:error] [pid 17693:tid 140248440653568] [client x.x.x.x:0] AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /xxx/domains/xx.xxx.com/public_html/core/lib/Drupal/Core/Cache/DatabaseBackend.php on line 167'

Just got something similar to this issue. At first, I thought it's because of 2 Events but then, when I narrowed down to only one event which is PreLoad Content Entity With this event, I immediately got 503 error :

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Also, try drush cr and got "Segmentation fault"

Also try with -any- , Content: Article and many more to make it more specific but always got 503 Error if I put this event in the model.

Below is the error I got from Server log :

[Tue Apr 18 18:05:46.970961 2023] [proxy_fcgi:error] [pid 17691:tid 140248491009792] (104)Connection reset by peer: [client x.x.x.x:0] AH01075: Error dispatching request to :

Thanks jurgenhaas,

Just tested patch #11 and it works as expect. No more option in Contextual filter to confuse user.

From what you said, I did some more test and found that value in "Path component" doesn't matter too. I tried to set "Path component" to 1 for all arguments. Or I can just set one of them in different order like 1, 7, 1, 1. The result I got is the same. The important thing here is the order in the "Contextual filters". It has to match to the argument passing to.

About making those 2 changes, that would be great. Without a correct description, lots of people will try it without success.

Thank you,

I did a few tests and found something strange.

To make multiple arguments to work, I have to set all "Contextual filters" -> "Path component" as 1.

Then, in ECA, "Arguments" has to be in this format [argument1]/[argument2]/[argument3]/[argument4]

If I put Arguments line by line in ECA as below:

[argument1]
[argument2]
[argument3]
[argument4]

Then, set all "Path component" to 1. OR set "Path component" to 1, 2, 3 and 4 to match arguments in ECA. The result show is incorrect.

From what I found, Token list in ECA is not completed. You maybe able to find more. In my case, with Views relationship, I can access another related entity using below token.

[entity:field_name_in_main_content:entity:field_name_in_entity_in_relationship]

Yes, I thought about that after post this question, and I actually working in Views which seem to work ok except I have problem with Contextual filters. What should I use there as a filter?

When I choose " Provide default value" -> "Content ID From URL". With multiple Filters, it works fine in Preview but it's not when I do it through ECA.

I'm wondering what should I use in Contextual filters?

Thank you,

Will this patch has a chance to get merged? Or should I continue looking for other method?

Thanks,

I think it works now. What I did is set it to use "Entity: Get Field Value" as mxh suggested. However, with Paragraph, it uses "id" in "Entity: Load", not "target_id" (Example in Multi value field loop is target_id)

Also test with "node" or without "node" and it didn't make a different for my use case.

Another problem I found was when I tested with "Token: Set Value", value inside the content was changed and that made everything not work the way it should when switched to "Entity: Get Field Value". I had to delete all paragraph contents and re-added all content to make it loop correctly.

Thank you,

Here is what I tried

1. Switch to "Entity: Create New" -> "Token: Set Value" -> GATEWAY. What I got is exactly the same as the original error.

2. Use "Entity: Get Field Value" ( Fieldname use Token [node:field_test_paragraph] )-> GATEWAY. This seems to work, no error but it's actually failed since the beginning with this log
Failed execution of Activity_0a5ez0r (Activity_0a5ez0r) from ECA Multi value field loop (TEST Paragraph) (clone) (process_e8yukm8) for event Drupal\eca_content\Event\ContentEntityPreSave: The provided field <div class="paragraph paragraph--type--test-paragraph paragraph--view-mode--default"> <div class="w3-row field field--name-field-paragraph-tet field--type-string-long field--label-above"> <label class="field__label">Paragraph Text</label> <div class="w3-bar-item field__item">Paragraph 01</div> </div> </div> , <div class="paragraph paragraph--type--test-paragraph paragraph--view-mode--default"> <div class="w3-row field field--name-field-paragraph-tet field--type-string-long field--label-above"> <label class="field__label">Paragraph Text</label> <div class="w3-bar-item field__item">Paragraph 02 - Test</div> </div> </div> does not exist as a property path on the paragraph entity having ID ..\n\n#0...............................

3. Use "Entity: Get Field Value" ( Fieldname use field_test_paragraph )-> GATEWAY. ECA stop after "Entity: Load" - with no entity available
Access denied to Load term (ID_LOAD_ITEM) from ECA Multi value field loop (TEST Paragraph) (clone) (process_e8yukm8) for event Drupal\eca_content\Event\ContentEntityPreSave: No entity available.

Should I keep trying or it's impossible for now?

Thank you,

Thank you for your explanation. The answer is clear and I will go to ECA in the node instead of Views.

Still trying to understand how ECA Views works. I think that with ECA Views, I can grab the result from Views into Token for me to work on it. But it looks like I misunderstand it.

For testing purpose, here is what I did :
1. Create a new content type with taxonomy.
2. Use Views to show the result I want.
3. Use ECA to display message of Token from "Views Execution Query"
4. What I got here is taxonomy target_id, not the text I saw with Views result.

Below is Token from ECA:

- nid: - value: '26767' uuid: - value: 898e1b37-4170-4ca6-93e9-7d641a91e81e vid: - value: '55281' langcode: - value: en type: - target_id: test_content revision_timestamp: - value: '1677766452' revision_uid: - target_id: '1' revision_log: - value: 'Updated the Title and Long Text fields' status: - value: '1' uid: - target_id: '1' title: - value: 'TEST TITLE' created: - value: '1677692028' changed: - value: '1677766452' promote: - value: '1' sticky: - value: '0' default_langcode: - value: '1' revision_default: - value: '1' revision_translation_affected: - value: '1' path: - langcode: en menu_link: { } field_long_text: - value: 'TEST LONG TEXT BODY' field_test_date: - value: '2023-03-15T04:11:11' field_test_taxonomy: - target_id: '407' - nid: - value: '26595' uuid: - value: 2a831eff-578a-4006-91b6-5c5128bccd78 vid: - value: '54976' langcode: - value: en type: - target_id: test_content revision_timestamp: - value: '1666284100' revision_uid: - target_id: '1' revision_log: - value: 'Updated the Value2 field' status: - value: '1' uid: - target_id: '1' title: - value: 'test 1' created: - value: '1666283961' changed: - value: '1666284100' promote: - value: '1' sticky: - value: '0' default_langcode: - value: '1' revision_default: - value: '1' revision_translation_affected: - value: '1' path: - langcode: en menu_link: { } field_long_text: { } field_test_date: { } field_test_taxonomy: { }

Below is what I see in Views:

TEST TITLE
TEST LONG TEXT BODY
Wed, 03/15/2023 - 11:11
Test Tag 1

If apply this into my original plan which is I need to get a data from a field inside Paragraph inside node content. The event will be about that node (Presave, I think.) With ECA Views, I will need more time to set it up since the data for that node is already in there.

If what I understand now is correct, then, what should I do to make this work?

I found that Time Field keep data in unix timestamp. So, in order to use Entity: set field value, I have to convert data into unix timestamp.

jurgenhaas, is there any different to set value between Form field: set default value and Entity: set field value (Set and clear previous value)?

With Build Form Event, I use Form field: set default value and it works with Time field without any problem. But with this approach, I use Entity: set field value but I can never be able to set time on that Time field. (Same field, Same Token setting.)

When I try to set time as 13:00 ( Tried using value from Fixed Value, Request: Get URL query parameter and [current-page:query:xxx] ) What I got is always 12:00:13AM. When set to 1:00 / 1:12, I got 12:00:01 AM.

Ok, this is my bad. The URL query should be in this format ?paidtime=1300&paiddate=2023-02-10 and once I did that, I can get each value from each parameter by using [current-page:query:xxx] or Request: Get URL query parameter

Thank you,

I'm sorry if I ask a lot but I have another question about Prefill item from URL. For now, after I use "Entity: create new.", I use action "Entity: set field value" to set each field value before I use "Entity: set field value" again to set this newly created paragraph attach to the main content. Everything seems to work fine with fixed value but if I want to use [current-page:query:xxx], this will not work.

I saw that you instruct me to use "Request: Get URL query parameter", how can I work with that? I have tested it with blank "Query parameter name" and set token as "pretime". URL query is "?paidtime=1300?paiddate=2023-02-10" When, I try to display message of token "pretime" below is what I got:

[pretime] display as paidtime: '1300?paiddate=2023-02-10'
[pretime:paidtime] display as 1300?paiddate=2023-02-10
[pretime:paiddate] display as [pretime:paiddate]

How can I make use of multiple parameter with this token?

I got a new paragraph add into an existing content with "Entity: set field value". However, the new paragraph is in collapse state. What should I do to make that new paragraph default to open for Edit?

Thank you,

Thank you for quick reply. However, the last part of your instruction is what I'm still trying to figure it out.

I omit the part "Request: Get URL query parameter" for now. I just want to click Edit the node and then, the new additional paragraph form in that node appear for me to fill in.

I tried "List: add entity" , "Render : Add Entity Form" but none of that work.

@jurgenhaas, I think that having field description will be very useful.

About debugging information, that should help too in case something goes wrong such as with less busy website using "Automated Cron"

A few days ago, I found that with CRON, the timezone has to be in UTC timezone. (Test with action to send me an email with time info when CRON run.)

If my server time is +8 hours from UTC and I want CRON to run around 8am., I have to set it to run at midnight.

Production build 0.69.0 2024