πŸ‡ΊπŸ‡ΈUnited States @derekw

Account created on 18 January 2011, almost 14 years ago
#

Merge Requests

Recent comments

πŸ‡ΊπŸ‡ΈUnited States derekw

Did you add the library copy command to your composer.json? This was working for me until today, but no longer is doing the copy (on Pantheon).

See Bootstrap Libraries Load section.
Bario Bootstrap 5 Theme β†’

"scripts": {
        "pre-update-cmd": ["DrupalComposerManaged\\ComposerScripts::preUpdate"],        
        "post-update-cmd": [
            "@composer drupal:scaffold",
            "mkdir -p web/libraries/bootstrap",
            "cp -R vendor/twbs/bootstrap/dist web/libraries/bootstrap",
            "DrupalComposerManaged\\ComposerScripts::postUpdate"
        ]
    },

The files exist in vendor/twbs/bootstrap but they are not being copied to web/libraries/bootstrap, so they can't be found.

πŸ‡ΊπŸ‡ΈUnited States derekw

I'm using the "Updates to include all certs currently in the Authorize.net cert.pem" patch from commerceguys/authnet and everything is functioning properly.

I think @jphelan was correct that my Accept.js issue was a temporary outage.

πŸ‡ΊπŸ‡ΈUnited States derekw

My credit card checkout quit working today (10/24/2024) in line with the certificate change deadline: "Accept.js is not loaded correctly" above the card number field.

I cleared all website caches and now credit cards are accepted again.

πŸ‡ΊπŸ‡ΈUnited States derekw

I'm trying to implement a calculated field plugin of type entity_reference.

EntityReferenceItem defaults to referencing entities of type node, but I want to reference taxonomy_term entities with my plugin.

The only way I could find to change the target_type was by attaching my field as a base field, and using hook_entity_base_field_info_alter(). In the function below I am hard-coding the override to a specific entity type, but for versatility it could just loop through all fields looking for computed entity_reference field plugins.

Is this the correct way?


use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\TypedData\DataDefinition;

/**
 * 
 * Implements hook_entity_base_field_info_alter().
 * 
 * For computed entity reference field, override entity reference item definition
 * with settings from plugin getFieldDefinitionSettings()
 * 
 * @param ComputedFieldDefinition $fields
 * @param EntityTypeInterface $entity_type
 */
function my_module_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type){  
  if ($entity_type->id() == 'profile'){
    foreach($fields as $field_name=>$field){
      if ($field instanceof ComputedFieldDefinition 
        && $field->getType() == 'entity_reference'
        && $field_definition_settings = $field->getFieldValuePlugin()->getFieldDefinitionSettings()){     
          // Override field ItemDefinition with the settings from the plugin getFieldDefinitionSettings
          $fields[$field_name]->setItemDefinition(DataDefinition::createFromDataType('field_item:entity_reference')->setSettings($field_definition_settings));       
      }
    }              
  }
}
πŸ‡ΊπŸ‡ΈUnited States derekw

Some possible explanations:

  • All my ad block views have Use Ajax enabled.
  • Most of my ad block views are displayed using Slick Carousel.
  • Several of the views are cascading... if no ads match the first view criteria, the No Results action displays a different Ad Block.

I haven't looked at the impression logic yet but I'm guessing the above factors could be responsible for the placeholder not being replaced.

πŸ‡ΊπŸ‡ΈUnited States derekw

Had the same problem and switching to -dev resolved it for me.

πŸ‡ΊπŸ‡ΈUnited States derekw

Sorry, clearly I'm not qualified to create a proper merge request.

The subtheme libraries.yml will also need the change.

πŸ‡ΊπŸ‡ΈUnited States derekw

When the module is installed locally I get a 502 Bad Gateway error from my local nginx server.

The Nginx error log has:

upstream sent too big header while reading response header from upstream, client: 10.211.55.2, server: local.mydomain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "local.mydomain.com"

Does that help?

πŸ‡ΊπŸ‡ΈUnited States derekw

It seems like the problem is in how the queued track event item is getting created, because the parent id has the placeholder stuff in it instead of a uuid:

Queued item:

Array
(
    [ad_id] => 76612b3d-6072-4a15-83c8-8f6cd7793d88
    [bucket_id] => ad_content
    [values] => Array
        (
            [type] => click
            [parent_id] => AD_TRACK_IMPRESSION_ID_PLACEHOLDER) AND 2680=(SELECT UPPER(XMLType(CHR(60)||CHR(58)||CHR(113)||CHR(113)||CHR(120)||CHR(112)||CHR(113)||(SELECT (CASE WHEN (2680=2680) THEN 1 ELSE 0 END) FROM DUAL)||CHR(113)||CHR(107)||CHR(113)||CHR(106)||CHR(113)||CHR(62))) FROM DUAL) AND (9976=9976
            [ip_address] => 141.98.83.239
            [user_agent] => Mozilla/5.0 (Windows; U; Windows NT 6.1; pl; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
            [uuid] => b1aa751b-c7d0-4c25-841e-a5212dcf2976
            [user] => 0
            [ad_id] => 76612b3d-6072-4a15-83c8-8f6cd7793d88
            [session] => 
        )

)
πŸ‡ΊπŸ‡ΈUnited States derekw

This is on Pantheon so MariaDB is the DBMS.

the parent_id field is set to varchar(255) but the placeholder string is 276 long.

ad_track_event:

id bigint UNSIGNED Not Null
type varchar(255) Not Null
uuid varchar(128) Not Null
user
int UNSIGNED COMMENT ''The ID of the
target entity.''
created int
ad_id varchar(255)
ip_address varchar(255)
user_agent longtext
url longtext
page_title longtext
referrer longtext
page_view_id varchar(255)
session varchar(255)
parent_id varchar(255)
πŸ‡ΊπŸ‡ΈUnited States derekw

Seems like the GitHub url changed to include "5": https://github.com/codemirror/codemirror5/archive/refs/tags/5.65.13.zip

πŸ‡ΊπŸ‡ΈUnited States derekw

derekw β†’ created an issue.

πŸ‡ΊπŸ‡ΈUnited States derekw

derekw β†’ created an issue.

πŸ‡ΊπŸ‡ΈUnited States derekw

derekw β†’ created an issue.

πŸ‡ΊπŸ‡ΈUnited States derekw

That's very helpful to understand. I always know when I have to do a lot of workarounds that I'm probably just going about it the wrong way, kicking against the goads. (The price difference formatter for order line items also does not factor in coupons applied.)

To show the adjustments (including coupons) applied to a line item in the cart, it looks like "the way" is to create a commerce_adjustment field formatter to display the order item adjustments field, since it does not seem to have a formatter out of the box.

πŸ‡ΊπŸ‡ΈUnited States derekw

I've gotten >< this close to a solution.

I want to apply a coupon that takes $100 off every matching purchased variation... and see that reflected on the relevant cart line items.

I am using a rendered product variation view mode 'cart' to display selected attributes and the calculated price in the cart view.

So I took the suggestions in this issue:

1) Extended the commerce_order PriceCalculated formatter to add the current user's cart to the context.
2) used hook_field_formatter_info_alter to set the commerce_price_calculated class to my extended formatter.

3) Extended the PriceCalculator and changed added to the prepareOrder function to check for the cart in the context (set in the custom formatter), and use that rather than creating a fake one. (... but maybe I should just copy the coupons from the user's cart to the fake order.)

4) Used mymodule.services.yml to override commerce_order.price_calculator and set the class to my custom priceCalculator.

5) Extended the CouponRedeption views area to reload the page vs just updating the total price.

That got me pretty close, but the rendered product variation 'cart' view on the line items was not refreshing, although the unit price and totals for the line items in the cart were.

6) So I used hook_preprocess_commerce_product_variation and invalidated the cache tags for cart and summary view modes.

The coupon discounts are shown in the cart line item rendered variations along with promotions, etc.

But... when I check out and the order confirmation email rolls in... the line item total is right but the coupon discount is no longer shown in the rendered product variation (using the same summary view which works in the checkout and review pane).

So frustrating for something that seems like it should just work out of the box: Apply a coupon that affects specific product variations, and see that coupon reflected in the calculated price.

Production build 0.71.5 2024