Stack Exchange - Drupal Answers
202 FOLLOWERS
Drupal Q&A is a question and answer site for Drupal developers and administrators.
Stack Exchange - Drupal Answers
2d ago
I'm trying to setup the Job Scheduler so that specific actions can be checked against cron every minute to allow for publishing content on a scheduled basis.
I'm working on part of an Acquia Cloud setup and whilst I've seen that there is documentation about setting up custom jobs, I don't want every cron activity to run, only the job_scheduler_cron, but I don't know how to write the script to only run that code
I've got Ultimate Cron ready to go into a new release but that would have to be rolled into all of the active sites, is there a way of writing a crontab job that only looks for the 'job ..read more
Stack Exchange - Drupal Answers
2d ago
I need to implement one of the following options, if possible: A) Make the BUY button only send an email or... B) When processing the cart items, only an email to be sent about the purchased items.
I don't need a real credit card purchase on the site, once we get the email we can process the items manually. This is for an organization that don't sell items but gives them away.
Any suggestion would be appreciated ..read more
Stack Exchange - Drupal Answers
2d ago
After a migration using the bibcite_migrate module, I retrieved my 2700+ references from a D7 site and the Bibliography module.
Unfortunately, HTML tags are visible on all abstracts and notes and they are not formatted.
I tried to manage the default display and table mode but I can only choose "Default" or "Trimmed" and the html tags are still visible.
When trying to display my references with Views, it's the same thing, I can't choose a text format that will decode the HTML tags (even with rewrite results and strip HTML tags options).
In the bibcite_reference table, all values contain HTML ta ..read more
Stack Exchange - Drupal Answers
2d ago
I would like to create a queue derivative, where I can use a single QueueWorker class to process multiple queues, but I am not able to achieve it. Any help would be greatly appreciated.
The module structure is the following.
queue_examples/
├── queue_examples.info.yml
├── queue_examples.routing.yml
└── src
├── Form
│ └── QueueDataImportForm.php
└── Plugin
├── Derivative
│ └── QueueDataProcessorDerivative.php
└── QueueWorker
└── QueueDataProcessor.php
The code I am using is the following.
QueueDataImportForm.php
namespace Drupal\queue_examp ..read more
Stack Exchange - Drupal Answers
2d ago
I'm looking for a way to redirect users to https://domain.com whether they type the www or not
I'm using a shared host for a drupal website so i don't have access to virtual host config files. A let's encrypt certificate if included with the hosting package
Right now the website can be accessed both with http and https depending on what you type in the browser.
In looking for a solution to force redirection to https i found this section in the in the .htaccess file that redirects users who type the www. to https://domain.com
# To redirect all users to access the site WITHOUT the 'www.' prefix ..read more
Stack Exchange - Drupal Answers
2d ago
I have a custom module (mymodule) with a settings form. This form contains a datetime field (mydate) which I want to save in my modules config.
When I try to save this form I get an exception:
Drupal\Core\Config\UnsupportedDataTypeConfigException: Invalid data type for config element mymodule.settings:mydate in Drupal\Core\Config\StorableConfigBase->validateValue() (line 160 of core/lib/Drupal/Core/Config/StorableConfigBase.php)
The form field:
$form['mydate'] = array(
'#type' => 'datetime',
'#title' => t('My date'),
'#default_value' => $config->get('mydate')
)
The for ..read more
Stack Exchange - Drupal Answers
4d ago
I have a system where a user can add a custom domain, for example *domain.com, in a text field. For example in node 10. This custom domain should, when entered in the browser, end up in showing the node where the custom domain is filled in.
I can get this partly working using a EventSubscriber but the problem is that when the url is filled in the url changes. So I go to domain.com and the url instantly changes to domain.com/node/10. Is there a way to do this differently so the url stays the same?
I am looking for a Drupal solution, not a htaccess solution. And one using a custom module or cust ..read more
Stack Exchange - Drupal Answers
4d ago
I have a view that loads node content through AJAX, based on some controls (radio buttons). Sometimes the content can have a webform in it (as entity reference), which is embedded through a paragraph. The webform shows up, but of course the webform libraries are not attached to the page and submissions either fail, or send me an ajax response in the browser.
Anyone knows how to fix this?
See related issue: https://www.drupal.org/project/drupal/issues/2934463 ..read more
Stack Exchange - Drupal Answers
4d ago
I have a problem with the image captcha when enabling Varnish on my website. Varnish is storing the error, so even when I enter the correct value for the image captcha test, it shows that the image captcha value is incorrect.
I tried changing the image captcha to a mathematical question, but the problem was not resolved ..read more
Stack Exchange - Drupal Answers
4d ago
I am using Drupal as a decoupled CMS with Entity Registration module, and would like to get the Registration Type form fields to display on my SPA.
I have enabled the REST resource:
/entity/entity_form_display/{entity_form_display}
I am making the GET request replacing entity_form_display with the ID of my Registration Type 'myform' showing in the URL here:
/admin/structure/registration-types/{type}/edit
Curl/ Postman URL:
http://mydomain.com/entity/entity_form_display/myform?_format=json
I get 404 Not Found:
"message": "The \"entity_form_display\" parameter was not converted for the path ..read more