texts:
I am creating nodes programatically based on the feed from an external api. I have managed to create all nodes, assign field values and also set the created date. Now my problem is that I also need to set the changed date of each node to match the value returned from the feed. I have tried to set this value before saving the node without any success:

// $data contains the release information used to create and populate the node
$node = new stdClass();
$node->title = $data->Release->Title;
$node->type = 'release';
node_object_prepare($node);
$node->status = NODE_PUBLISHED;
$node->uid = 1;
$node->language = LANGUAGE_NONE;

// handle any field data - not really important
handleFields($node, $data);

// submit the node
$node = node_submit($node);

$node->created = strtotime($data->Release->PublishDate);
// here I'm trying to set the changed value for the node
$node->changed = strtotime($data->Release->LastChangeDate);

// finally save the node
node_save($node);

Would be nice if anyone have a solution to this problem. Perhaps I can make a raw query against the database in order to update the changed date of the node?
The reason I need to set this value is because later on it will be used to compare against the modification date of a release in the feed so I can decide if the node needs to be updated or not. I know I could use a custom field for this purpose, storing the releases modification time and then compare against this value instead of the changed column in the node table.


texts: Is a content type needed by a custom module?

texts:
I want to write a custom module for my drupal website to get some information from users and process them. because my form fields are complex so I have decided to write my own module to generate form instead of default add content in drupal.

Should I have create a content type for storing data or I can create my data structure for storing data ?


texts: How to override  ad_adapi() in custom module

texts:
Currently, in my custom module that depends from the Advertisement module, I have permissions case, and I want to add statics_increament in my custom module.

How can I override ad_adapi()?


texts: How to track site search with using Google Analytics without installing additional modules?

texts:
I need to enable the tracking of site searches in Drupal 7 using Google Analytics without installing the additional "google_analytics" module.

So far, I find some info (some previous question in this site, in example) about performing this task using that module, I just want to know if I can do that without it?

(Edited to add.) I found some info regading the "query parameter" to set in the GA site. I found it is recommended (http://www.wesjones.net/home/2010/11/track-drupal-site-search-in-google-analytics) to use "search" as query parameter, but I was thinking that the parameters would be something like "search/node" and "search/user". Any ideas D7-related?

(Edited to add.) I select the first reply as it effectively solves my initial question. Later I added a second one but it is kind of a different one. And maybe it is valuable to not mix things up.


texts: Is there a way to add [user:validate-url] link to a Simplenews newsletter on a drupal7 site?

texts:
I want to send a newsletter only to the users that haven't activated their accounts and persuade them to activate their accounts.
Is there a way to personalize the link they need to click and give everyone this link [user:validate-url] that sends each user at their account activation page?


texts:
I am trying to create a menu with a file extension in hook_menu() with the following code:

$items['pdf/products/%.pdf'] = array(
    'title' => 'Download PDF',
    'page callback' => '_pdf_get',
    'page arguments' => array(2),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK
);

It works fine without the .pdf.

Any ideas how I can do this?


texts: How do I create a view that displays the author information of the current node being viewed?

texts: I need to show a view in the sidebar that shows information about the current node's author (Username, picture, email). How do I go about doing this?


texts:
How to track user activity to find the user behind the field deletion.

As an admin, I want to track user activity so that I can find the user who deletes the field from particular content type.

I have tried with following modules but there is no option to track field.

Entity delete log.
track field changes.
Message and rule.


texts:
I am trying to create a menu link in Drupal 8. I am following this document: https://api.drupal.org/api/drupal/core!includes!menu.inc/group/menu/8

My module name is twitter_pull and I was able to create the path fine, and it loads a form on that page, I just can't get it display a menu link. I have tried flushing the caches but that didn't do anything.
Here is my code:

Inside my twitter_pull.routing.yml

twitter_pull.settings:
  path: 'admin/config/services/twitter-settings'
  defaults:
    _form: '\Drupal\twitter_pull\Form\TwitterSettingsForm'
  requirements:
    _permission: 'administer site configuration'

Inside my twitter_pull.links.menu.yml

twitter_pull.settings:
  title: 'Twitter settings'
  description: 'Twitter settings for your site'
  parent: system.admin_config_services
  route_name: twitter_pull.settings
  weight: 100
  #Use menu_name when you want to add your link to a non-system menu.
  #menu_name: devel


texts: How can I print something conditionally on node.tpl.php depending on what taxonomy term the node is tagged with?

texts: For example, I would like to print something only when the currently viewed node is tagged with tid = 100. How can I do this?


texts: Changing the title of the Answers add answer form

texts:
I want to change "Your answer" in the add answer form of the Answers module so that it says "Give [user who asked question] your answer".

Here is a snippet of code from answers.module that defines the value

// Add the form to the question page.
        $node->content['new_answer_form'] = $answer_form;
        $node->content['new_answer_form']['#weight'] = 150;
        $node->content['new_answer_form']['new_answer_form_title'] = array(
          '#theme' => 'html_tag',
          '#tag' => 'h2',
          '#attributes' => array('class' => 'new-answer-form-title'),
          '#value' => t('Your answer'),
          '#weight' => -100,
        );

I tried changing it to:

// Add the form to the question page.
        $node->content['new_answer_form'] = $answer_form;
        $node->content['new_answer_form']['#weight'] = 150;
        $node->content['new_answer_form']['new_answer_form_title'] = array(
          '#theme' => 'html_tag',
          '#tag' => 'h2',
          '#attributes' => array('class' => 'new-answer-form-title'),
          '#value' => t('Give ', $author, 'your answer'),
          '#weight' => -100,
        );

Not surprisingly, this didn't work. I'm not sure which variable to use for $author, and other changes, so that the username of the person who asked the question appears there.

Disclaimer: I apologize if the question is off, I work for a non-profit organization that isn't a tech company and am just trying to build us a new website but have a gluten for punishment and an interest in getting back in to the tech field. Thanks for your patience.

Edit: I created a helper module for customizations to other modules.


texts: REST export with no data over it's localhost IP

texts:
I have a REST export which provides data with a call (curl or browser) to the Drupal URL(s). But we need to get these data over a curl to vhosts IP-Address and from this address, which is 192.168.34.11.

curl http://drupal.url/view.json from every other device and curl http://192.168.34.11/view.json from others in the same NAT works.

curl http://192.168.34.11/view.json local from 192.168.34.11 does not work. In this case I only get []

There are no access or permission restrictions set in the view.
We use the https://www.drupal.org/project/domain module and I have configured a domain 192.168.34.11.

Why isn't the view accessible over it's localhost IP address?


texts: How to programatically create an address field

texts:
I would like to use the address field module in my module.  How do I create an address field and an instance for that field.  I haven't found any code in the module that defines what the array structure should look like.

I found this code in the commerce module (under modules/customer/commerce_customer.module):

if (empty($field)) {
  $field = array(
    'field_name' => $field_name,
    'type' => 'addressfield',
    'cardinality' => 1,
    'entity_types' => array('commerce_customer_profile'),
    'translatable' => FALSE,
  );

  $field = field_create_field($field);
}

if (empty($instance)) {
  $instance = array(
    'field_name' => $field_name,
    'entity_type' => 'commerce_customer_profile',
    'bundle' => $profile_type['type'],
    'label' => t('Address'),
    'required' => TRUE,
    'widget' => array(
      'type' => 'addressfield_standard',
      'weight' => -10,
      'settings' => array(
        'format_handlers' => array('address', 'name-oneline'),
      ),
    ),
    'display' => array(),
  );

I can modify that to meet my needs, if someone is familiar with this module and could point out some attributes that may be missing, I'll accept their response as an answer to this question.

Update The address that I'm importing may contain up to 6 lines for the street address (all for one location) as defined by RETS.  Is it possible to store a street address this long in an address field?  If not I can concatenate the extra addresses into the second address line.


texts: How can i display tokens with html tags?

texts:
On assigning tokens(both custom and exisiting tokens) with values like

$replacements[$original] = "Hello";

and then using that token either in full html or any other text format(all the text formats) it displays on the screen Hello i.e actual tags are being rendered instead of Hello . Same is happening with other html tags i.e entire

 all the html tags get display.
This although does not happen in Drupal 7.

Is there any configuration i am missing? How to render html values properly using tokens?


texts: Restrict a users node posting total dependent on a paid subscription role

texts:
I am interested in how one would restrict a users node posting total dependent on a paid subscription role.

For example, there maybe 3 subscription roles which allow different Node posting for a user dependent on which Role they have chosen on site registration. Using UberCart for example, 3 packages (Low, Mid, High) offer 10,25, 50 respectively to a user. The total posting per month cannot exceed that amount at anyone time in that they can either add/edit/delete an applicable Node (only of their own posting), but not exceed that subscription's total given amount for that role. I would be interested in the best easiest and best approach to this using Rules/Views/UberCart framework. Or possibly knock up a custom table in the backend to tally up the number of said posts per user if that need be the case.

Alternatively, the restriction or limitation of Node  content 'viewing' per subscription role. ie Pay to read more of the said Node content. Which appears nowadays to be an emerging trend for online content access as I see it.

Any comments and ideas greatly appreciated for a learning developer.


texts: How do I set the page title from view result (same as the view result)

texts:
I have set up a View that shows a random page from the site filtered according to node types and uses the Global : Random (asc) sort criteria. It displays only one result per page and a fresh page is shown every time the page is refreshed.

I want to set the view's page title to be same as the node displayed. I am doing this using javascript right now, but would prefer a PHP alternative that I could either use in the template or the views setting directly.

Setting the page title using javascript isn't SEO friendly.

I am using the latest version of Drupal 6 with the latest stable release of Views 3.

The results of print_r($view->result, true) (as requested) are :

Array
(
    [0] => stdClass Object
        (
            [_random] => 0.00171253550957193
            [radioactivity_node_1_s_energy] => 3
            [node_title] => <Title of the node being displayed>
            [nid] => 393
        )

)


texts: Create a content node from another content

texts:
I'm wondering how to create a content from another content. I'll give an example, it will be easier to understand :

We have a content-type "Planning" which has three fields : 2 user references and one date, which can be multiple filled (let's say the dates are appointments). So in result, a planning will link 2 users and this node will display all the dates these 2 are supposed to meet.

Also, we have another content-type "Appointment".

I'd like that after the creation of the Planning, the appointments get automatically created, always linking the 2users.

First, I've looked into the module Flexi-Field but it doesn't create the node. Then I thought about Rules but I don't know how to create the multiple nodes Appointments due to the multiple date fields.

I know I could do it with Rules through a PHP custom code, but if there's any easier solution, I'd like to hear about them :-)

Thanks for any suggestion !

Cheers all !


texts: How to remove the "Save" button from checkout cart summary form?

texts:
On the first checkout page (checkout/xx/checkout), there is a view which displays line items for the order.  The view appears to be named "Shopping cart summary (Commerce Order)"

When I add the standard Delete button to the view (for deleting line items), it causes a Save button to appear below the line items.

How do I remove that Save button?

Update:

I tried a form-specific hook_form_alter(), but didn't find the Save button in the $form array. It appears to be a form embedded in another form.  Reading answer from @Yogesh made me realize that maybe I had the wrong $form_id and can debug with a general hook_form_alter() and look for a nested call for the embedded form.


texts: Im currently using drupal 7 + commerce for online sales and I have a phonegap app that creates orders. I want to use drupal 7 via a the services module to sync the app sales data with the online store. My concern is speed as drupal requires a full bootstrap for each service call. Is there another recomended way to access the drupal 7 commerce database directly that would perform the crud operations faster?


texts: multisite creation and content sharing per role bases - Drupal Multisite

texts:
I am building on one Drupal project where we have 1 main site and n number of sub-sites. The requirements are as follows per role base:

Super Admin

Can create a n number of sub sites from main site front-end (a.foo.com, b.foo.com). We have wildcard entry for foo.com
Can administer any sub-site created from main site.
Can create content and can choose under which sub-site it will be available.
Can create menus and can choose under which sub-site it will be available.
Can create users (admin/editor/approver) for sub-sites.
Should be able to set permission for the users (admin/editor/approver). For example add/remove/edit global navigation within the boundaries that the OEM Super Admin set for the site theme

Sub-Site Admin

Modify content and blocks only for his sub site.
Modify theme, create new theme.
Configure google analytics and other social media plugins.

Issue

Which module to choose Domain Access, Sites, Spaces, Organic Group?
Solution for both Drupal 6 & Drupal 7


texts: User login REST POST returns HTML format

texts:
I want to login to drupal through JSON,
I read this issue, but non of the proposed solutions helped me do that using Postman on drupal 8.2.5.
specially when I send this specification :

POST: http://example.com/user/login?_format=json
Content-type: application/json
Data: { "name": "admin", "pass": "myPassword" }

Response is: 200 OK,

But the result is in HTML foramt and just shows the login page of drupal website!


texts: How to display 'new' by unread forum posts (like drupal.org)?

texts:
If I go to my drupal tracking page while logged in I can see a red 'new' by forum posts that have changed since ive visited them. How can I add this functionally? I need to be able to do this without the advanced forum module.

This is the page but you wont see the red 'new' as your not logged in as me. See the attached image to see what I see. Thanks
http://drupal.org/user/643368/track


texts:
Sometimes for testing purpose we need to delete a lot of nodes of a given content type, in this case the use of the web interface (YOUR_SITE/admin/content) is not the best option.

How to delete all nodes of a given content type programmatically?


texts: What's a good balance between reusing fields versus creating new ones in the context of fields scalability?

texts:
I've read the following phrase on a website:

  Instead of adding new fields to a content type, adding existing fields is a better option to reduce the system’s complexity and to improve scalability.

And some doubts arise.

In the system we are developing, we have the possibility to reuse a field across 3 or 4 content types but instead of improving scalability as the quoted phrase says, I'm afraid it will diminish it, because the field's table would faster become a bottleneck (at least that's my reasoning in this case, as all values of that field together, would be a couple millions per year and that would make the table too big). Do you agree?

How many rows would be a sensible maximum to aim for when architecting? That way we could decide when to reuse fields and when to create new ones (even though the chance to reuse is there).


texts: Accessing a FieldItemList value within Twig

texts:
I've tried several different ways to try access the value of a field item list value without success.

The item in question within Drupal 8 is a float text field and I need the unmodified number from this. The value gained from the standard content.field_latitude[0]['#markup'] call is rounded in some manner so I want to grab the one located in the #items object as shown in the screen shot below.

I can get this via a preprocessor in the theme file but want to avoid using a preprocess if I can and want to gain access directly in the twig file.


texts: LoginToBoggan + Don't use set password mail

texts:
I would like to give my user the opportunity to register and login with username AND email.

Therefore I installed the module LoginToBoggan where you can enable that users can login using their e-mail address.

When you want users to set their password at registration you need to check the checkbox Set password. But when you do this you also get a mail to set your password (can only be used once).

But I don't want that. I just want them to register with email/username and directly login in without getting ANY email. I fire a rule to send a mail after I created an invoice so I don't want the drupal account emails.

But I didn't found out how I can simply do this?


texts: Update a single field when saving an entity

texts:
Question: How do I update a single field of an entity? For example, lets say I have a user and want to update field_my_field. How do I just update that without using user_save?

My Specific Problem:
I have a a bunch of user fields defined, and am trying to optimize the performance of my site. I am using views_bulk_operations, and my code is timing out (maximum execution time) because I am repeatedly calling user_save, and it's an expensive operation.

I am only updating a single field, and would like to optimize this code. Rather than calling user_save, which is taking 500ms to run, I'd like to update the field directly.

I attempted to use field_attach_update(), and that works a little better, but that's also updating all the fields. Is there any specific way just to update or save a specific field for an entity?

I'm not interested in batch operations, or anything at the moment -- I know how to do that, and can convert this into a batch so I don't run into execution timeouts. I just want to know how to save a single field for an entity.


texts:
Is there a module that provides an empty entity, to which I can add my own fields. I guess it would include just an Entity-ID as a primary field, and work with other entity modules.

For me, nodes have too much baggage included: title, nid, vid, publishing options, author and date.


texts: How to set percent discount by old and new price

texts:
I have commerce-product, add new field old price and percent discount

Then i create new rule


texts: how to theme nodes in views results if logged in user equals node author

texts: I have a D7 site with search_api module, I'd like to change border color of nodes in views results if logged in user equals node author, in plain English, make easy to logged in users identify its own content in views results.


texts: Disable client- or proxy-side caching on anonymous pages (Cache-Control header), without disabling server-side caching?

texts:
My CDN seems to cache the /user page, which means I can't access my account page after logging in. I could add it to cacheexclude's uncached list, but that would make PHP run for every bot that hits my server.

What could I do so that Drupal serves the /user page with "Cache-Control: no-cache", or something targeted at proxies (CDN), for anonymous users?


texts: How can I set the template to use for a view page display?

texts:
I created a view for my content, where fields are displayed as a page.
Scanning the source code, I noticed it uses the html--default--2.html.twig template.

I created a new custom template. how can I set that template for all the view pages, instead of the default template? I need to edit the whole page, including header and footer.

Notice that I've read this and this about custom templates for view.
I've tried to rename my custom template views-view--page.html.twig, and put it in my template folder, and also in /core/modules/views/templates, flushed cache, but nothing happens. My view page is still using the default template.


texts: According to http://drupal.org/node/252241 a revision author token may be available. However I do not see anything referencing revision:author (variation?) in my list of available tokens. Is there something like this?


texts: Contextual filter with multiple entity reference fields

texts:
Troubles with displaying content in a sidebar block with a View.
Actually, the website is in Dutch, so I'll replace the names of Content Types with something easier, like A, B, C, D.

I have 4 entity types: A, B, C, and D. These are articles referencing each other. So, a node for entity type A on the screen, has additional relevant information in B, C, and D.
While the node from entity type A is on the screen, I want to display the links to the different nodes in B, C and D in a sidebar block.

So in each entity type, I have Entity Reference fields, for example a node from type A has fields  refB and refC and refD.

All working fine, with the links being correctly displayed within the node display, and I can jump between content from each entity type using the Entity Reference fields.

So, for the sidebar block, I created a  View that contains the refB and refC and refD fields, and added a relationship (just for refB initially, to reference the content in entity type B), and a contextual filter on the Nid, getting the value from "Entity from URL".

Nothing gets displayed in the block however.
When I remove the contextual filter, all possible values for the entity reference fields are displayed.  So either I'm getting everything or nothing, but not the relevant entity reference fields from the node in entity type A only.

Articles on this subject explain the Relations and Contextual Filter configuration, but can't get it right apparently.


texts: Manage display not updating user account display

texts:
This is a new D7.14 site started only 3 days ago. There is no use of organic groups in this site. I added several fields (i.e. First Name, Last Name, City, State, Zip - as text and list fields). I set these to show on user registration form and to display publicly. I came back about a day later and changed the display settings on User Account to hide the labels and to change the display order. I also hid one of the fields completely on User Account. I opened a new browser and navigated to the user account for a random user - the labels still appear and the order has not been updated. I cleared cache - no difference. I ran cron - no difference. I subsequently updated a few modules and had to run update.php - no difference.

Any suggestions?


texts: Remove one of the two "Apply to selected items" submit buttons with Node Bulk Operations

texts:
If you make a view and add the Node operations bulk form, two "Apply to selected items" boxes are automatically generated like this:

How do I get rid of one of these?
I turned on twig debugging, but the template that is outputting the button is core/modules/system/templates/container.html.twig, which is not something that I can easily customize to remove one of the buttons.
How I created the view:

Create a new view of content showing fields.
Add Node operations bulk form under Fields.
Save the view.


texts: Node Langauge needs to be undefinde by default

texts:
my website (Drupal 7) is available in German (?q=de) and English (?q=en) (i18n Module). Users can create own pins (nodes) (similar to pinterest). The default language of the website is set to german. So everytime somebody creates a new pin (node) the language of the pin is set to german.

The problem is, if somebody is using the english (?q=en) version and clicks on a pin he gets redirected to the german version (?q=de).

I can manually set the language of each pin to undefined. Then everybody stays on the right version, but this would be to much work to do, to change the language of each pin all the time.

I can't let the users chose the Language, because every pin needs to be set to undefinded.

How can I achive, that with every new pin the language is set to undefined automatically?


texts: $node-date field changes to array on submit

texts:
Drupal 7, I have a simple custom content type. When I edit the node and set a breakpoint in node_form_submit(), the $node->date field is getting changed from a timestamp string to an array, with members date and time. This results in these warnings:

  Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in node_form()

and

  Warning: strtotime() expects parameter 1 to be string, array given in node_submit()

I've spent some tine with a debugger trying to find out where the date field is getting changed, but can't find it. This isn't happening to any of my other content types.


texts: Different ways of logging in a user without having them to type anything?

texts:
I'm on Drupal 8 and currently looking to replicate similar functionality like: https://www.drupal.org/project/urllogin -- They do not have a D8 version yet.

I need to auto login a specific user depending on which URL the user visits. How can this be done on D8? I was thinking of using rules, but there doesnt seem to be an action for "login a user" if Path alias equals X.

Another possible scenario I could just do is create a custom module to auto login a user. Which functions would I need to fire in Drupal 8 to do this?


texts: Calling a JS function after managed file has completed uploading

texts: How can I call a JavaScript function after a file has completed uploading using the Drupal Form API (FAPI) managed_file element?


texts: How can I get a summary from a view into another view?

texts:
There are a few views that gather and analyze data from several nodes to form a budget based on their workflow. These views have a "total" area (defined as a custom content field within the view), which calculates the the total amount of money allocated by each node.

Each node is also associated with a team object, and what I want to accomplish is to get the "total" field from each view to act as a column in another view, so we can see how much money was allocated/spent with each team.

Essentially, what I'm trying to do looks more or less like this:

Team Number | View 1 Total | View 2 Total | View 3 Total | Total of the Totals
1           |          $33 |         $-10 |         $-20 |                  $3
2           |          $50 |         $-15 |         $-10 |                 $25

I've looked into trying views-field-view, but I haven't been able to find an option that allows me to select that specific row, which is created with a summarized table as the format. This is the same across all three views. How would I go about achieving this, with either views-field-view or another module? Or should I just go ahead and do this with a panel using custom PHP code?


texts:
I have a template name page--catalogue.tpl.php, I need to add style sheet only for this template. Below is my snippet in my html.tpl.php which only adds class to a particular node whereas I need to add to a whole template. Is there any way?

<?php
if (strtolower ($_GET['q']) == "node/287")
{
?>
<link rel="stylesheet" type="text/css" href="sites/default/files/engine1/style.css" />
<?php
}
?>


texts: How to deal with too much product variations / attributes?

texts:
I'm quite new to Drupal Commerce, but I've seen some Drupal before (not actually a guru).

Dealing now with handmade models, each product has 9 sizes, 6 colors, 6 materials. They have now about 130 models. I started dealing with it creating a product per variation (commerce_bpc). But 300+ variations per product display became a little unbearable, because it was intended for a local shop and they should be able to create new models and edit old ones a little bit faster.

We decided to make the products just size dependant (price changes only according to size, and there would be no special images for colors and materials).

So, my first approach was to use the image as a product display field. But:

What about the attributes? Is the correct way to use material and color as select list in the Display, too? Will I be able to use them later in the checkout and the orders?
Or should I stick to 1 product per variation and handle them in some other way? I think that's the NATURAL way, but it just feels like overkilling.

Also, any insight on how to handle a large list of products (edit, bulk actions, add them to display, etc..)?


texts: Node theming through Views or tpl.php files - which one is better for performance?

texts:
As an example, let's take a node with 5 fields and two blocks between those fields. E. g. you want an article do be displayed like this:

First field

Second field

Block with related nodes

Third field

Fourth field

Block with ads

Fifth field

In D7, such display is quite simple to create with Views - you use contextual filters to output fields and just put two blocks between them.

Another option is to use node.tpl.php and create the same template.

Which of these two (Views with context. filters and tpl.php files) is better performance-wise, especially when it comes to MySql performance?


texts: How to configure mysql database connection with a different socket

texts:
I have a Drupal 6 site that I ran for years before walking away about three years ago. I would like to resurrect the site in a more modern CMS and am first considering Drupal 8.

I run my site on a shared server where I have my own mysql socket. In Drupal 6, I connected to the database successfully in settings.php through the following syntax:

ini_set('mysqli.default_socket', '/path/to/my/mysql/socket');
ini_set('mysql.default_socket', '/path/to/my/mysql/socket');
$db_url = 'mysqli://dbuser:dbpass@localhost/dbname';

Looking at Drupal 8's settings.php it's a completely different syntax, and I am stumped on how to configure it correctly either there or on the Database configuration screen during install.php. Googling things like "drupal 8 mysql socket" brings up old articles that aren't relevant anymore.

PHP 7.0 is provided and I don't have write access to the ini, so I can't override the socket there.

I have confirmed that the database is running with this command:

mysqladmin --socket=/path/to/my/mysql/socket --user=dbuser -p status

Any help would be greatly appreciated on how to get the database setup in Drupal 8, thank you.

Edit: from Clive's suggestion I added the ini_set() lines above to Drupal 8's settings.php to no avail. I'm assuming it's user error at this point so I'm still trying things.


texts: Migrating D5 users to D6 using MigrateDestinationUser

texts:
I'm using the migrate module to migrate users from a Drupal 5 site to a Drupal 6 site.

MigrateDestinationUser assumes that the source passwords will be plaintext which isn't the case in Drupal 5. Is there any way around this assumption?


texts: What are folders within sites/default/files for?

texts:
There is a quite similar question in What are all the directories for in the new Drupal 8 structure? about the Drupal directory structure, but it is not explained the content of the sites/default/files directory.

Within such directory there are all these folders:

2016-01/
2016-02/
...
config_nEjJjnck1_CMDKmCKDLS9cd-CKD89cdsCD78cdsCNJD89/
css/
inline-images/
js/
languages/
php/
styles/
translations/

First two folders contains user-uploaded content. What are other folders for and how/when their content is generated? Which of these folders should be included inside a Git repository?


texts: How do I get a form element to display in a lightbox?

texts:
I'm currently using Drupal 7 and I'm using the Form API to generate the form.  What I'd like is for certain fields to be represented by a link, which when clicked on, opens the field in some kind of lightbox.  This is what I tried, but it doesn't seem to work:

  $form['snvisdt_note']=array(
  '#prefix' => "note\
",
  '#type' => 'textarea',
  '#title' => 'Add More Information',
  '#suffix' => "
",
  );

"screen" is the name of the page the form is on.  I am trying to do this in Lightbox 2, but would be happy to use some other solution, if it works.  Can someone please give me an example of what would work?


texts: Output of entity_metadata_wrapper does not dump to dsm()/dpm()

texts:
Given this code in a theme_preprocess_page($vars)..

$node = node_load($nid);
$wrapper = entity_metadata_wrapper('node', $node);
dsm($wrapper);

Why doesn't $wrapper produce a debug dump in dsm() or dsp()? I can get data using print_r. Can someone please explain this?


texts:
I'm a drupal beginner. I'm using drupal 7 and views. I created a block using views in order to list my latest projects. I'm displaying the block in my home page. I would like to know how to override HTML and Css in order to display something like this:

I want to use this code:

Projects One

                                On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire

                            more details


texts: I'm looking for a way to force the migration to process entries with identical keys

texts:
The full scenario is as follows:

We have two entities (Foo and Bar). Foo has a multi-value entity reference field to Bar entities.

The migration source outputs each Foo-Bar pair in a single CSV line (manual aggregation is not possible because there are thousands of entries).

My plan was to put several entries with identical keys and using the --update flag and a custom process plugin, update the entry's entity by adding the Bar entity to the existing Bar entities instead of replacing them.

When I tried to put two entries with identical keys in a single CSV file, the migration module processed the first entry and ignored the second.

My understanding of the migration module is that each entry is assigned a key and that that key is mapped to the entity that was created by the migration.

Is there a way force the migration module to process multiple entries with identical keys?

I've asked the question on drupal.org as well


texts:
I have several urls with "/tag/" string; some of them have content and some of them don't, so they return 404.
How can I force them to return a 410 only for those that have no content?
I need a filter: has "/tag/" in URL and returns 404 -> redirect to 410.
I tried in theme_preprocess_html(&$variables) like this:
if ($pattern2){ //it has "/tag/" string
      $status = \Drupal::requestStack()->getCurrentRequest()->attributes->get('exception');
      if ($status && $status->getStatusCode() == 404){
          $response = new Response();
          $response->setStatusCode(410);
          return $response;
      }
}

It filters is working but nothing it's not redirecting to 410.
Thank you for your help!!


texts: Commerce Customizable product (Example: add/remove topics for pizza)

texts:
I'm trying to find a way to give the chance to the customers to "customize
" their products.

Straight example:
Luigi has got a Pizzeria and he would like to sell his pizze online where customers can add or remove topics.

Is there a way to get this option with the basic function of Drupal commerce?
Maybe playing around with products and rules?

This could be very useful for a lot of website type.

I found this module Commerce Customizable Products , it seems to do half of the job. I can add my topics and then with rules I can update the price. It looks like i cannot show the basic topics. Every pizza has to start empty.

Is there anyone who was had experience with it? Any suggestion?

If someone wanted to build a module, I would like to help with it.

Thanks in advance.

12/09/2012 UPGRADE ---------------------

Using Customizable Products I've created a new line item with a term reference field.
It will be visible in the product page and will show all the term from that taxonomy.
In the product I've got the term field(manage display: hidden) where the editor can select the pizza toppings.

Now, because the line item will print all the terms I would like to create a function that checks the term in the product and puts a flag on the right line item term.

Then, because customers can add and remove toppings from the pizza, in the view I would like to create another function that check if the user has unflagged the basic toppings and print the sign " - " before the toppings.

So the pizzeria will receive:
Pizza:

-ham

+salami

Ham was in the basic toppings.

What API can I use to get this work?


texts:
Is there any way to find node content (e.g., articles, pages, etc.) by username using Drupal's (version 7.x) core site search (i.e., the search end users can use)?

The installation that I'm working on currently indexes usernames only if they occur within the body of the node content; however, the users' respective articles will not show up.

I've attempted to write a small module to update the index to use the username (modifying this example for 7.x). I had no luck with this.

I've also attempted to write a small module that hooks into the search; however, it seems to be only accessible to the core node and user modules, which implement the hooks already.

For the time being, I have edited the core search module (in search.pages.inc) to call my small module. Then I grab the search keywords and see if they resembles an author name. If so, I grab some recent articles.

It works for now, but it's obviously not a good idea to edit the core.

Anyway, thanks for any help!


texts:
I have two modules about login forms. Want to give weight to them , but my code does not work. I put this in template.php, maybe I missed something. I restart mysql, but it does not help.

$weight = db_select('system', 's')
      ->fields('s', array('weight'))
      ->condition('name', '[commerce_checkout_redirect]', '=')
      ->execute()
      ->fetchField();

  // Set our module to a weight 1 heavier, so ours moves lower in execution order
 db_update('system')
    ->fields(array('weight' => $weight + 1))
    ->condition('name', '[redirect_after_login]', '=')
    ->execute();


texts: One of my drop down menus, the "Create Content" option under the parent "Content" tab has dissapeared. How can I recover it? (I'm using Drupal 7)

texts:
One of my drop down menus, the "Create Content" option under the parent "Content Management" tab has dissapeared. The missing "Create Content" would normally be under "Content Management."

How can I recover it? (I'm using Drupal 7).

Help much appreciated. Thanks.


texts:
I'm using polls (from core) to make some enquetes.
Is there a way to use views to display only the polls that a user has not voted yet?

I didn't find anything on google. The only solutions where for Drupal 6. And I'm using drupal 7.

Thanks in advance =)


texts:
I've been looking at using menu attributes module for Drupal 7 to add an extra field to the menu navigation system. However this adds a new attribute to the attribute array and thus prints it out in the anchor link.

e.g.

  function themename_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below'])
  {
    $sub_menu = drupal_render($element['#below']);
  }

  $element['#localized_options']['html'] = TRUE;

  $subtitle = $element['#localized_options']['attributes']['subtitle']; //get sub text

  $linktext = $element['#title']. ''. $subtitle .'';
  $output = l($linktext, $element['#href'], $element['#localized_options']);
  return '
' . $output . $sub_menu . "
\n";
}

But it comes out like this

About ussubtitleexampletext

is there anyway to hide the attribute in the link and just spit it out where ever I want it in the html? Or is there a better way of doing this? I've looked at power menu module as well, but thats not quite what I'm after either.

TIA


texts: How to reset admin password with drush and Acquia Dev Desktop?

texts:
I realize that this is a pretty standard question that there is a lot of answers for elsewhere. The issue I have is that it seems that my drush commands aren't being reflected on my dev server.

I got locked out of my site, so I tried to use two methods to get in

1) drush upwd --password="mynewpass" "myuser"

and

2) drush ucrt "mynewuser" --password="mynewpass" followed by drush urol "administrator" "mynewuser"

Both command variations don't give me any errors and confirm the newly created user and his roles. Not sure what else I can do here. Before you ask, yes, I'm flushing my caches.


texts:
I hope I can get answers pretty quick. :)

I have this field in a form:

$form['secret_code'] = array(
  '#title' => t('Enter 5 character secret code'),
  '#type' => 'textfield',
  '#ajax' => array(
    'event' => 'keyup',
    'callback' => 'mymodule_secret_code_ajax_callback',
    'wrapper' => 'mymodule-wrapper',
    'method' => 'replace',
  ),
);

Basically, I want ajax to be processed only when secret_code contains at least 5 characters. I want ajax to be processed right after the 5th character entered so events like blur or change is not suitable. After the 5th character, I need to check values from the database.

In the code above, ajax is called every time I entered a key. Let's say: "Drupal". When I entered "D", ajax gets called. Then, when I entered "r", ajax is called again, making the typing very slow.

I can do this easily with javascript/jquery. With jquery, I can still use the keyup event, continue processing ajax when the 5th character is entered. So the approach of javascript/jquery is faster.

How can I do this in Drupal way?


texts: What is the difference between using theme_table() and theme('table', array())?

texts:
I am using following code for theming..

theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => 'view-all-frame')));

is the above format right?
Can 'attributes' be written above inside array?
Can I use theme_table() instead of theme()?

theme_table(array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => 'view-all-frame')));

If they are same then does it affect the execution or anything related to it?

Similarly for theme('item_list', array()) and theme_item_list();


texts: How to use same database for two website but different panel?

texts:
Is this possible to use same database for two different domain? Example domain1.com and domain2.com but their views and designing are different for both site but content will be same .

If I change in one domain1.com it will reflect also in the domain2.com


texts: I want to place my business page linkedin feed onto our Drupal website. Is it possible?

texts:
This question is most likely more about LinkedIn. I can't find answers to this question anywhere. It is as if no one ever asked it.

I have follow links to the linkedin business page. I have share links to the visiting user's linkedin feed.


texts: How I can I have a separate variation field in Commerce 2?

texts:
I have a Commerce 2 website, where my product display page is a two column layout through display suite.

In 1 column I would like to display the picture of the product variation and, in the other column want to display product description, add to cart button, and price.

Under product type Manage Display, I only see one variation field which have images, price and add to cart widget.

In Commerce 1, these used to be separate product variation type fields but in Commerce 2, I do not see how to accomplish this.

How I can I have a separate variation field in Commerce 2 with Display Suite?


texts: Does request_uri() have to be filtered or escaped?

texts:
Mind my ignorance, but I'm trying to understand whether or not calling request_uri(), and then echoing output from it into a link is safe.

What I'm doing is getting arguments from the URL, for example:

$exploded_url = explode('/', request_uri());
echo $exploded_url[3];

My questions: is this function's output being escaped/filtered already? Would it be overkill for me to do it again? What would be the way to ensure that it is safe? Is there another/better function I should or could use?

Thanks, any input is appreciated!


texts: How to remove "Submitted by .... on Fri, 06/19/2015 - 22:04" from published content in Drupal 7? Where and what parameters and permissions to change? Thank you.


texts:
I want to use batch in POST in rest endpoints in Drupal 8, but my batch is not getting progressed.
I am creating rest endpoints for my module which will send email to bulk users. So for this purpose I need to use batch which will send email to all users without giving time out error. Please help.

my source code is:

class BatchController {

    public static function callBatch() {

        $batch = array(
        'title' => t('Sending ...'),
        'operations' => [],
        'init_message' => t('Sending is starting.'),
        'finished' => '\Drupal\module_mail\sendEmails::sendEmailsItemCallback',
        );

        $subject='hello';
        $body='body';

        $data = array(0 => array('id'=>1,'Fullname'=>"joy", 'Email'=>"example@gmail.com")
            );
        foreach($data as $row) {
        $batch['operations'][] = ['\Drupal\module_mail\sendEmails::sendEmailsUserItem',[$row,$subject,$body]];
        }
        batch_set($batch);
        return batch_process('home');
    }

}

namespace Drupal\module_mail;

class sendEmails {

    public static function sendEmailsUserItem($user, $subject, $body, &$context)
    {
        $message = 'Sending emails';
        $mailManager = \Drupal::service('plugin.manager.mail');
        $module = 'module_mail';
        $key = '';
        $to= $user['Email'];
        $params['email_body'] = $body;
        $params['email_subject'] = $subject;
        $langcode = \Drupal::currentUser()->getPreferredLangcode();
        $send = true;
        $result = $mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send);
    }

        //batch completed
    public static function sendEmailsItemCallback($success, $results, $operations)
    {
        if ($success) {
            $message = \Drupal::translation()->formatPlural(
                    count($results),
                    'sent.',
                    'Emails sent succesfully'
            );
        }
        else {
            $message = t('Finished with an error.');
        }
        drupal_set_message('Sent succesfully');

    }

}

Right now I am getting this output:


texts: Preview option for entity registration form

texts:
Is there a way to display preview before submission using Entity Registration?

Similar functionality as there is with node submit option. So that user can make changes if anything is wrong.


texts:
I want to display an array of users of my site in a view.

How do I show if a user is logged-in or offline? I can not find anything to do that in sight.


texts: Drupal cron will unserialize array and add extra characters

texts:
I am working in an application using Drupal. Thru the UI I upload a text file that is then parse and each line store in the DB as a serialized array. So far so good until there.

I have setup a module using queue and the hook_cron that will check each of the serialize arrays from the DB and make a node out of it.

I was getting some odd errors like the cron was not able to parse the serialized array and I noticed something odd the array keys were been serialize with extra characters (invisible characters).

While looking in the DB imports I notice that something like the word "comunique" that when serialize should be like:

s:9:"comunique"

instead it was showing like:

s:12:"comunique"

also a print_r show me the following:

[comunique ] => Array (...)

I even test changing the word and there are always 3 characters extra. I tested locally in my computer and it is all good.

What am I missing? is this a server config issue or a code issue?


texts:
I am building a multisite and each sub-site may have its own contrib modules.

For example:
sites/all/modules/contrib/entity
sites/site1/modules/contrib/views
sites/site2/modules/contrib/services

I build a makefile for the shared modules:

api = 2
core = 7.x
projects[entity][] = ""

And one makefile per subsite which includes the global makefile:

includes[] = "make.yml"
projects[views][] = ""

The inclusion works properly but I can't get the modules being downloaded in different directories.

I try to run the drush make command with --contrib-destination=sites option, add defaults[projects][subdir] = all/modules/contrib in the global makefile and to specify a subdir for each sub-sites's specific module projects[views][subdir] = "sites1/modules/contrib". No luck, the modules are downloaded in sites/modules/all/modules/contrib and sites/modules/site1/modules/contrib instead.

Is there any way to get it working? I now think to add some custom code to a script to run after the drush make command to move specific modules to proper directory.

Thanks,


texts: How can I switch language links to master links on a translated page?

texts:
On my website currently only one content type gets translated and is therefore available in multiple languages. On this content type/page all the links (logo, menu, footer, etc.) refer to their language version of the current language.

E.g.: I'm currently on the french version of the page. The URL looks like this: "/fr/translated-node.html". Now all the links in the menu or footer look like this: "/fr/some-page.html".

But it shouldn't be like this. All the links on this page should always look like this: "/some-page.html". So without the language code at the beginning.

How can I achieve that programmatically?


texts: How to notify user using ->messenger() and ajax?

texts:
I would like to send a message to the user on an event in the backend without a refresh. I have a 2fa login form that will send a token text. That form has a "did not receive sms" button/link using ajax that causes the text to be sent again. I would like to inform the customer of the incoming message.
You can send a notification to the user using the MessengerInterface. But this requires a refresh to show the message.
\Drupal::messenger()->addStatus('Some conditional message to the user');

I would imagine that there is a way to send a message to the user using ajax/XHR? Which would not require a refresh.
My form has a wrapping div which I can target, the button/link has an '#ajax' element with, as far as I know, all the prerequisite elements:
'#ajax' => [
  'callback' => '::ajaxCallback',
  'event' => 'click',
  'wrapper' => 'twofa_wrapper',
],

I found this comment on the Drupal forum but using this code, with obvious replacements, does nothing apart from sending a XHR response, visible in the network tab. The json response contains a number of things one being the html for the form which contains the message that I would like to show, but it doesn't show this content on the actual page.
public function ajaxCallback(array &$form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  // This by some Drupal magic gets the messages
  $messages = ['#type' => 'status_messages'];
  $messages = \Drupal::service('renderer')->render($message);
  $response->addCommand(new HtmlCommand('#twofa_wrapper', $messages));
  $response->addCommand(new ReplaceCommand(null, $form));
  return $response;
}

What am I missing?
edit:

The wrapping element was (is) not rendering for some reason, if I include it in the template the callback shows the messages in that element at the top of the form.
The problem is that I need to renew the entire form because the contents might change on the ajax call. Replacing the contents works when I actually enclose the form in the wrapper element, but then the messages are no longer included.
I can see that the messages are part of the response but separate from the form contents. Second element messages third element the new form. The strange thing is the message are also not shown on a refresh.


texts: How to display a node's last saved date?

texts:
Drupal 8 already displays the last saved date in page edit form. I want to add a field to a node that displays it again. I am using hook_form_alter() and doing this in my module, but it displays the current date.

  if ($form_id == 'node_page_edit_form') {
    $form['field_message2'] = array(
      '#type' => 'item',
      '#title' => t('Changed date'),
      '#weight' => -1,
      '#markup' => format_date(time(), $created),
    );
  }

How do I display the last saved date?


texts: Why disable non-core modules when doing a core update?

texts:
I have seem multiple update tutorials tell you to disable all non core modules before doing an update. What is the reason for this? I'm not real familiar with the update area of core but can't see any real good reason. Is there something major I am risking if I don't do this?

I can understand the reasoning if we are doing an update between major versions (6 -> 7). But when doing a minor update (7.10 -> 7.12) is where I have my question.


texts:
Is it possible to know which code called a hook? I have two cases--one where I want to return, one where I want to continue.

Anonymous user views a page, thus firing hook_entity_load() (I want to deny this--return)
Cron creates page as anonymous user, thus firing hook_entity_load() (I want to accept this--continue)

If I can check to see if cron called the hook, I'll continue. Is there a way to do this?


texts: Skip words/vary word order in search for autocomplete suggestions

texts:
I'm using an Entity Reference field which searches taxonomy terms of type Person to suggest options for  autocompletion.

Let's say, i have the following terms (Persons):
 - Jason Jay Smith
-  John Jacob Andrews... etc.

When I input "Jason Ja..." in the field, the autocompletion works fine and suggests me the Smith guy.
But if i input "Jason Smi...", the term won't be found because the word Jay is skipped.
How can i fix this?

Or generally, how can i implement a better autocomplete search? My terms are composed of a number of words and searching by just one word or a fixed word order is definitely not enough


texts: Views caching not working for Taxonomy listing pages

texts:
I was able to turn on Views caching (both time-based for a few, and content-based for others) successfully.  However, for my "taxonomy/term/%" pages (and their respective "/feed? pages as well) if I turn on any kind of caching, I get an empty page. Not the WSOD, but just the title and no listings.  Further, the pager is all screwy - the page numbers point to pages for OTHER taxonomy terms.  I can't seem to find a pattern.

I did find this discussion on d.o but it's not much help: http://drupal.org/node/1430650

What's killing me is that these pages are seriously about 98% of my site's traffic - literally tens of thousands of page views per day.  If I can get these cached it would give me a huge performance increase.

Any ideas?


texts: Omega 4 Sub-Theme problem with file_get_contents(make.libraries) failed to open stream

texts: when creating an omega 4 sub-theme using drush 6 on windows 7 and xampp and drupal 7, see attached pic,'file_get_contents(libraries.make) : failed to open stream : no such file or directory make.utilities.inc:471  Can anyone help?


texts: How can a poster of a comment notify selected users about a new comment?

texts:
When I write a comment on a node, I want to be able to select the users that will get a notification (via e-mail) about that new comment. Basecamp has this feature and I think it is very cool.

Is this possible without customization? I know how to notify the author of the comment, but this is different.


texts: How do I get a view of all flaggable nodes?

texts: I have a custom flag defined only on certain content types and I want to make a convenient list of all nodes that the flag is being displayed on, that is, nodes of all the content types that the flag is defined on.


texts: upload image by user and display images in her/his profile if admin accept uploaded image to display

texts:
I want the users to add their images; the administrator should be able to accept the images, which would then be visible on the user profiles.

I create the gallery using the help from https://www.drupal.org/node/1497058#comment-9552679.

How can I achieve this?


texts: How to add exposed form block to .tpl.php

texts:
I've added this code to preprocess function but it dosen't work :
in preprocess :

//edit_search_api_views_fulltext is the form_id of exposed form block;
$vars['custom_search'] = drupal_render(drupal_get_form("edit_search_api_views_fulltext"));

in tpl.php

print $custom_search;

What I'm missing ?


texts: Perform actions on field collection insert or update

texts:
I have created field collection and added it to my content type. I have created a node, and now user can add field collections on this node. But i need to write into a file(some stuff) when user added new field collection or updated it. I need something like hook_node_insert and hook_node_update, i cant find anything for field collection.

In preprocess_node i have outputed field_collection_field and its returns only ids, and i can get them only by this code:

 $field_ids = array();
            //context_node = my current node,
            //field_block_id == field collection field
            foreach ($context_node->field_block_id['und'] as $element) {
                $field_ids[] = $element['value'];
            }
 $field_collection = entity_load('field_collection_item', $field_ids);


texts:
I am using the following code.

  $user_storage = \Drupal::service('entity_type.manager')->getStorage('user');

    $ids = $user_storage->getQuery()
      ->condition('status', 1)
      ->condition('roles', 'directeur_cr_')
      ->execute();
    $users = $user_storage->loadMultiple($ids);

I want to add a condition that is verified when the role is directeur_cr_ or comptable_cr_.

How can I add this condition?


texts: How can I render a field inside a tpl.php that is hidden on the UI

texts:
I have a taxonomy field attached to a content type. On the teaser view mode, the field is hidden. I have two sections where I display the content type's teasers. On one section I don't want the terms to show. On the other section, I want them displayed.

I would like to know how I can render this field from the template node.tpl.php. It's not available as an element of $content, but is attached to the $node object.

Thanks


texts: Why are media files used in zero places not deleted?

texts:
Unused media files (.jpeg .mp4 etc.) are remaining permanently even though unused.

This is shown in the /admin/content/files page in our Drupal 8.6.3 system.

It could be that, at migration from Drupal 7, we weren't careful enough.

Is there any way I can force the deletion of these files using Drupal functionality?

I haven't seen any fully ready a Drupal 8 module to remedy this seemingly common situation.


texts:
Is it possible to add inline CSS to into the <head> section of a Drupal 8 page? My expected result should look like this:

<head>
<style>
.my-custom-class {
  background-color: red;
}
</style>
</head>

I've tried to add it to hook_preprocess_HOOK() but it will not show up.

function my_module_preprocess_html(&$variables) {
  $variables['html']['#attached']['css'][] = array(
    'type' => 'inline',
    'every_page' => TRUE,
    'data' => '.my-custom-class { background: ' . $dynamic_color . '; }',
  );
}

I've tried a few other things but it did not work either. Whats the right way to do this?


texts: How to enable endpoint without RESTUI module?

texts:
I've created a rest Plugin that returns some data at /api/custom/{nid}.

Drupal core provides four modules that together can handle RESTful API, these are: Serialization, RESTful Web Services, HTTP Basic Authentication, HAL. I can't find any information how do I enable custom (or even build-in) API endpoint without restui module.

So the question is:

Is there a way to enable custom rest resource without restui module? If so, how?
Is there a way to enable build-in rest resources without restui module? If so, how?


texts:
$block = module_invoke('menu_block', 'block', 'view', 26);
print $block['content'];

I am trying to use this code to print out a block, but I do not know how to get the ID for the last parameter.


texts: list users informations who flagged an entityform with views

texts:
I'm using drupal 7 with entityform, views, rules

All is in the title, i need to list some profils fields (name, mail etc..) of users who flagged an entityform.

Exemple : User X send an entityform. User Y and Z are interested and click on a button(flag) "TAKE".
When user x come in his list of entityforms submitted he can click on one of them and then he got all informations of users who clicked on "TAKE" flag.

So for each entity form the result can be different.

**Edit : More informations :
For now i have a view who list all the entityforms of my user X, on each of these items i have a link called "access folder" who show the entityform details page.

What i try to do in the entityform details page is to add a block  who list all Users who clicked on the "TAKE" Button.**

** Edit 2 : What i did for now,
- i created a view block of type "entityform type"
- I gave a name for the block and added it in my left sidebar
- in the option of the block i specified "entityform/*" in "only in this pages list"

comming back in view i added a relationship with "Entityform Type: Entityform Submission" who is the entityform i'm using, and "(Entityform Submission) Flags: TAKE (by any user)"
in contextual filters i added : "(Entityform Submission) Entityform Submission: Entityform submission ID" and specified "Provide default value" : "Content ID from URL"

I don't rly know whats wrong if someone can tell me
**

Edit 3 : i think, in contextual filter, the "content ID from URL" does not work with entity forms. Am i right ?

Thanks in advance guys !


texts: How can I preserve nids during a migration?

texts:
I'm writing a migration using migrate/migrate_d2d to import nodes from one Drupal 7 installation to another.

Currently there are a lot of links on the web that point to articles using the example.com/node/[nid] url. Since the site I'm importing to will eventually replace the current one, I need to make sure those links still point to the correct articles.

How can I preserve nids during the migration, so that the old links that use /node/[nid] still point to the correct articles?

Alternatively, how can I easily make 500,000+ URLs to old nids redirect to their newly migrated counterpart?


texts: Is there a way to add profile2 forms in multistep registration

texts:
Is there a way to add profile2 forms into a multistep registration form?...
First of all I am a beginner I only know small tidbits on how to do multistep...
What I need is step 1 to be basic user registration information, step 2 to be personal profile2 info and a conditional set up basically asking the viewer something in a radio or click box that should process if they need a second profile. If that conditional is met then they go to step 3 and fill out a second profile2 form.

I found out about multistep here


texts: How to unpublish nodes which are missing in migration source?

texts:
I have a CSV file with two rows. I executed the migration and two nodes are imported.
Now I deleted one row from the CSV and execute the migration again.
I now want to unpublish the node which is missing in the CSV.
Is it possible? How will I do that?


texts:
In Drupal 6.22, after installing 'User Relationships', APK , Content Profile and some related social modules. Then upgrading the server (Ubuntu), ans saw that private messages stopped being received by the users.

I have disabled UR, APK et al. and updated the database, but it had not fixed the problem. I even dropped the whole database and used a backup from a time prior to adding social modules. No curing effect.

The server still sends out emails and I am pretty sure that privatemsg permissions are set correctly, so that users should be able to send/receive privatemsges.

This might be clue: The users can receive privatemsg from debug (privatemsg test module), but not from other users. Not sure what does this imply.

I have really ran out of ideas and appreciate your hints.


texts: Adding template suggestion for twig based on page and content type

texts:
Actually twig only suggest templates files name like this:
<!-- FILE NAME SUGGESTIONS:
   * html--node--20.html.twig
   * html--node--%.html.twig
   * html--node.html.twig
   x html.html.twig
-->

But I would have 2 kinds of template suggestion (like on my D6 website):
One based on page + content type : page--CONTENT-TYPE.html.twig
And other based on nodes + content-type : node--CONTENT-TYPE.html.twig or page--node-CONTENT-TYPE.html.twig
Actually I have a function in my .theme file like this but nothing change about suggestions:
function starterpf_d8_2019_theme_suggestions_page_alter(&$suggestions, $variables) {
  $path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo();
  if ($path != '/') {
    $path = trim($path, '/');
    $arg = str_replace(["/", '-'], ['_', '_'], $path);
    $suggestions[] = 'page__' . $arg;
  }
}

Code found here
Thanks for help
EDIT: after exploring the output HTML, I get the page suggestions like this:
<!-- FILE NAME SUGGESTIONS:
   x page--front.html.twig
   * page--node.html.twig
   * page.html.twig
-->

So, can I add different kind of suggestions with putting together part of your codes ? Like this:
function starterpf_d8_2019_theme_suggestions_page_alter(&$suggestions, $variables) {
  $path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo();
  if ($path != '/') {
    $path = trim($path, '/');
    $arg = str_replace(["/", '-'], ['_', '_'], $path);
    $suggestions[] = 'page__' . $arg;
  }
  #Suggestions pour les nodes
   $node = \Drupal::routeMatch()->getParameter('node');
  if ($node instanceof \Drupal\node\NodeInterface) {
    $suggestions[] = 'page__' . $node->bundle();
    $suggestions[] = 'page__node_' . $node->bundle();
  }

  #Suggestions pour les types de contenus
   if ($node = \Drupal::routeMatch()->getParameter('node')) {
    $content_type = $node->bundle();
    $suggestions[] = 'page__'.$content_type;
  }
}

And if I only want to create a file like node--CONTENT-TYPE.html.twig instead of a page one ? Interesting in use of node--CONTENT-TYPE-nid.html.twig too.
And what would be better to use ? Knowing that I include field datas inside template to theme easily them ?
In some use cases I will need to theme depending taxonomy term, is this native with D8 ?


texts: How to create inline node-add forms using a block with content type names

texts:
The following page setup is needed:
A block (at the left, see image) with links to node-add forms, which open inline (the area at the right) in the current page.

The reason why the form needs to appear inline, is that this page is part of a group and the layout of the group and group menu and all must stay the same

I tried to create a Panel page variant for the node add form, but the minipanels that I use in node panels are not available there.

I thought about using an iframe, but that is not recommended generally, especially not for mobile use.

I can't find modules that are specifically suitable for this purpose, but I might have missed some.

What way could I accomplish this setup using javascript/jquery ?


texts: get timestamp of most recent comment of an article

texts:
I need the date of the last created/updated comment of an article. Are there any API functions in drupal 8 like node->most_recent_comment ? Or do I have to check every comments date of a node in a loop?

EDIT - Solution:

$node->comment->last_comment_timestamp;

Note that you'll have to change ->comment to the actual field name of the comments on your node.


texts: How to switch table prefix in a module in Drupal 6?

texts: I have multiple sites setup on a single MySQL database in Drupal 6. The sites each have their own prefix, such as site1_, site2_, etc. I'm wondering how I can switch the current table prefix inside of a module to check the variables on each site. For example, I want to check the preprocess_css variable on every site by looping through each sites settings file and running variable_get('preprocess_css') and get the variable for each site. I can get the table prefix and get the variable using db_query on the variables table, but I know there has to be a way to set the current table prefix inside a module so I can just run variable_get inside a loop with each table prefix. Does anyone know how this can be done?


texts: How do I need to configure my site on AWS with Elastic Load Balancing to force HTTPS everywhere?

texts:
my site is up and running, but all my form submits get redirected to an http:// link. The redirect from http to https on my Server (Apache on EC2) is configured and you don't see any effect as a user. If i create baseurls directly on the server it also returns http:// links.

It causes troubles on the intern side:

Google Analytics can't track this redirects as the same user and sees every form submit as an new user from a direct source.
the redirect causes a delay for the user (mostly millisecs)

Config:

running an Drupal 8.7.7 on an Apache Server.
http-redirect:

    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteCond %{HTTP_USER_AGENT} !ELB-HealthChecker
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

settings.php:

  $settings['reverse_proxy'] = TRUE;
  $settings['reverse_proxy_addresses'] = array($_SERVER['PROXY_ADDRESS']);

  $settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_AWS_ELB;

This config for setting.php was introduced in 8.7.0:
https://www.drupal.org/node/3030558

I really don't have any clue what to do now, since i tried like thousands of possibilities.

Best Regards
FirstSanny


texts:
for output display I used http://foundation.zurb.com/docs/components/accordion.html

I have the following code:

About Us

<?php foreach ($view->result as $key => $value) {?>
<img class="media-object" src="<?php print $GLOBALS['base_path']."sites/default/files/about/thumbnails/".$value->_field_data['nid']['entity']->field_about_us_image['und'][0]['filename'];?>" alt="">

<?php echo $value->node_title;?>

    <a href="#pane<?php print $key;?>">
    <?php print $value->_field_data['nid']['entity']->body['und'][0]['summary'];?>...
    <div id="pane<?php print $key;?>" class="content">
     <?php print $value->_field_data['nid']['entity']->body['und'][0]['value'];?>

  <?php } ?>

I want to preserve the format HTML  of

<?php print $value->_field_data['nid']['entity']->body['und'][0]['summary'];?>

and

<?php print $value->_field_data['nid']['entity']->body['und'][0]['value'];?>

How Can I achieve this with Drupal 7?


texts: Add animation/fade to modal/dialogue box (without using the bootstrap)

texts:
The current state of a modal/dialog opening in Drupal 8 (and 7 for that matter) is pretty clunky from a user experience perspect. Leveraging some type of animation/fade would really enhance the elegance + cohesiveness of the modal. I notice bootstrap allows a "fade" class on the modal, which gives it a fade effect (I assume). Is there a way to add this type (or any type) of animation to a Drupal 8 modal without needing bootstrap? Am I missing something simple?

Edit:
Thanks for quick replies and patience with a newbie. So I'm opening a node/add form into a modal with a link like so..

Add Article

I'd like the modal to open/close with a fade effect (or slide in, etc).
Is there a way to leverage JS, CSS or Drupal itself to create this animation?

Is there a better solution all together to displaying a node/add form in a popup/lightbox type element with ajax?

Thank you!


texts: Content Template admin interface for custom content type not displaying

texts:
I'm trying to work with a content template for a custom content type. The admin interface isn't loading... well, it's not fully loading. Here's what I get:

It should, of course, look something like this... which is another custom content type that I created whose content template loads just fine:

This content type is fairly straightforward. I don't think I've done anything unusual with it... so I'm stumped. Any ideas?


texts: Why bootstrap navigation button does not expand?

texts:
I am trying to created a simple responsive theme using bootstrap but got stock at navigation bar in Drupal 6 and basic theme. Here is the navbar that I've put in page.tpl.php:

  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

  </button>
  MySite

Home

About

Tutorials

I have removed all the native css and js files. Instead I have placed bootstrap.css, bootstrap.min.js and jquery-1.10.2.min.js into the theme and defined them for info and template.php. In the rendered page source I can see that all the 3 are loaded.

When I shrink the window, the navigation links collpase to button but then the button does not respond to on click to expected and show links.
I also tried the very bootstrap example navbar but the button and drop-down menus does not work either.

What could be wrong here?

Can see in the source of the page that all the three are loaded.


texts: Faceted Search Block displays values from other facet blocks

texts:
I'm using the Faceted Search API (drupal 7) and followed this Tutorial: Part 1 and Part 2

All worked fine but there's a little Problem with the Values each Block displays

"Kategorie" and "Serie" are both showing all selected Fields instead just the related. But if i check one Value, which is not related to the "Kategorie" Field, I don't get any results so the search works fine but displaying the values doesn't.

I deleted all and made the search page from scratch like the tutorial described but i've got the same issue all over again. Also i checked the CSS settings for my facet blocks. Indexing all again didn't help, neither does running Cron again.

Does someone have any clues?


texts: After saving a new comment How to fetch all comments for a given node?

texts: Is it possible to fetch a list of comments for a given node by using the rule After saving a new comment? After this I would like to change a taxonomy term for a certain comment having a certain term.


texts: Looking to create a taxonomy term path with a query string

texts:
I have seen this question asked over on DO and here, but there doesn't seem to be a clear answer.

How to create a path alias with a query string in the target?

I need to able to send a query string when someone clicks on a Taxonomy Tag.

So, I set my tags such as
Things-To-Do/All/[term:name]/?shs_term_node_tid_depth=[term:tid]

Which encodes the string to
/Things-To-Do/All/arts-culture-history/%3Fshs_term_node_tid_depth%3D612

Which does pull up my view, but of course, doesn't filter.

I have tried creating a custom module, as well as using global redirect, but no luck.

Is this simply not possible? Can I stick something in View Pre-render or something that will unencode the string before it renders.

I have been hitting my head against this problem for a while now and really don't know where to turn.

I should point out that the above answer 'works' but not really with dynamic content.


texts: How to group node comments using parent comment in views

texts:
I have a content type that student users can comment on. Tutors can go to each comment and respond with an answer.

On each node, I want to display the comments a user makes ONLY. Each comment should be a thread though, showing the responses from tutors.

Right now I have tried views and seen the potential to use a parent comment as relationship then filtering on the parent comment's uid. This however, doesn't bring out the needed functionality.

How do you think I can accomplish this. Any pointers appreciated.


texts: title of view posted link is not showing

texts:
I have created a view with display format Unformatted List of titles (linked) and it works fine as it shows the list of linked title but the problem is now when I click the link to view the article it shows full post without title.

So am I doing something wrong? How to show the title there?


texts:
Cannot work out why in my view it is correctly displaying rows horizontally but not in page display where it is displaying vertical.

I've tried clearing all caches and have checked css for appearance which has float left and clear all so cannot understand it.

Using corporate clean layout. PER PAGE GALLERY for content type as well as display settings in view

Now i've added to css in theme where the class is "field-items"

.field-items {
    float: left;
    margin: 0 0.5em 1em 0;
}


texts: How to build route for entity without loading it?

texts:
I'm making a tree view of vocabulary terms and I need to link each term to it's page(depends on which link template name is provided as argument to my function).

I'm loading the terms with taxonomy_get_tree and I could get fully loaded entities with it but if the vocabulary grows this will impact performance. So I'm thinking if there is a way to get the route data to build links for the terms without the need to load the whole taxonomy term entities?

I could hard-code the routes because I know them but that would mean that for every new vocabulary or term link template the code would have to be changed which is not much of a solution.

So is there a way to build the route for the provided link template with only term ID?


texts: Is there a way to update custom packages with composer?

texts:
The project is using Drupal 8 composer template to manage dependencies. Some of the packages are defined locally to look like Drupal modules and be installed in a specific location.

An example could be found here

The issue is that Composer does not store the data about these packages and their version within the .lock file. This means that there does not seem to be a meaningful way to update those custom defined modules with composer itself.

Is there a better way than just writing some custom script, probably relates to some post install procedure that would just visit all of the subdirectories that could possibly be these custom modules and would issue the git pull? Or is there a way to just force composer to reinstall these packages on each composer install run?

We fully control the codebase for these packages/modules and master branches should be safe to use.


texts: Set the permission to view taxonomy term pages basing on the vocabulary

texts:
I'd like to completely disable taxonomy term pages based on the vocabulary. I want to use the taxonomy terms to organize nodes, and even let people use them, but users should not view the normal taxonomy pages.

Basically, I need to set the permission to view the taxonomy pages basing on the vocabulary.
Does a module like this exist?

Things like Taxonomy Access Control come to mind, but those are intended to hide content based on how it has been tagged; perhaps one of those modules does what I'm looking for.


texts: Database issue with Drush aliases on Windows

texts:
I'm having issues getting the drush sql-sync command working, and it seems to be related to how my site aliases are set up. When I try to run the sql-sync command with my local and production aliases, I get the following vague message:

The command could not be executed successfully (returned: The system cannot find the path specified., code: 1) [error]

It doesn't get much more specific than that even when running with -v or -d flags. I get the same error when I run drush sa --with-db @erg_d7.local, as suggested in this post. There's obviously an issue with the database information, but I'm not sure how to fix it given that error message.

The alias file I'm using includes the following local alias:

$aliases['local'] = array(
  'root' => 'c:/wamp/www/erg_d7',
  'uri' => 'erg.local',
  'target-command-specific' => array(
    'sql-sync' => array(
      'create-db' => TRUE,
      'mode' => 'rultvz'
    )
  ),
  'path-aliases' => array(
    '%dump' => 'db/db.sql',
    '%files' => 'sites/default/files',
    '%code' => 'sites/all'
  )
);

I'm wondering if this is an issue with how the paths are written out (given that I'm using Windows 7), but I've tried formatting with backslashes as well as writing out absolute paths for the path-aliases, including leading slashes, etc.


texts: 8 - Is It Possible To Create Routes Through The Admin

texts:
Question: Is there a way for users to create routes in the admin?

Issue: I have a bunch of nodes and tax terms that are being used in Views but no where else. They shouldn't be accessible to the public either. Changing their path to /admin didn't give me the result I wanted, where in D7, that would automatically set them to the admin theme and I could set the permissions that way. I haven't found a decent entity module to create them like I want either.

Solution: Created a module that used a wildcard route. Then create a service that uses RouteSubscriberBase and alterRoutes to block any access to it without X permission.

I think there is some potential for others to use this but cannot find a way to set the routes to be blocked through the admin.  x


texts: How to set up Drupal 7 on Apache/2 without .htaccess files ?

texts: I would like to improve Drupal 7 and overall server performance by setting apache/2 without .htaccess files. How to configure apache/2 httpd.conf to achieve this?


texts: file_create_url() equivalent in a javascript file?

texts: I am dynamically loading a script using $.getScript() which works fine, but when using the CDN module it comes from the webserver, instead of the CDN. Is there a way to get the correct CDN path in JS, similar to how file_create_url() works?


texts:
I've run across an interesting topic through my work during the past few months. I use the views module heavily in Drupal projects, but I find Views to be painfully annoying in terms of its speed and how it generates all this extra markup (even using style_plugin->rendered_fields).

I decided one day to ditch Views for a project and write a raw query using Drupal's PDO layer instead. I feel using the PDO layer (despite the fact that it might not be perfect) gave me the ability to grab only the data that I needed in an efficient query.

I brought up to a coworker, "Why don't we just write raw queries...? Views is obviously not integrated into core yet for a reason..." Their response was that Views are easier for beginners and are generally easier to use and to understand. I agree that's a fair point, but what about the performance differences? Don't the performance differences (if there are even any, I might just be configuring things incorrectly) outweigh the usability of the package?

My question is, is there really a big performance hit with Views? Does it make efficient queries, or does it run node_load for each row? I'd also like to know if there's a reason that Views hasn't been included in core yet.

Is Views better than writing queries using the PDO layer, or is it just a matter of personal preference? What about when working with teams?


texts:
I have 2 fields in a content type.

field_link and  field_hoster

if in the hoster field youtube is selected the markup should embed the linked video.

can you guys give me a example of what i have to write in the markup field?


texts: Edit Field in Custom Content by adding #states property

texts: I have custom content and there are fields, for example field "dog_name". I declared those fields in .yml files.  I have a question - is it possible to edit them programmatically and add to them #states property? I need one field showing after choose particular option in other field. I found how to do it with forms, but i need to do it with fields. I know that Drupal has conditional module, but I need to implement it without any external modules.


texts:
Working on a Android APP to read/reply private message (Drupal 7).

I am able to access all secure information for a user.

Services/Resources> works file. shows the entities

But I am facing some issues

I am trying to read the private messages of a user

When I am calling "entity_message" :

response :
{
   "type": "private_message"
   "timestamp": "1466735100"
   "arguments": [0]
   "data": [0]
   "mid": "5"
   "uid": "1"
   "language": "en"
   "rdf_mapping": [0]
}

This is not message list for the requested user.

When I am calling "entity_privatemsg_message" :
Response : "No entities found."

So this is also not messages we are looking for.


texts: How translate a static block in drupal 6?

texts:
Does a variable exist that I can use to translate a static piece of text in a block?
For example:

<?php if($language==english): ?>
   do something...
<?php endif; ?>


texts: Hide the page titles of some content types

texts:
I found following code on this website http://codekarate.com/content/hiding-page-titles-specific-node-types-drupal-6 to hide the page titles of some content types.

Can some one help me rewrite this for drupal 7 ??

function THEMENAME_preprocess_page(&$vars) {
  $vars['original_title'] = $vars['title'];
  if (!empty($vars['node']) && in_array($vars['node']->type, array('NODETYPE'))) {
    $vars['title'] = '';
  }
}


texts: How to remove delete link from admin manage fields ui

texts:
I have created a new entity type and progamatically added the fields it requires. My issues is that on the Manage Fields UI (the same interfaced used for managing fields for basic pages/articles), in the operations column there is an option to delete the field. How do I remove prevent the delete link from appearing?

I have googled and looked at the FAPI documentation but don't see an option for this. Anyone know how to do this?


texts: How to tell whether the current request is part of a cron run?

texts:
I have a module that needs to behave differently when its hooks are invoked during a cron run.  (For example, my module should redirect normal page requests, but avoid redirecting during a cron run, so that the cron run is not interrupted.)

How can I programmatically determine whether the current request is part of a cron run?


texts: Drush pm-update: How can I stop it from trying to update more recent dev releases?

texts:
I'm using drush 5 to update the modules on my site.  Usually it works great.  However, when I have downloaded a dev release, even if there is no more recent point release it tries to update the dev release module to the last official "point" release.

For example, I have heartbeat-dev installed (2012-Mar-20).  Yet when I run the drush up command, it prompts me to update to heartbeat 1.0 (2011-Jun-25).

If there is a newer dev release, I want to update to that.  If there is a newer point release, I want to update to that.  But if I have a dev release and the point release is older, I don't want to update.  How can I do this?

I've been handling this manually but as the number of modules on my site grows it's getting harder to keep track of which to update and which not to update...


texts: Mutiple Admin with each having multiple client account handling

texts: I want to have Multiple administrator with each Administrator have many Client user ,with each client have it own theme and functionality


texts:
Here's a quick rundown of what I've done. (Bear in mind I'm still fairly new to this whole Drupal environment):

Started my site in a Dev environment using the drupal-composer
project: composer create-project
drupal-composer/drupal-project:8.x-dev project_name --stability dev
--no-interaction
Installed a bunch of modules including config_installer
Created a bunch of content types, taxonomies, node, etc.
Pushed it all into a git repository
Set up a few other servers for another Developer Environment, Test & Production environment.

I'm now in the process of taking what I've done to the other development environment and seem to be stuck on this point.

I've cloned my project to this new server and then run composer install --prefer-dist --optimize-autoloader and gone through the install.php process and selected the config_installer profile to import my configuration from the other server. All went well, except at the very end of the installer, I get an HTML page that just spits out a lot of code. If I go to the homepage URL after this, it all seems good with my theme/layout working as well as a few view pages.

My issue now is that I can't seem to log in to my user account or see some of the blocks/pages I've created as well as some taxonomies that I've used as filters on a view. I understand that this is all tied into the database so I'm assuming that I need to export the database over to the rest of my environments also, correct?

But what happens when I'm testing things in my dev environment after there's content in my other environments? Am I able to merge the databases or am I going to have to repeat the same process in my production site and then just import the configuration? I guess I'm having a difficult time wrapping this whole process around in my head.

Perhaps someone can clarify this a little better for me as I've spent much of the day trying to figure this out.


texts:
I have some simple dom manipulation I want to make using javascript without jquery. I can't seem to figure out how to prevent this code from firing twice.

Almost all examples I find use jQuery, but I do not want to add jQuery just for this. I'm trying to use es6 with babel here.

((() => {
  Drupal.behaviors.node_page_filters_sales = {
    attach: (context, settings) => {

      const usaButton = document.querySelector('[data-sales-switcher="83"]');
      usaButton.style.border = '6px solid orange';
    }
  };
})());

This code works, but it is run twice. Once when there selector queried does not exist, giving me a typeError, and one when it does, executing the code as expected.

It seems like it's related to BigPipe. If i turn that off, things seem to work as normal, firing once. But I obviously want BigPipe turned on. I'm clearly missing something that needs to be done when dealing with it.

For a little more detail, this is in a custom module. The custom module creates a block plugin. The javascript (snippet above) is part of the custom module's library that's attached to the block template.

UPDATED CODE EXAMPLE

The inline style was just for testing purposes. I'm attempting to check multiple buttons and add/remove classes based on a variable. See below.

// Determine default region.
let defaultLocation = '83';

if (defaultLocation === '83') {
    document.querySelector('.tid-83').classList.add('active');
}

I also notice that the javascript works as expected and is only executed once if I'm not logged in. When logged in, it fires twice.


texts: Ajaxy entity reference views filter by entity reference view

texts:
I have two content types that share a taxonomy (Size).

On content type A, I have an "entity reference" to content type B in the form of a checkbox widget.

What I want:
    On the node creation form, when I change the size (without saving), the entity reference filter gets updated appropriately.

What I currently have:
    The entity reference filter only changes when I save the node.

How I got there:

I'm using an Entity Selection views filter by entity reference view

In my entity reference view, the only thing I could come up with is to set a contextual filter of "content has taxonomy term ID"

Then use "provide default value" -> "taxonomy term ID from URL" and "load default filter from node page"

So, If I create a new node of type "A" and set "Size" to "Size X" and SAVE the node, the entity reference gets filtered properly.

What I want to happen is that on the node creation form, when I change the size it dynamically filters the entity reference without having to save the node.

There is no ajax option on an entityreference views display, and I"m not seeing any other modules that seem to solve this.

Can anyone point me in the right direction here?


texts: Modal notification box on the screen of every authenticated user

texts:
I want that every time I or any other admin (I have 2 more) post a new article each authenticated user should get a modal notification box on it's screen displaying a teaser of the Content Type I have posted.

I created an action 'Display a message to the user' for the trigger, 'TRIGGER: AFTER SAVING NEW CONTENT' and then tried saving new content and checked on a different account (which was already logged) for any message but nothing happened. Also, if this worked I'd like to show a modal box with the display settings (which I have in place already).


texts: I'm going to migrate my site to another server. so, i need to backup my database if i dump my database using mysqldump command into backup folder. does database manage it by updating the changes done into database to the sql file.


texts: Commerce Product listing View with category contextual filter, How to show items of (selected term and its child terms)

texts:
I have a the view 'Browse Products by Category'

with the path: /taxonomy/term/%

and a contextual filter: Product: Category (field_category)

and let's say I have these categories:

Sensors

--- Accelerometers

--- Current Sensors

--- Direction Sensors

Robotics & Motors

--- Dc Geared Motors

--- Digital Servo

--- Motor Drivers

then if I selected 'Sensors', I get no products, although there are products tagged with 'Accelerometers'

Is there anyway that I can configure view to show products in sub categories.

That could be done easily when showing contents but not commerce products, case content offers a contextual filter that supports depth out-of-box.


texts: Why does Drupal insist on deleting my configuration?

texts:
I've got a custom module with a configuration file config/schema/entity.schema.yml. This configuration file is imported via an update hook :
  $active_storage = \Drupal::service('config.storage');
  foreach ($files as $file) {
    $active_storage->write($file, $source->read($file));
  }

This works well, and the configuration in that file gets imported.
However, during the subsequent run of drush cim drush insist on deleting that configuration. I assume that is because the entity.schema.yml does not exist in the root config/synch folder.
Is this the expected behaviour? How can I make Drupal not delete the configuration which is imported from the module's /config/schema folder?


texts:
I have updated the require Drupal core files and folders, but I didn't run update.php.

Is it required to run update.php? If not, which types of issues I will face in future?


texts:
I am working on a mobile website and I need to have a splash page for 3 sec displayed when the client access the website for the first time. Is there any plugin I can use or what solution can I use.

Thanks


texts: I have a friend with a single page website that sells a single product. All he wants is an order form embedded on the one page that uses authorize.net. I can't find a single way to embed the form onto the website like I can embed a mailchimp form, for example. Do I need to set up an Advanced Integration Method to accomplish this? If I need to would it be easiest to do it though Drupal? And, what is the easiest way to do it through Drupal?


texts: how to make a row in a view a different style depending on the content type

texts: I have a view with two content types.  I can use views conditional to add a field depending on the content type, but how do I add a style to the entire row of content depending on the content type, for example I want content of type Article to have a class so that I can color it blue, while content of type "statistical data" will be white .


texts: I have set main menu items expanded but when I print them in page.tpl.php($main_menu) there are no children for menu items.How can I make them expanded?


texts: How can I wrap form content in bootstrap divs?

texts:
I am fairly new to Drupal and I want to change the "add article" form a bit. Currently I have the following displayed:

I want to wrap these <input> fields in a few <div> so that I can apply bootstrap to it. I don't exactly how to do this, so I tried to alter the .twig files that are being called. For example MY_THEME/templates/form/input.html.twig. However all I can see is an <input> calling {{ children }}

If I place this in a div, it just wraps the whole form in this div. Is there a way to place the individual <input> fields in separate divs so that I can apply bootstrap to it?


texts:
i'm trying to format a countdown block in views to look like .  This was done with the Countdown Module, however I'd like it to change automatically based on the nearest event date and not have to enter in each event manually.  I can set this up in views, however I'm having trouble trying to figure out how to format it.  Right now it looks like this. So i'd like hence/ago to read since or until after the number of days, followed by the event name.  Thanks for any help!

Sharon