New answers tagged

0

You can probably do this with some javascript on your home page. By default, the page would be your select your type form. This could be a manually created form that call JS to create a Cookie with the user's choice. This should be hidden by default. When a user comes to the site, if they do not have the cookie, show the form. If they have the cookie set, ...


0

I had this problem on a D7 project that I took over. I tried all of the following: update.php registry rebuild refreshing update status at /admin/reports/updates manually truncate cache_update None of them worked. In the end, this is what fixed it: I went into PHPMyAdmin opened up the system table Downloaded the BLOB from the 'system' module Manually ...


0

There is actually a Drupal module that gives you control over this. Its called Disable messages and can be found from the link below. https://www.drupal.org/project/disable_messages You need to enter a regex of the type of messages you need to hide in the configuration form.


1

I figured it out! Instead of just adding Category as a single field in the View and trying to figure out how to configure that to show each Category for a Thing row but only one Category header per group, I have the Category field on there twice - one that does not display multiple in one row (for the headers), and one that does display them all within one ...


0

I think it is PHP related. According to the Drupal 7 php requirements PHP 7.4 is not fully supported. If you are running on 7.4 perhaps try downgrading it to 7.3 and see if it makes a difference. This is probably the relevant issue that you encountered. Alternatively see if you can use the latest patch in there and post your findings so you can help move ...


0

I got it working. I've read the file "README.txt" and found that any product type can be a recurring product. Now I configured my existing product type to add the fields, required by recurring payment. So, now when I checkout, it does create a recurring entities for this order. Hope it will help someone.


0

All of that data is stored as variables, which you can access using variable_get. Depending on what information you specifically need, the following variable keys may of interest: restrict_ip_white_black_list restrict_ip_address_list restrict_ip_whitelist


0

I had the same problem, i solved implementing the hook_schema and hook_uninstall in this way /** * Implements hook_uninstall(). */ function my_module_uninstall() { drupal_static( 'my_module_uninstall', true ); } /** * Implements hook_schema(). */ function my_module_schema() { if( drupal_static( 'my_module_uninstall', false ) ){ return ...


0

There is another way for Drupal8. Try using the verf module


0

The solution that worked for me was to group results via php.


1

Have your POST code inside a validate function, that runs last, after all other validation has passed. Ex: $form['submit']['#validate'][] = 'mymodule_post_to_api'; and use form_set_error('form', 'Failed to connect to API, try again later'); inside your catch. For POST's errors, don't wait for someone to report. Programmatically make Drupal send yourself ...


0

Menu items are nested using the item path. Take look to the paragraphs module: /** * Implements hook_menu(). */ function paragraphs_menu() { $items = array(); $items['admin/structure/paragraphs'] = array( 'title' => 'Paragraph Bundles', 'description' => 'Manage Paragraph bundles', 'page callback' => '...


1

In /admin/people/permissions Under "Node" category you can uncheck the permission "Edit content X" for your desired role. I would recommend using this module if your site has a lot of modules/permissions since due max upload vars limitation by PHP could led to not storing your chages when submitting the form. Also by code you can implement ...


0

This solution is working on Drupal >= 8 function YOURMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) { if ($form['#id'] == 'views-exposed-form-my-view-display') { $request = \Drupal::request(); if (is_null($request->get('EXPOSED_FILTER_FIELD_MACHINE_NAME'))) { $form_state->setUserInput(['...


0

While attributes are certainly one way of handling variations, (and generally the recommended way) If you want to step into the current way that the big-boys are handling variations which takes you to a different product page when selected, you can easily create variations with Paragraphs, Entity Reference and Views. The one downside is that you have to ...


0

Solved. It was the timeout of the proxy connection to PHP-FPM. It involves going down a rabbit-hole of Apache values and defaults so strap in. As per ProxyPass the proxy default of connectiontimeout is timeout. The default value of timeout is ProxyTimeout The default of ProxyTimeout is the core Apache TimeOut The default of TimeOut is 60. So there you go....


0

Add a MYMODULE.install file to your module. In there implement hook_update_N to flush all caches. When others update your module, and then do database updates, Drupal will pick up this hook and flushes the cache and your new files will be recognized. /** * Pick up new files. */ function MYMODULE_update_7100(&$sandbox) { drupal_flush_all_caches(); }


0

This took me so long to find. Account Settings -> Manage Display admin/config/people/accounts/display/teaser


2

You should use hook_node_presave if you want to change a field's value as the hook is invoked from node_save() before the node is saved to the database. And as leymannx stated, make sure you clear the cache before implementing a new hook.


0

Based on of the @Colan solution. Add the following Patch to your composer.json file "extra": { "patches": { "drupal/core": { "View Entity Reference Field" : "https://www.drupal.org/files/issues/2019-12-24/drupal-generalize-taxonomyindextid-filter-2429699-277.patch" } } } then run composer install and Rebuild the cache.


0

When you are absolutely sure there is no custom code in the feature module you can safely recreate the feature by going to /admin/structure/features and then change permissions and/or disable modules such as the Overlay module that are declared as a dependency in the feature. You can recreate the feature and remove the unwanted components: Go to /admin/...


1

The problem was that the Body field was not added to the DrupalGap Display Mode for the content type: By default, there are no fields displayed using the DrupalGap Display Mode. We need to specifiy which fields, labels and formats will be used when our nodes are displayed in the mobile app. Do this for each content type.


0

I used this code and it solved my problem. // Bind table rows that will open ctools modals to the appropriate function. $('tr.ctools-use-modal', context).once('ctools-use-modal', function() { var $this = $(this); $this.click(Drupal.CTools.Modal.clickAjaxLink); // Create a drupal ajax object var element_settings = {}; ...


0

There aren't many good solutions here, because you're hitting up against the limitations of the pricing system. You have two basic options: custom line item fields that contain special pricing paired with a pricing rule that overrides the default product price or some combination of discounts that adjust product prices solely for that user. The former may be ...


0

Wow -3 rating? This was intended to be an authentic question. Not ideal, but my solution was to render a static link in the View's footer: // Render "more" link in footer $footer_options = array( 'label' => t('Footer text'), // Administrative label. 'content' => '<a href="/link/to/display">View All Events</a>', // Content ...


1

In Drupal 8, you can do one of the following. These are in order from more recommended to less recommended: Apply the latest core patch from Generalize TaxonomyIndexTid filter to be available for all entity reference fields (unless it's been committed by the time you're reading this), Use the Entity Reference Exposed Filters module, or Follow the ...


0

Please use below code for update existing field collection data //$item_id load item id from your node //enter_update_field_mechine_name replace with your field name $field_collection_value = field_collection_item_load($item_id); $field_collection_value->enter_update_field_mechine_name['und'][0]['value'] = 'update text here'; $...


2

Recreate allows you to re download the feature, including any changes made to config along with the option to add new config.


0

Create a Page in Page Manager where you use an HTTP response code and disable all form elements on that page. Give your path a (random) name. Set the Response code of the Page to: 404 Page not found. Create a rule with Rules that: fires if a hidden field on your form is filled out OR if the email address has a certain TLD e.g. ".site" removes all ...


0

There are some methods provided in the ajax library of core docroot/core/misc/ajax.es6.js to allow you to add the loading message/icon to the your page. Drupal.theme.ajaxProgressThrobber Drupal.theme.ajaxProgressIndicatorFullscreen Drupal.theme.ajaxProgressMessage Simply call them like $('body').after(Drupal.theme....


1

Few points about Drupal 7. 15 content types / up to 80 fields should not cause performance issues, although (as per previous answer) it can be bad project architecture: fields or views. More likely, setup (database configuration, server configurations , or caching) is the cause. To find the cause I would recommend to connect profiling tool like blackfire.io ...


0

I recommend to use a plugin for this. Full tutorial here: Create a menu link with html markup in drupal 8 namespace Drupal\MYMODULE\Plugin\Menu; use Drupal\Core\Menu\MenuLinkDefault; /** * A menu link that displays number of points. */ class MyMessagesMenuLink extends MenuLinkDefault { /** * {@inheritdoc} */ public function getTitle() { $...


0

I'm the OP: This is not a full answer, but a fix: Forcing the session to start with $_SESSION['something'] = 1; in the form build seems to cure this problem. If you can provide better answers please do.


1

I am thinking of multisite / multidb only because of the performance issues If that is the case, then only people who have very detailed information about your site and your organization can answer your question. It boils down to comparing the resources necessary to identify and fix the performance issues, to the increased/increasing long-term resources ...


0

If you are seeing the message Unresolved dependency. Google Analytics (Version !=7.x-2.4 required) when you have Google Analytics 7.x-2.6 installed, then almost certainly you have a duplicate copy of the Google Analytics module somewhere under your web root. That is not allowed in Drupal. When Drupal scans the file system looking for modules it will find ...


0

I was experiencing this bug only when indexing. Which was making me think it's due to misconfiguration. Drupal\search_api\SearchApiException while trying to index items on index main: Solr endpoint https://mysite:443/solr/main/ unreachable It turns out, this error can happen when it actually has reached the server, but you try to do something that ...


0

In Solr Host field, you can try entering value: 127.0.0.1 and for Solr path you can leave it empty.


0

So this is what I did, in case anyone wants to accomplish the something similar. You first have to add a new region just above the content region in your MY_THEME.info file which in my case was: regions[manufacturer_prefix_title] = Manufacturer Prefix Title Then I overwrote the page.tpl.php which contained: <?php if ($title): ?> <h1>&...


0

'array('value' => ':input[name="confirm_password"]') This means the value equals the literal string ":input[name="confirm_password"]". As far as I know, #states can't check if the value of two fields are the same. I can do this with JavaScript, potentially, but then the JavaScript code would managing some states and the PHP code would manage other ...


0

Thanks both Jdrupal and gillarf above. I did something different here, but i used both of your logic. First, i created a custom module and then i used hook_menu() function. In this hook_menu, i used a link and if i call that link then page callback function will execute. In page callback function, i used dbquery to get the data from the DB and based on my ...


0

Have a look at Barracuda Octopus Aegir = BOA. It is an open-source install tool that converts a naked server into a GUI for mass creation of Drupal sites. It supports both Drupal 7 and 8. For Composer-based Drupal 8, you'll have to remove Drush 9 or 10 from composer.json's require section. You'll find the install steps here: https://github.com/omega8cc/boa/...


Top 50 recent answers are included