Hot answers tagged

4

loadByProperties() executes an entity query with ->condition() for each property. You can't use this for empty fields, you need $query->notExists('field_example'); according to How get empty record on date field with entityQuery?


3

From WidgetBase::form: // Most widgets need their internal structure preserved in submitted values. $elements += ['#tree' => TRUE]; When customizing the structure you also need to make sure the values get submitted correctly. For example by adding WidgetInterface::massageFormValues to your widget. A much easier way though is to keep the standard ...


2

Use the commerce_shipping module ;) Just create one "free" shipping method .. or one or more regarding your needs. Also make sure to use the shipping checkout flow for your order type! It's fully integrated with commerce_paypal and you even can configure how paypal shall treat the two addresses in regards of collection and updating data entered @...


2

You have to authenticate the user. This is what a normal Drupal request would do as one of the first things after the kernel is booted: Drupal\Core\EventSubscriber\AuthenticationSubscriber /** * Authenticates user on request. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * The request event. * * @see \Drupal\...


1

The two main ways to approach this with php are via hook or plugin. The first is with a hook, specifically, hook_migrate_MIGRATION_ID_prepare_row(). Allows adding data to a row for a migration with the specified ID. For example, you could combine your two link columns to a new column formatted as an array. function ...


1

I was able to get the current running prod version converted to use composer with out an issue. If you have converted your site to use composer , you dont need to copy the whole code base into the new server. Just copy the config,custom modules, composer.json, composer lock files and other reqired files except the core, vendor and contributed modules into ...


1

You can use the D8 config factory interface to retrieve multiple contact form config keys and their corresponding config entities: $contact_form_keys = \Drupal::configFactory()->listAll('contact.form'); $contact_form_configs = \Drupal::configFactory()->:loadMultiple($contact_form_keys);


1

This import is empty This error might occurs when the config directory is not configured in the settings.php. Check for the config directory settings in new site. It will mostly have a different directory configured. Change to the same folder path as in the old site.


1

It's not mixing up public/private directories; the File system report row on the Status report page is conveying multiple bits of information: Your default download method ("Writable...") Any other issues found with your file system config. In this case, permissions on the private directory. Regarding the permission issue, you'll need to check ...


1

Yes - just create a new (custom, standard) payment method named Invoice, and user's then can select that. On the payment method edit form you can add more details, and even could limit the availability of the method. Rules are not actively supported as in D7: https://www.drupal.org/node/1535554 But I do not see a need using rules with your use-case. You need ...


1

The code that looks for the API key is in ApiKeyAuth::getKey(). public function getKey(Request $request) { $form_api_key = $request->get('api_key'); if (!empty($form_api_key)) { return $form_api_key; } $query_api_key = $request->query->get('api_key'); if (!empty($form_api_key)) { return $query_api_key; } $...


Only top voted, non community-wiki answers of a minimum length are eligible