texts: Hide or show fields based on whether the node is published

texts:
I'm looking to show and hide form fields based on the current progress of a node using contributed modules like Workflow, Maestro or rules.

For example, I would like to show certain fields if a post is published and hide those same fields if it is in draft.  I would like to avoid writing a custom module if possible.

Is there a simple way to interact with the Drupal 7 FormAPI to show and hide fields based on the status of a node using Rules, Workflow, Maestro or other contributed modules?

Also, is there an easy way to modify 'select lists' produced with the FormAPI using any of the noted plugins?


texts: Add referencing entities into this entities renderable array

texts:
Lets say I have a taxonomy called bands, and a taxonomy called band_members.

Band_members have an entity reference field relating each band member to a band.

When I view the bands taxonomy term page the band_members will not be listed.

I can modify the taxonomy term template and manually add them in there, however the bands need to be shown in popups, and the content for each popup is returned via AJAX using drupal_render(taxonomy_term_view($term)). This means any template changes won't show up. What I need to do is use a hook like hook_taxonomy_term_view_alter to add the band_members for that band into the renderable array.

However that will be quite a lot of work, and I though it seems like a fairly standard task to need to displayed referencing entities, so is there an easier way to do this?

In this example I've used taxonomies as an example, however this could apply to nodes, users or any other entities that reference each other.


texts: Use multifield values to create new nodes

texts:
I have a multifield field_staff_required of unlimited cardinality containing two subfields: field_staff_category and field_staff_quantity.

Example: I have an event node containing the staff_required multifield to which I add the following values:

Category: Manager / Qty: 1

Category: Steward / Qty: 5

Category: Security / Qty: 3

On saving the node I would like it to automatically generate new 'staff booking' nodes for each of the staff required. The staff booking node will contain a 'Staff_category' field which would be auto populated with the category from the multifield, and an entity reference field to refer each staff booking node back to the event node.

So the result in the example above is that I end up with 9 new nodes created, one with category set to Manager, five set to Steward, and three set to Security, all referring back to the event node.

Can the above be achieved using Rules? The multifield subfields don't seem to be accessible to Rules. I assume it will be necessary to write a custom module to achieve this. Any suggestions gratefully received!


texts:
Possible Duplicate:
  How can I change the apache solr search URL in Drupal?

Is it possible to change the search result URL from /search/node/searchphrase to /search/searchphrase?

I'm using core search module and overriding the results page with Panels.

There's a discussion of the search results URL on How can I change the Apache Solr search URL in Drupal? but it seems to focus on Apache Solr.


texts: Users aren't redirected to the front page after account cancellation

texts:
I have a problem with account cancellation. The proccess itself executes fine, but after the batch proccess runs, the user isn't redirected to the front page as mentioned in the UserController::confirmCancel method:

user_cancel($edit, $user->id(), $account_data['cancel_method']);
// Since user_cancel() is not invoked via Form API, batch processing
// needs to be invoked manually and should redirect to the front page
// after completion.
return batch_process('');

This results in 403 error, as anonymous users don't have access to en/user/2/cancel/confirm/... path. I tested in in 2 different sites, using Drupal 8.2 and 8.3

How can I redirect user properly in this situation?


texts: Custom editable, translatable email templates

texts:
I need to send many different emails to drupal users. How can i add custom editable & translatable email templates? Something like user emails?

I have tried "Mail Editor" module, but i don't know how to add custom emails. Perhaps this is not the right solution?

thanks in advance


texts:
I have a webform (www.mysite.com/myform) ad I want to be able to pass a URL string to a text field in the webform when a user visits the page and submits it. For instance, the URL provided to "customer A" might be www.mysite.com/myform?customer_name=customera and the URL provided to "customer B" might be www.mysite.com/myform?customer_name=customerb. I would like for the value of the text field "Customer Name" to be auto-populated with "customera" or "customerb" depending on the URL used to access the webform page.

Is this possible? If so, how can I accomplish this?

Going a bit deeper... if this is possible, is it also possible to pass two strings via the URL so that two separate fields are auto-populated? For instance, www.mysite.com/myform?customername=customera?customer_type=lead would auto-populate "Customer Name" with "customera" and would auto-populate "Customer Type" with "lead".

Thanks!


texts:
I've this hook that gets submitted values from my form which as 2 select options elements and prints the 2 values submitted.function modsubmit_webform_submission_insert($node, $submission)
{
$cont=0;
foreach($submission->data as $val) {
      $value = array_shift($submission->data);
        $value = array_shift($value['value']);
        $data[$cont] = $value;
        $cont=$cont+1;}

drupal_set_message("The value inserted was: {$data[0]},{data[1]}");
}
Now i want to use this two values to make a sql query in db, and the result showed in a table.
I can't get this to work, solutions needed

Thanks


texts: Why is the "Recent log entries" report missing?

texts:
I have a weird problem. I have the same website on two servers, live and staging, and on one server I can access the "Recent log entries" page, but on the other one, it doesn't exists.

On admin/reports/settings, the "Enable access log" is enabled, but the page admin/reports/dblog shows the same page as admin/reports

Any ideas what might be causing this?


texts: How can I disable specific layouts provided by contrib modules via the layout API?

texts: For example, the Bootstrap Kit module provides many layouts that I'm not using. Is it possible to only enable the specific layouts that my theme  needs?


texts: DrupalDatabaseCache is causing performance issues

texts:
I have devel query log / page execution time enabled on my site and most of the queries which are slowing down my site are related to DrupalDatebaseCache.

  DrupalDatabaseCache::set

Sample Query :

  UPDATE cache SET serialized=:db_update_placeholder_0,
  created=:db_update_placeholder_1, expire=:db_update_placeholder_2,
  data=:db_update_placeholder_3 WHERE ( (cid =
  :db_condition_placeholder_0) )

  INSERT INTO cache_menu (cid, serialized, created, expire, data) VALUES
  (:db_insert_placeholder_0, :db_insert_placeholder_1,
  :db_insert_placeholder_2, :db_insert_placeholder_3,
  :db_insert_placeholder_4)

Any clue what drupal is doing with caching and how to minimize it .
thanks

####Update####

I installed Memcache but still DrupalDatabaseCache calls are being made which is making the site slow .


texts: Show  on user page if user page belongs to current user

texts:
I have made a page that displays information about a user, much like a profile page.

Now I want users to be able to edit their information, so I added a button using twig tweak in user.html.twig:

{% if logged_in %}

Edit profile

{% endif %}

This works fine, however the button is displayed on every profile page. I want to hide the button if a user is viewing another user's page.

  Can this be done using an {{ if statement }} to check if the viewed page belongs to the logged in user?


texts:
I'm trying to manage the result of a code from view in Drupal 8.
I tried:

$view = views_get_view_result('name_views', 'block_1');

But I can not find the field that I expose in the view


texts: How do I define a custom html.html.twig file?

texts:
I need to define custom html.html.twig file for particular url. What I did is given below:

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return array(
    'html__ajax' => array(
      'render element' => 'elements',
    ),
  );
}
/**
 * Implements hook_theme_suggestions_HOOK().
 */
function mymodule_theme_suggestions_html(array $variables) {
  $template_suggestions = array();
  // This is used to display only ajax $content.
  if (isset($_GET['ajax']) && $_GET['ajax'] == 1) {
    $template_suggestions[] = 'html__ajax';
  }
  return $template_suggestions;
}

I have copy pasted html.html.twig file from my theme and put it inside my module's template folder and renamed it as html--ajax.html.twig. Changes are reflecting fine but not all default variables are not available in my custom html.html.twig file.

When I open the page I can see the content till Skip to main content link. Please help me what I am missing while declaring custom template file.


texts: How to delete or autodelete unused images in a Drupal site?

texts:
Every time I remove or replace an image in my Drupal 7 site (via image-field or CKeditor) it remains stored in the site's folder (x3 times at least for every style). Almost always it takes me about 3 MB of storage and creates a mess in the "styles" folder.

Is there a way (or module) to issue a command to remove all image files which are not being used (anymore) at my site?


texts: update hook to delete and bulk update pathauto aliases

texts: I have put all of my SEO settings into a feature, in order to migrate the settings from a dev site to a live site. Is there a way to write an update hook that will delete all of my existing content aliases and then bulk update them automatically?


texts: What is the exact process of resetting a password using Node.js?

texts:
I am using Node js as front end and drupal as backend, i am trying to develop a reset password api. As per my finding there are three steps for the same.

Request a Password (Send an email with secure time-bound link using
request_new_password services resources)

Reset Password (Process one time login link and return
pass_reset_token using user_pass_reset service resources)

Update Password by using pass_reset_token

I can do first and second steps easily, but how to update password by using pass_reset_token.
I saw Using Services, request new password but not very useful for me at least. how to do this ?


texts: Calendar popup field get a default value. How to avoid this?

texts:
I have all necessary module to add "Calendar popup" fields to my nodes.

When creating a new node this field is populated with the current date. Since this field is not mandatory I need it empty by default.

I can´t figure out how to accomplish this.  Please help.

I upload a capture


texts: Right way of data organasing and structuring

texts:
I have the following structure of the site that is revealed in main menu hierarchy:

  News

  news category 1
  news category 2

  Documents

  document category 1
  document category 2

All the pages mostly will be presented with a single Content Type. But for different places in menu hierarchy page regions should consist of different blocks.

e.g., for a node from "news category 1" there will be a search block placed in the sidebar, for th enode from "document category 2" -- the login block.

I see a quite moot "solution" for this. I will have to turn nodes' urls into somewhat like "mysite.org/news/category1/..." and set visibility options to blocks through url patterns. Is it a right way to follow? But in this case the editor (not me) will have to invent and handcode url aliases when creating node and it seems to me very unreliable to entrust him with the site structure.

Another way -- create different content types for every categories and generate aliases automatically but it seems to me a bit crazy.

What do you think about that?


texts: How to add "clone" button to WebformMultiple field

texts:
I created a custom composite field with a dozen or so fields, in a custom module extending Drupal\webform\Element\WebformCompositeBase. I need to add a "clone" button to the webform multiple table operations, which when clicked will create a new instance of the webform widget as the "add" button does, except that it is populated with the values existing in the element that is being cloned.
I asked this question in the webform issue queue and @jrockowitz responded

That is very tricky.
First, you would add the new operation via \Drupal\webform\Element\WebformMultiple::buildElementRow and then your would have to examine the $form_state to parse the values of the previous rows.
One trick to adding new functionality like this is to first disable #ajax and get the functionality working without ajax and then enable #ajax.

I'm relatively new to D8 development, so I don't understand how to override or otherwise commandeer \Drupal\webform\Element\WebformMultiple::buildElementRow. I know how to make a child class of it and start to add my customizations to it, but I don't know how to get my class to be the one that is executed in place of WebformMultiple::buildElementRow.


texts: How to put a custom form inside node form with own submit button?

texts:
I have a small custom form which has its own submit button.

$form['activity']['submit'] = array(
      '#type' => 'button',
      '#value' => t('Execute'),
      '#name' => 'test_button',
      '#submit' => array('my_custom_form_submit')
    );

I placed this in the page manager in the node edit form.

But the problem is the function my_custom_form_submit is not get executed. Instead the node form gets submitted and redirected to node view page.

Is there any way to to execute 'my_custom_form_submit' function on clicking on the custom form submit button?

Note: I don't need ajax, I want it without ajax.


texts: What are some drupal 7 mega menus that allows view blocks to be inserted?

texts: I was wondering what mega menu's for drupal 7 that allow view blocks to be inserted? Currently I only know about xo mega menu, but i was wondering what other ones do people use or other workarounds you might have for putting in view blocks into drop down menus.


texts: Display one time message to user upon logging in

texts:
I'm looking for a module (or another way) of displaying a message to all users only once after they login. Basically, a client wants to add a newsletter on their site, and would like to give the change to all the users with accounts once they login to signup to the newsletter. They just want the message to appear once, the user can dismiss it, and then it will never display again. Ideally it would be possible to generate more messages at future dates for other reasons (changes to privacy policy, offers, etc).

I've looked at a few modules, including LoginToboggan, Rules, Flag, Absolute Messages and EU Cookie Compliance but none seem to do what I need.

Anyone know of a module or a method of implementing this with the above modules?


texts: Grandchild nodes (of a nested taxonomy term) on node page

texts:
Every time I think I understand relationships… Got desperate and cannot make work following context:

A node has a reference (field_a) to a term 1A of vocabulary A. That term 1A itself has a reference (field_b) to another term 1B of vocabulary B.

vocabulary A > vocabulary B

TERM 1A > TERM 1B

TERM 2A > TERM 2B

TERM 3A > TERM 1B

TERM 4A > TERM 2B

NODE 1 > TERM 1A (> TERM 1B)

NODE 2 > TERM 2A (> TERM 2B)

NODE 3 > TERM 3A (> TERM 1B)

NODE 4 > TERM 4A (> TERM 2B)

On the node page I would like to have a block that shows all nodes that have the same (term) grandchild relationship to 1B (respectively 2B or any term of vocabulary B).

Or schematically (adding other cases)

BLOCK on NODE 1 PAGE shows related NODE 1 and 3

BLOCK on NODE 2 PAGE shows related NODE 2 and 4

BLOCK on NODE 3 PAGE shows related NODE 1 and 3

BLOCK on NODE 4 PAGE shows related NODE 2 and 4

Could someone please give my a hint?


texts: how to trigger search button on tab is opened(Clicked)?

texts: I have two views to display search result for user list and content list respectively using exposed filter. I have shown shown both views as a tab (Content and Users) on a page with exposed filter separate for each. When I search for content with filter criteria it displays list of contents. Now what I want to do is when I click on User tab it should display results for users with same filter criteria. Is there anybody who already has done this functionality?   Hope the image will help you to understand my question.


texts: Why isn't my integer value processed correctly with PHP in Rules?

texts:
My articles have a field collection field and one of the fields is an integer. Users can add as many fields as they want. I'd like to reward them some userpoints, equal to the total value in their saved fields, but with an overall maximum of 5.

e.g. A user saves a first field with a value of 3. Therefore, he's awarded 3 points. When he saves another field with a value of 4 afterwards, he must be rewarded 5-3=2 points.

I wrote a rule that sums all the old and new values in the integer fields via a loop (the results are saved as variables 'Old total' and 'New total') when a new field collection is saved. Before I can grant userpoints to the user, I have to do some calculations to prevent the total amount of earned points to be larger than 5. I tried doing that by adding the following PHP code in the 'Process value' box of a 'Grant points to user' action:

if (old-total > 5) {$value = 0;}
elseif (new-total > 5) {$value = 5 - old-total;}
else {$value = [field-collection-item:field-my-integer];}
return $value;

However, when the action runs, the code seems to be ignored, because the value doesn't change at all. I don't get any errors.

What did I do wrong? How can I solve this?


texts: Shopping cart delete button is not removing the correct line item.

texts:
I have 2 blocks on my shopping cart. The view block for the Main Product and another for the Specials ( which is an add-on), each block has their own delete button. I use a Views Field View on the Main Product block to call the Specials blocks. Each specials and main products are connected via node referencing. I can't use just 1 view block to show it like that because I need the added specials to be filtered/shown below the main product where it's connected.

When removing a specials, it deletes the line item properly but when I try to remove a main product it deletes the special that follows the main product and when there's no more special for that specific main product, it deletes the specials of other main product. It does not delete the line item where the remove is connected. I don't know why it works like that because each remove has their own line item.


texts:
I was getting fatal error to do with ctools along the bottom of each page of my site. To try to fix the issue I logged in as admin, and disabled 3 ctools modules in my website:

Custom Content panes
Page manager
Views content pane

This gave me an error page and my site is totally inaccessible or viewable. I turned them back on manually in the database, but now I get this error message:

  Fatal error: Call to undefined function page_manager_get_task() in /var/www/mywebsite.com/httpdocs/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc on line 266

Does anyone know how to fix this?


texts: I need to update jQuery version for drupal manually?

texts:
For updating the drupal core jquery file i used the jquery_update contributed module. This module help me a lot to use some of the new function/method of jquery.

But In my view i'm using ajax for pagination and exposed filter form submission. My view containing very bulky data so most of the time most of the browser giving me a script error saying - script is unresponsive, file is ...jquery.min.js

And as my table data is growing up this script error is coming up frequently (that's halt every thing on browser).

Actually this file came into the picture when i install the jquery_update module. By my personal experience i know the reason (basically file conflict).

So i just want to know how to replace the drupal default jquery file with jquery's latest version file manually.

Any suggestion or guidance will really gonna help me a lot.


texts:
I'm looking at the DB but can't find where the permissions are stored.

On the Admin page the permissions can be saved at /admin/user/permissions

But where this data is saved in the DB?


texts: Clone project: refused to execute script

texts:
I just cloned an empty Drupal 8 project locally, initially I entered the web folder and I used

php -S localhost: 8000

With this virtualization, every time I enter the "edit" rooting rule, a 404 error occurs.
To solve the problem I created a vhost configuration:

<VirtualHost *: 80>
ServerName www.site.lcl
DocumentRoot /home/user/Projects/platform/site/app/web
 <Directory "/home/user/Projects/platform/site/app/web">
   Allowoverride all
   Order allow, deny
   Allow from all
   Require all granted
 </ Directory>
</ VirtualHost>

With this configuration the routes are presented correctly, but a new error occurs, in all the pages the css and js files are not loaded and from console js this error appears:

Refused to execute script from 'http: //www.site.lcl/' because its MIME type ('text / html') is not executable, and strict MIME type checking is enabled.

I tried to edit the php.ini file like this: default_mimetype = "", restart apache and clear the cache but with no result.

In both installations the php.ini file used is the same.

How can I solve it?


texts: How to edit and delete entityform submissions?

texts:
I'm using entityform for particular submission. I set the rule When submitting the entityform, its stored in particular content type. Its works well.

But when edit and delete the particular entityform submissions its not work.

So how to relate the entityform submission edit, delete operation stored to the content type i created.

Is there any rule or hook available to store entityform submission to particular content type.?

Thanks in advance!!


texts: Print a block of a view under another view

texts:
Story:

People can add Buildings, These buildings got fields (place, width etc.)
This one has a view called Buildings(page)

People can also add concepts for these buildings (name of concept, Concept description, dropdown in which you can select the building the concept is for.)
This one has a view called Concepts(page)

What I wish to accomplish:

On a specific building page, I wish to print a block underneeth the building info, which prints all the concepts titles(these redirect to the concept) created for that building.

I have been fighting around with taxonomy-terms and tons of other modules. the force just isn't with me today.

Is there anyone that could point me into the right direction? Thanks in advance!


texts: How would you implement an automatic way of the images loading in a pop-up (lightbox/colorbox) window by a click?

texts:
What I mean is, can we achieve the blogspot.com/Blogger experience where we can add photos to the content (node in Drupal speak) and without any ado (adding class="colorbox", or enclosing the <img> element into an <a> ), clicking the photo in the post will make it enlarged in a pop-up window, similar to how colorbox functions.

I have visited this question Configuring Lightbox2 to Pop-Up Images embedded in nodes and it seems ambiguous to me.

I have a current Drupal 7 site and it's quite annoying that I have to manually enclose the images in a

<a class="colorbox colorbox-insert-image" href="..." title=..."> ... </a>

every effing time.


texts: How do I access a field value for an entity (e.g. node) object?

texts: node_load((int) $nid) loads a fully-populated node entity. $node->title->value gets the title, but how do I access field values in Drupal 8?


texts:
I was trying to add a RSS feed view in Drupal 8. I selected feed row style for Fields, and clicked on Save and edit, but I got this message.

  Row style plugin requires specifying which views fields to use for RSS item.

What does this message mean?


texts: Mailchimp Newsletter block position in registration page in Drupal

texts: I am just pulling my hair out for the last two days  trying to figure this out but as a new user of Drupal I cannot find the option where to change it. I have installed Mailchimp module in my drupal website and I want to display the newsletter option in the user registration page. It display fine but not in the right position. For some reason the block appears between the firstname and lastname field. I want to place this under email address field above the captcha. Can anyone please help me. I have tried to many things and cleared the cache but no luck.


texts: Why some variables aren't listed on strongarm feature component list?

texts:
I want to export 2 variables from domain navigation module:

domain_nav_block
domain_nav_theme

I am sure that this vars exists in variables table, but in strongarm tab there are missing...


texts: In a node I get the values of CCK fields as $ array or $_rendered as the rendered view of the field. How can I change the $<field_name>_rendered from its default way of rendering?


texts: recursive entity reference in a view (tree view?)

texts:
I have content type with entity reference to node of same content type. And I would like to show the nested references in the node view. Sort of a tree view.

How could I accomplish that?

I guess I need a view and a view field? But even not yet sure how to create a view which does recursive relationship...

It is for managing software dependencies and releases, there are libraries (=content type) dependent on 1:n libraries.


texts: drupal add class to form-item if error on form to all forms

texts:
I just want to add class to .form-item if there is error on form i used the following code but its not working.

function semanticUI_form_element($variables) {
  if (isset($element['#parents']) && form_get_error($element)) {
    $attributes['class'][] = array('error1');
  }
  if(form_get_error($element)){
    $attributes['class'][] = array('error1');
  }

  if (!empty($element['#required'])) {
    $element['#attributes']['class'][] = 'test';
  }
}

Any help would be appreciated.


texts: Facebook plugins slow page load - what can be done to improve this?

texts:
I currently use the Facebook plugin integration module, and have a like button and a fb comment block on each page. Especially the FB plugins load slow.
It appears that any link on the page is not clickable until the whole page including fb plugins have loaded...currently about 5 seconds per page (!)

I was thinking about using a simple link with (rules link form example, or flag with flag field) to trigger the fb like and comment plugins in the background. Would anyting like that be possible?


texts: how to link to sections in the same page?

texts:
How to create menu items with links that link to the same page (like scroll down further)?

Example: http://eshbeata.com/ , clicking on "Work" or "About" just scrolls down the same page.


texts:
I have created a custom form and have put in some notes but I am wondering whether it's the correct 'Drupal' way. I have added the notes using the following format:

  $form['notes'] = array(
    '#markup' => 'A few notes.

Item i

Item ii

Item iii

'
   )


texts:
My web host (Bluehost) recently switched shell access from bash to Jailshell. That simple switch has sent Drush on vacation. It has been months and the host has not been able to find a solution (or isn't looking). Below are a couple of error messages returned from drush status. The problem isn't the PHP version. The problem is Jailshell.

  Parse error: syntax error, unexpected T_STRING, expecting
  T_CONSTANT_ENCAPSED_STRING or '(' in
  /home2/username/.composer/vendor/drush/drush/includes/preflight.inc on
  line 8 user@domain.com [~/public_html/clientfolder]# drush status

  Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in
  /home2/username/.composer/vendor/composer/autoload_real.php on line 23

  Parse error: syntax error, unexpected T_STRING in
  /home2/username/.composer/vendor/composer/autoload_real.php on line 23

Any assistance would be greatly appreciated. Thank you.


texts: Rebuild Form Element with new property after Ajax

texts:
I want to rebuild a Form Item with new property after Ajax triggered on page, I try following codes
<?php

use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\HttpFoundation\Request;

function MYMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {

    if ($form_id == 'node_trends_form' || $form_id == 'node_trends_edit_form') {
        $form['langcode']['widget'][0]['value']['#ajax'] = array(
            'callback' => 'MYMODULE_language_change',
             'wrapper' =>'edit-field-trends-wrapper',
            'event' => 'change',

        );

        $form['field_trends']['widget'][0]['value']['#autocomplete_route_parameters'] = array('lang'=>'test');
        $form['field_trends']['#prefix'] = '
';
        $form['field_trends']['#suffix'] = '
';
    }

}

/**
 * Ajax callback.
 */

function MYMODULE_language_change(array $form, FormStateInterface $form_state) {
        $form_state->setRebuild(TRUE);
            $form['field_trends']['widget'][0]['value']['#title'] = "New Title After Ajax";

        $form['field_trends']['widget'][0]['value']['#autocomplete_route_parameters'] = array('lang'=>'onajax');
        return $form['field_trends'];
}

Update : in order to find the problem I change the code to simplest manner,

The Problem is  when ajax triggered  autocomplete replaced but changing on #autocomplete_route_parameters to applied !!!
Update 2 Strange things is I try to change field title on ajax callback handler it applied and after ajax new title is New Title After Ajax but  autocomplete parameters not changed. I confused


texts: Add a class the the form element (tag) of the search block form

texts:
How do I add a class to the form element of the search block form?

I mean, add a class to this element:

<form action="/search/node" method="get" id="search-block-form" accept-charset="UTF-8" data-drupal-form-fields="edit-keys"></form>

I've tried:

function mytheme_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'search_block_form') {
    $form['#attributes'] = array('class' => array('abc'));
  }
}

and

function mytheme_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'search_block_form') {
    $form['#attributes']['class'][] = 'abc';
  }
}

I've tried:

function mytheme_preprocess_form(&$variables) {
  if ($variables['element']['#form_id'] == 'search_block_form') {
    $variables['element']['#attributes'] = array('class' => array('xyz'));
  }
}

I've looked into altering core/modules/system/templates/form.html.twig, which does not look like the way to go.

I'm using the Bootstrap theme as my base.


texts: How can I allow users to duplicate a select field while creating a page from a custom content type?

texts:
I have one select field (filled with taxonomy terms) in a custom content type. I can't figure out how to allow users to duplicate that select field (select "apples" and then add the select field again -- 2 instances of it now -- and select "oranges") when creating a page with the custom content type.

EDIT: is there perhaps a module that would do this? I've looked at similar kinds of modules like Webform, but none of them seem to be quite what I'm looking for.


texts:
I am looking into updating a Drupal 4 site. The Node Export module does not seem to have a release suitable for Drupal 4. Can anyone recommend an alternative module or procedure?

The site is running Drupal 4.6.3.


texts:
is it possilbe to use string overrides module for system messages? What i need is to change the order of the words and add some more. For example i have a webform with some required fields. When user forget to fill a field it gets this message: "Surname field is required.". I need to change this to "The field Surname is required for this form". How can i do this?

Thank you


texts: Custom Drupal Analytics with Views- how to track the number of users by role over time?

texts:
I am building a social networking website in Drupal.  As users complete their profile, they are awarded different roles.  Now that I have launched the site and have some members, I would like to track the number of users by role over time so that I can see how my site is growing.

I built a view to do this and it shows me the information I want.  However, since I want to measure membership growth I would like to do this over time.  So, currently I simply log into my site and then type the numbers I need into Excel.

Is there a better way to do this?  Ideally, I would like to automatically save an Excel-ready snapshot every week (or in a dream world, have a graph automatically prepared).  Is there some other way (even without views) to track the number of users by role over time?


texts:
We are looking to build a new website which would make use of 2 web applications: Drupal and Magento. Drupal will be used for corporate website while Magento will serve as a web shop. One of the challenges that I'm facing is the single-sign-on (SSO) part. I have done quite a lot of reading about this subject and haven't come across the "best way" to do this.

Do we keep a separate user database on both Magento and Drupal? (Taking into consideration that not every Drupal user will have access to the web shop.)

Should we use a central authentication server (CAS) instead?

Currently I'm testing the following method:

Installed the Drupal rules module
Configured that the user is redirected to a file sso.php after
he/she logs in on Drupal
The sso.php file reads the information of the currently logged in
user and optionally creates the Magento session for this user (if an
account with a matching username/e-mail) exists

Does anyone have any previous experience in getting the SSO feature between Magento-Drupal? Any input would be appreciated!

Some more info:

The website and web shop will run on the same domain. The web shop is located in a subfolder
Preferably the SSO has to be done programatically without using the slow Magento API


texts: To use some hook instead of "PHP contextual filter code" in view

texts: Can anyone please give a solution on having a substitution of "PHP contextual filter code" for views, inside a module code?


texts:
Today i have transferred my d7 site to a new ubuntu vps, then in the Apache config files i made this change: AllowOverride None to AllowOverride All and now d7 site is working under clean url.

While transferring the website i have disabled the clean url option from the admin/config/search/clean-urls, but here is the difficulty. Now clean url works but in order to enable clean url when i click on the "Run the clean URL test" button then it shows "The clean URL test failed." though it is working :/

I have cleared all the cache data with no luck.

Now what are alternative ways to enable clean url manually in d7?


texts: Complex view based off of Node Reference

texts:
Drupal 7

Is it possible to get the current pages Node name and dynamically use it for a view using node reference? I have a content type called product and I am going to add a view to this content type that will show a list of image content types that have a node reference field set to the product content type.

For example:

"Furniture" page - content type "Product"
"Clothing" page - content type "Product"

"Image" content type - "Image 1" w/ a node reference field of "Furniture"
"Image" content type - "Image 2" w/ a node reference field of "Clothing"
"Image" content type - "Image 3" w/ a node reference field of "Clothing"
"Image" content type - "Image 4" w/ a node reference field of "Furniture"

So when I go to the Furniture product page my view will have Image 1 and Image 4 in the list
and if I got to Clothing product page it will show Image 2 and Image 3.

If this needs more explanation please let me know.


texts: When is using --package-handler=git_drupalorg appropriate with drush?

texts:
In which situations are using

drush pm-downlaod --package-handler=git_drupalorg ...

appropriate?

For example, if I am developing a normal site and want to version it with git, I assume it just best to just use the normal drush commands and version it outside of git?

Would using the git package handler, especially when combined with submodules, be most appropriate with sandbox environments where I may want to contribute patches and/or push changes back to git.drupal.org?


texts: How to install a taxonomy system that represents records in another high-volume, non-content-node table?

texts:
Here's the scenario:

A writer about celebrity gossip posts a node (article) on a Drupal website.
I have a module that scans the article and automatically creates taxonomy fields based on celebrity names posted in the article.
These taxonomy "terms" are based on a firstname/lastname list of celebrities that will be high-volume and perpetually growing.
This list of celebrities will have various fields to render in-depth profiles of the celebrities
Content nodes can have multiple celebrities attached to it.
Celebrity nodes can be attached to multiple content nodes.

Here are my assumptions:

The ever-increasing volume of celebrities and their atypical field requirements make it necessary to create a table specifically for celebrities.
The taxonomy-to-node relationships are really nothing more than node_id and celebrity_id in a relationship table.
While writers can tag an article automatically with my module, they will likely need to sometimes add additional celebrities due to misspellings or scanning errors, thus the celebrity firstname and lastname will need to be a part of the tagging process.
Due to name changes, misspellings, etc, we don't want to use celebrity firstnames and lastnames as unique IDs

So, here are my questions:

Is there a module already built that renders this functionality?
Is there a module already built that helps create a taxonomy that can represent a relationship between a node and entities in a custom table, not just a taxonomy table?
Is this functionality already present in a Drupal distribution somewhere?
Should I create a custom module to solve this problem (i.e. I won't be re-inventing the wheel)?


texts: Text input with Autocomplete for facets field in search page using solr search api?

texts:
As my terms and values for multi-valued fields are growing, search page is taking too much time to load all values under facet filter. In order to improve the performance and give better User experience i would like to have a text input box as filter instead of facets check boxes,links and select list. So whenever user types any text in the text box,system should auto-suggest only matched facet values based on the current search result and when any item item is selected from the list, respective filter should be applied.

With this above implementation approach performance will be improved and user can easily search and apply their desired filters.

(OR)

In other words i need a text based search filter like Zomato's location filter using facets with solr search api.
Please Visit: https://www.zomato.com/bangalore/restaurants for reference.


texts: Image Captcha Refresh not displaying refresh link

texts:
I want to add button/link for refreshing Image Captcha, therefore I've installed and enabled Image Captcha Refresh module. But this module is doing nothing, no refresh button is added, no options are added to Image Captcha settings page, no javascript is loaded from this module.

My captcha is in custom form:

$form['captcha'] = array(
    '#title' => 'Code',
    '#type' => 'captcha',
    '#captcha_type' => 'image_captcha/Image',

What could be wrong?


texts: How to generate a resume after an applicant submitted an online resume?

texts:
I'm currently building a recruitment system using Drupal 7. In my system, an applicant who wants to apply for a job, needs to complete an online resume (one time only).

Question: Are there any modules that can generate a simple resume after the applicant finishes (saves) the online resume, similar to this Online resume example?


texts: Commerce order confirmation message with shipping service

texts: I'm sending confirmation message of a commerce order via Message Notify. I want to display the selected shipping service in the email.


texts:
I'm new to Drupal. I've just started a custom theme in Drupal 8 and created a new field under Content Type. This field value is a custom class for each page. From the documentation I should be able to display the field contents of "field_body_class" with the following, neither of which display.

{{content.field_body_class}}

{{page.content.field_body_class}}

I've checked to make sure the field was not hidden, which it was not.


texts: How do I print the name of the field for a submission a value?

texts:
I have a custom webform confirmation page where I am print the submission values using the following:

<?php print $submission->data[67][0]; ?>

How can I print the title of the form field for the above data?


texts: Panels cache terminology- what's the difference between caching by argument vs. by context?

texts:
I'm trying to learn how to set up Panels caching.  I watched a video on mastering Drupal caching and I have the book by Earl Miles on Panels and Views, Drupal's Building Blocks, but unfortunately there's not a chapter specifically on caching.

So, I have a panel that overrides the user profile, and on this panel I have a variant that has a number of views content panes.  I would like to cache these content panes per user profile displayed, since obviously they should be different for each user who is viewed.

Each of these content panes has a Contextual filter on Content: Author UID.

The value is supplied to Panels by the Argument input option in Views, for which the Content: Author uid source is set to From context and Required context is set to User ID:

In Panels, on the Simple cache configuration screen, for the Granularity, I can choose Argument or Context, and the help text is this:

  If "arguments" are selected, this content will be cached per
  individual argument to the entire display; if "contexts" are selected,
  this content will be cached per unique context in the pane or display;
  if "neither" there will be only one cache for this pane.

But in Views, the option is called argument input and the value I chose was from context.  So am I dealing with an argument or a context?

If possible, both a general answer describing the difference between argument and context in this case and a specific answer to my question would be fantastic.


texts: Change entity reference field widget based on condition?

texts:
I am using Drupal 8. In user registration form, I use an entity reference field to a profile. I wanted to display inline entity reference form widget or entity select widget based on role.
For this, I tried to use hook__field_widget_form_alter(), but it didn't work.
Is there any way to solve this problem?


texts: Fetch customer profile in a component rule

texts:
I'm working on a multi-lingual webshop and I'm trying to create a system for commerce where an admin can accept or reject orders. I've done this by creating a view that lists all pending orders and then I'm using bulk operations with 'accept' and 'reject' buttons to send a list of selected orders too a component rule that changes the order status. This works fine, except that I also want to send an e-mail to the person who made the order when the order is rejected. Again, sending the e-mail is not a problem, since it is stored within the order, what I'm having trouble with is sending the e-mail in the customer's language.

The site allows for anonymous orders, so referring too the order's owner for the language is not an option. I can't store extra information in an order either, so I added a hidden field too the customer profile that stores the language. However, all I have to work with is the list of orders. When I try to fetch the customer profile I don't get access too the field values, only the profile's ID and User ID.

Is there any way to fetch the complete profile, or possibly even better, is there a way to send the language string as parameter too the component rule with from the view?


texts: Is there a way to use organic groups to manage file permissions for files uploaded to site? I would like have of at the node level and file level.


texts: Only run one part of a Drupal behaviour once per page load?

texts:
I have a Drupal behaviour that's working fine. This is to say that it is re-run when new content is pulled into the page with AJAX.

However I would like one part of this behaviour to only run when its first called, and then to not be called again (until the page is reloaded).

So in the code below logging A should run every time the behaviour is called, as is the standard Drupal way. Logging B should run when the behaviour is first called, but then not again even if the behaviour is re-run.

Drupal.module.custom = function () {

  console.log('A');

  console.log('B');

};


texts: How to prevent user from viewing profile

texts: I go into Administration>People>Permissions>User>View user profiles and see that only admin has this permission, however while logged in as non-admin I can still see his profile when I go to  /user


texts:
I am using Drush 6.0 for my Drupal 7.x site. When I run
drush sqlq "select * from users where uid=1", it always shows the following error:

  'mysql' is not recognized as an internal or external  command, operable program or batch file

Why does it happen? How can I avoid it?


texts:
I simply want to display a table generated from an external database on a page.  In researching this I found it would be easiest to do it by writing a module.  Using a tutorial I created a block module that does what I want, but I can't figure out how to make a block module appear on a normal page. This must be something people do on a regular basis.  This is version 7.

Is there such a thing as a page module rather than a block module?

Thanks,
Jim

Just to extend this a bit, eventually I want to be able to add a select form element and perhaps write a bit of javascript (jQuery calls) to change the query that generates the table, etc.  But for now just to be able to display the table on a node/page would be fine.


texts:
How to add css to specific blocks or view with CSS injector module?

I can add css to specific pages, but what about blocks, views and all sorts of other nodes?


texts:
Situation is that inside contrib modules folder I found out that each module has /translations and inside a .po file which is not cool when it comes to modules update. I want to take out these translations out of each module folder and place them in single location.
My questions is any idea why they were placed there in first place, is this some kinda of convention or? Also if I extract them to another folder what type of configuration must be provided ? And last question is I assume that simply removing/moving them wont affect translation at all as they were already import into the database?


texts: How can I loop through all article content types and get the content of each

texts:
I created a new article content and am overriding that by creating a template for it (ie: node--4.html.twig).

Then inside this template, I want to loop through all nodes that belong to article content type; and to achieve that, I created my .theme file and added the following code based on the answer for this question here:

<?php
  function capoeira_preprocess_page(&$variables) {
  $articles = \Drupal::entityQuery('node')->condition('type', 'article')->execute();
  $nodes = \Drupal\node\Entity\Node::loadMultiple($articles);
  $variables['articles'] = $nodes;
}

Inside the template I do have:

{{ kint(articles) }}

inside my template and I go refresh the page I show article as NULL.

How do I loop through the articles?

EDITED:

None of the below work:

function capoeira_preprocess_page(&$variables) {
  $articles = \Drupal::entityQuery('node')->condition('type', 'article')->execute();
  $nodes = \Drupal\node\Entity\Node::loadMultiple($articles);
  $variables['name'] = $nodes;
}

function capoeira_preprocess_node(&$variables){
  $variables['name'] = 'My name comes here';
}

function capoeira_preprocess_node_article(&$variables){
  $variables['name'] = 'My name comes here';
}


texts: How is media document entity different from file document entity?

texts:
I hope this is the right place for my question as I want to understand media document a bit more.

I'm working on a library website. Each book can have one or more files. Each book file should accept either local file, external link or both.

I think now it is possible to do that with media entity document or file entity.

I just don't see the difference and the better option for my case.

Any thoughts will be great.


texts: drupal multilingual frontpages different templates

texts:
I am building multilingual site using 3 languages.
English is default and 2 other used wit prefixes. www.example.com/fr/.../cs/

I would like to create custom landing page on www.example.com using different template than other landing pages with prefixes.

So www.example.com (which is English language) would only be plain page (custom template) with links to www.example.om/fr (with default template page) and to www.example.com/cs (default template)

Would be something like this possible?

Thank you


texts: How to give to the creator of a node the option to hide the name of the author?

texts:
I need to provide a way for hiding the name of the user who created a node, if the creator of a node wants to do so. In such cases, it should show Anonymous as the author of the node.

Any suggestions about how to implement this?


texts: EntityFieldQuery for retrieve only 1 field

texts:
I'm developing a new rules action that it is called by EntityForm when a Form is submitted.

In this action I want to retrieve 1 field from "noleggiatori" content type, so this is my function:

function zbl_rules_send_email_to_noleggiatori($entityForm) {

  $prov = $entityForm->field_provincia[LANGUAGE_NONE][0]['tid'];
  $reg = $entityForm->field_regione[LANGUAGE_NONE][0]['tid'];

  $query = new EntityFieldQuery();
  $query->entityCondition('entity_type', 'node')
        ->entityCondition('bundle', 'noleggiatori')
        ->propertyCondition('status', 1)
        ->fieldCondition('field_provincia', 'tid', $prov, '=')
        ->fieldCondition('field_regione', 'tid', $reg, '=')
        ->addMetaData('account', user_load(1)); // Run the query as user 1.

  $result = $query->execute();
  dd($result);

  $articles = $result['node'];
  $fields = field_info_instances('node', 'noleggiatori');
  $field_id = $fields['field_email_per_comunicazoini']['field_id'];
  field_attach_load('node', $articles, FIELD_LOAD_CURRENT, array('field_id' => $field_id));
  dd("articles");
  dd($articles);

  /* Other lines .... */
}

But I have a problem: the code is correct (no error), but it does not work correctly because it set ALL content type's fields in $articles. I want only "field_email_per_comunicazioni". Is this possible? How?


texts: How do I make Edits to domain specific sites? eg, es.site.org vs. site.org

texts:
On site.org I can go to cms-site.org and the edit buttons appear on the page,  which make pages editable. cms-es.site.org doesn't load at all.

Similarly, an administration menu bar appears on cms-site.org, but not on cms-es.site.org (which doesn't load at all).

Is there a way to get these pages to load?

I'm using Drupal 7.

When I click on Configuration in the menu, I get this. The bottom is cut off but lists my subsite: Site ES.


texts:
In a drupal 6 custom module I built, I have a menu callback which contains this:

function mymodule_register_confirmation() {
  return drupal_get_form('mymodule_newsletter_form');
}

I have the function that returns the form:

function mymodule_newsletter_form(&$form_state) {
  $form = array();

  $form['logo'] = array(
    '#type' => 'markup',
    '#value' => '<div class="logo-header">',
  );

  ...

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit')
  );

  ...

  return $form;
}

I also built the function for the submit hook of newsletter form:

function mymodule_newsletter_form_submit($form, &$form_state) {
    die('I am in the submit hook!!');
}

The page shows as expected and contains the newsletter form exactly as I want. However, when I click the submit button, it goes to the action of the form (as expected) but the submit hook I built never executes. I even tried adding the following to the function that returns the form:

$form['submit']['#executes_submit_callback'] = TRUE;
$form['#submit'][] = 'mymodule_newsletter_form_submit';

What am I doing wrong?

Thanks in advance.


texts:
I got A Drupal7 setup with module view and nodequeue.
Now i want a pager on the bottom of my content-type that gets me to the next node of this type in my nodequeue position.

Now i found this Get next node in nodequeue when i googled it.
But this solutions wont work for me.


texts:
I create a very simple theme with "stable" parent theme.

So far so good.

The size of input is indicated in HTML, and it bothers me a lot for the layout of my forms.

This is an example.

<input (...) value="" size="60" maxlength="128">

I have of course looked in the stable theme, but in the template input.html.twig, it is only indicated <input{{ attributes }} />{{ children }}.

I would like to remove the size indication to fully manage my layout in CSS.

How can I achieve this?


texts: How to get field values in rules condition from fetched entity

texts:
I have a content type "Event" that's linked to a registration type.

Inside rules I want to trigger the action only if a field value from the host entity is "Open" (it's a checkbox field).

Under actions I'm able to fetch the host entity and access this field but i'm baffled how to access the same field under conditions. How can I go about this?

Thanks.


texts: How to update Drupal custom module after changing .install file

texts:
I am working on a pre-created Drupal 8 project that has a custom module called CCA(named out of project title). I have done the below update in the .install file to add a new column to the backend via Drupal.
function cca_update_8902 (&$sandbox) {
  db_add_field('cca_findings', 'cca_topic_id', array(
    'type' => 'float',
    'not null' => FALSE,
    'description' => 'interim fields addition',
  ));

How do I update the module in Drupal after this change has been made? Can someone guide on next steps to update my custom module in Drupal so that this change will be implemented? Thanks!


texts:
E.g. node contains a product Poster for $5 and e.g. a checkbox saying "+ Cup" which is another $5. So it's two different products, how do I let user select if they want just a poster of if they want the poster + the cup, so check the box for the cup and on add to cart it adds both items?

If you create a product reference field with Unlimited, it won't let to choose multiple items, it renders as a dropbox/select list for one item to choose and add to cart.

https://www.drupal.org/project/commerce_product_kit is locked to total products set for the page in the product reference field, so it always adds both products on Add to cart, no select option.

So basically how to add 1 to 2 products on same page clicking Add to cart only once.


texts:
I want to build something like:
We have 2 type of users: staff and student.
Student logins into a drupal site, then a collection of forms presented to the student
Form type 1: Student selects a form then fill in all fields. After hitting the submit button, data will be saved as a node.
Form type 2: Similar as form type 1, except the same student visits the same form, s/he will see the previous data s/he entered.
Very similar situation for staff.
I wonder what are the basic steps I need to take.


texts: What is your way to get the fields information when using Services 3

texts:
I have a registration form with 50+ input fields. What is the best way to get form filed information to pass it to iPhone or Android developers to make a form in the mobile app?

Currently i am doing something like inspect the form with firebug and copy/paste the form to make this work.

Recently i have written some code to get the form field information.

This is the idea.

In the hook_formalter add a $form['#after_build'][]
Get the keys in $form['#after_build'][] and get the basic information.
Render the information to a item and add it to form so that i can copy/paste

But its not perfect; when the form fields like add custom modules for Registration like Logintoboggan etc i am not getting expected results.

What is your way to do it?

This is the result i expect in case of a select field

  Array
         (
                [Title] => Marital Status
                [Field Name] => field_marital_status[und]
                [Type] => select
                [Options] => Array
                    (
                     [151] => Status
                     [154] => -Divorced
                     [155] => -Married
                     [153] => -Never married before
                     [157] => -Separated
                     [156] => -Widowed

                    )

       )


texts: Is there a way to generate dummy content for custom entities?

texts:
Since the Devel module allows to generate content only for core entities:

  Accelerate development of your site or module by quickly generating nodes, comments, terms, users, and more.

Is there a module or a proper way to generate fake content for custom entities?

I mention that I found Devel contrib module that includes the Devel Contrib Generate module, which allows generating of dummy entities of any entity type, but I've not been able to figure out how to use it with D8.


texts: "drush updatedb" failes with "The provided host name is not valid for this server"

texts:
I run my site with Drupal 9.1.6 on Strato Webhosting. The site is well accessible via Webbroser either under mydomain.tld or www.mydomain.tld. I can perform a database update running update.php, but if I try the same with /opt/RZphp74/bin/php-cli vendor/bin/drush updatedb, I get this error.

The provided host name is not valid for this server

Drush version is 10.4.2.
I seem to be able to clear the cache of the site with /opt/RZphp74/bin/php-cli vendor/bin/drush cc. At least after some time Drush reports success.


texts: How to get cache metadata from nested render array when returning response?

texts:
I have a controller action that renders a list nodes and returns them, and only them. It's invoked via AJAX and the JS code just takes the result and inserts it into the page somewhere.

My problem is getting the cache metadata from the render array of nodes and passing it to the response. Here's the simplified action:

public function myControllerAction() {
  $builder = \Drupal::entityTypeManager()->getViewBuilder('node');
  // Get render array containing a few nodes.
  $nodes = $builder->viewMultiple([1,2,3], 'teaser');

  $response = new CacheableResponse();
  $response->setCacheableMetadata(CacheableMetadata::createFromRenderArray($nodes));
  return $response;
}

The problem is CacheableMetadata::createFromRenderArray() expects you to not give it a nested render array, but that's what the view builder returns. It returns an array of render arrays.

How can I efficiently extract the metadata from each node in the list and apply it to the response?


texts: How to display the other images along with popped up image?

texts:
I want to achieve the images as pop-up and also other images along with pop-up.

I have used the color box module for displaying the images as pop up.

Now, I displayed the image in pop up but i couldnt get the others images with that pop up

Like this, I want to display the other images as thumbnail under the popped up image.

And when the thumbnail image is checked, popping up image should be hidden and the thumbnail image should be shown.

Please guide me, how to do this one ?

NOTE: I have used the Test content in articles content type, and added the unlimited images in image fields. And passed the content ID in contextual filter to display the images.


texts: Product not being added to cart even logged as admin

texts:
Have a drupal commerce site.

When i click on Add to cart button through its product display it says that the product have been added but when i go to /cart the cart is empty.

No php errors, no watchdog logs, no errors in apache log

I empty cache and disable apc and boost but still i cant see product in my cart even logged as admin

I recently update core and modules, and everything went ok or i think so because it went kind of smooth

Have anyone experince something like this?


texts: Print taxonomy term field in views-view.tpl.php

texts:
Do you know if it's possible to print a taxonomy term field inside a views-view.tpl.php template in Drupal 7?

For example, you would do this:

<?php print render($content['field_example_field']); ?>

in node--content-type.tpl.php.

What would be the equivalent to get a specific taxonomy term field in views-view--name-of-view.tpl.php?

Thanks in advance!


texts:
I would like to retrieve whether the bundle of a node is supposed to default to published. I am able to successfully get the bundle of the node in question.

$bundle = \Drupal::entityTypeManager()
      ->getStorage('node_type')
      ->load($node->bundle());

However, I am unable to retrieve information about default status of the bundle. When I use Devel's dsm() function in order to see the array for $bundle, the "field" [status], which I would have thought was the value I want, doesn't change. It remains 1. I tried changing the publication status of the node in question as well as changing the default value for the content type publication status, but neither of these affect this value.

How can I get the bundle's default publication status? What am I missing?

Edit: I am also now using $bundle->get('status') to get the specific field referenced above.


texts:
I installed the Webform module on my drupal 7 install and now, when I select to create new content, I don't get asked to choose the content type (basic page, article, webform) anymore. Where is the setting for this? I need to be able to choose which content type I want to create.

Thank you!
Ron


texts: Adding Count Up module to custom front page

texts:
My end goal is to put several Count Up numbers on my custom front page. But I'm having trouble getting it implemented.
First, I installed the Count Up library (https://github.com/inorganik/CountUp.js) and put it in the libraries directory.
Then in mytheme.libraries.yml, I put
countup:
  version: 1.0
  js:
    /libraries/countup.js/dist/countUp.umd.js: {}
  dependencies:
    - core/jquery

And then in page--front.html.twig, I put
{{ attach_library('mytheme/countup') }}

0

When I flushed the cache, I got this error: "Uncaught ReferenceError: CountUp is not defined".
What am I missing here? I'm pretty weak at JS so it could be something obvious.
Thanks!


texts: Why is form api ignoring the weight that i'm giving to the action buttons? (node edit page)

texts:
So, I've implemented hook_form_alter in a custom module. I have added a button to the node edit form of a specific content type.

However, I can't for the life of me get the new button to display with the standard buttons ie save & preview. It just appears at the top of the page, regardless of the figure that i put in as the weight (I tried 100000000000000)...  Fingers crossed that this is just a 'newbie' oversight :)

Here is the code that I'm using:

function MYMODULE_form_alter(&$form, $form_state, $form_id) {
  if($form_id == 'CONTENTTYPE_node_form') {
    // Add validation for a file
        $form['field_CUSTOMFILE'][0]['#upload_validators']['custom_file_validation'] = array();

    // Add update site button to CONTENTYPE node add/edit form
         $form['actions']['update_site'] = array(
            '#type' => 'submit',
            '#value' => 'Update site',
            '#name' => 'op',
            '#submit' => array('MYMODULE_form_submit'), /* NEED this */
            '#weight' => 99,
            );
         $form['actions']['submit']['#weight'] = 101;
         $form['actions']['preview']['#weight'] = 100;

        return $form;

  }

}

These lines from above were only added today but made no difference...

$form['actions']['submit']['#weight'] = 101;
$form['actions']['preview']['#weight'] = 100;

As always, anyway pointers would be very much appreciated :)

Edit:

This question was not answered in the indicated "This question has already a answer" link above... That link explains Drupal 7 specific code, although the post isn't tagged as such... This post was specific to Drupal 6 as tagged... In fact the code in this post didn't work for me because it was using Drupal 7 code :)


texts: Field Formatter: how to know where "i'm"

texts:
I have a node type called fotogallery. In this node type there is a field of type "field collection". With hook_field_formatter_view() I create a custom output for this field.

Now, the same node type is linked to another node type via entity reference. In this case I want to create another type of output for the "field colletion" field. But how I (drupal cms) can know if I'm inside node type "fotogallery" or I'm inside an entity reference ?

Do I need to load the current node (via node_load(arg(1)) and see the "type" value?


texts: Getting a translated country name from an address field

texts:
I have an address field from which I'm getting a country code and then, using the address.country_repository service, checking the country's name.

$full_country_list = \Drupal::service('address.country_repository')->getList();
$country_code = $user->field_nationality->first()->get("country_code")->getValue();
$result['nationality'] = t($full_country_list[$country_code], [], ['langcode'=>$user->get('langcode')->value]);

This repository returns a list with the country names translated in Drupal's default language (in my case, portuguese), but I'm trying to t()-function it to translate the string into other languages.

The t() function doesn't cut it, even if I pass the langcode option.

How can I get a translated version of the list so that I don't have to translate the string with t()?


texts:
When I'm searching my site, I get this error:

  Warning: htmlspecialchars(): Invalid multibyte sequence in argument in check_plain() (line 1476 of /var/www/includes/bootstrap.inc).

What does it mean and how can I correct it?

EDIT:
The problem disappeared after migrating to webhosting server, so the problem should be something in settings in my local computer.


texts:
I created my libraries.yml as shown in Drupal 8 CSS/JS.

.libraries.yml

 general:
  version: 1.x
  css:
    theme:
      css/materialize-custom.css: {}
      css/main.css: {}
  js:
    js/materialize.min.js: {}
    js/main.js: {}
  dependencies:
    - core/jquery

My problem is that my main.js need jQuery to work.

main.js

$( document ).ready(function() {
  // Initialize collapse button
    $(".button-collapse").sideNav();
});

I get this error.

I don't understand why I have this error. What is wrong with my code?


texts:
I need to add a class name to certain labels created by Drupal's form API like this:

$form['name'] => array(
  '#type' => 'textfield',
  '#title' => 'Prénom'
);

If I use the following, the <textarea> gets a class, but not the label.

$form['name']['#attributes']['class'] = array('myClass');

I'm looking for something similar that will add a class to the <label>.


texts: how to adjust size of an existing field through api in hook_update?

texts:
I have a textfield that is part of a field-collection belonging to a content type made in a custom module.
I am looking for a way to expand the size of the field on the update hook of my module.

I've tried the following:

function spelersfiche_update_7200() {
  field_update_field(array(
    'field_name' => 'spelersfiche_va_antwoord',
    'cardinality' => '1',
    'type' => 'text',
    'settings' => array(
      'max_length' => '511',
    )
  ));
}

In this the max_length setting has been increased.
When i try to run the update for my module i get the following error:

The following updates returned messages
spelersfiche module
Update #7200

Failed: FieldUpdateForbiddenException: field_sql_storage cannot change the schema for an existing field with data. in field_sql_storage_field_update_forbid() (line 229 of D:\drupal\volley3\modules\field\modules\field_sql_storage\field_sql_storage.module).

From what i understand it says i can't change this setting for a field that contains data.
But in my case it's just to make the field larger, so any previously contained data should still be able to fit into the field.

Is there any way around this, because uninstalling and reinstalling is what i was trying to avoid since that will delete all the data contained in the field.


texts:
I am kicking the tires on Drupal 7 by spinning up a test site.

I chose the Danland theme and created various pages with URL Aliases for each, but when I create the Menu link for each, I can only enter the node in the "Path" field for the menu link and not the alias. So I can only enter "node/20" and not "about-us" (the alias for the node) in the menu.

I'd like the menu items to resolve to the aliases and not the nodes.
How do I do that?


texts: Rule to Change Webform Submission to Draft

texts:
I'm looking for a way with Rules (or otherwise I just figured that Rules would be the easiest without writing custom modules), to change the submission status of a webform from Submitted, to Draft.

Basically, I have a form that a user submits but doesn't have access to a yes/no question.  Based on a custom module, another user will have access to edit that submission and answer the yes/no question.

If that answer is no, I want to change the status of the webform from submitted, to draft so that the initial user will easily see that they need to make changes and the emails will fire again once they resubmit the form.

So in summary:
I have a form with Field A and B that gets submitted by User A who only has access to Field A.  Once that form is submitted, User B has access to the submission and can change the value of Field B, then save the submission (Rule: when a Webform submission is updated).  Depending on the value of Field B, I want to change the completed status of the webform back to it being in Draft status.

Thanks!

Module/Core info:

Drupal 7

Webform 4.16

Webform Rules 1.6

Rules 2.10


texts: How do I perform mass updates for entities? Suppose I want to publish 50 nodes at once. How should I do that?


texts:
I want to add search option to my site but I can't decide what I should use.

I am building a news site. It has a simple structure but in time there will be lot of indexed page. When somebody use the search box, they can search inside news, the categories of the news, and the authors of the news.
The search result page should show all of them like 3 blocks as in this screenshot.

I tried the Search API, but it doesn't provide these.

What should I use? Can you please give me some links for tutorials/documentations. How can I do that?

To make it cleaar, when I type "Marvel" in the search box, the result should include all nodes containing marvel and all tags including marvel (e.g. marvel's movies, marvel's show). I try to show two different blocks per node and tags in the search result page.


texts: $views->render() does not display node_path

texts:
So I made a view and Im trying to pull the results into an array (which I am json encoding and sending to javascript but thats neither here nor there) but some of the node information isnt being pulled. Specifically the node_path.

When I preview the view in the edit views page in the backend, the path shows up. But when I pull the view on the front end from my preprocess_page function the node path is not outputted.

In my view, I'm displaying the following fields:

Node: Post Date
Node: Title
Node: Teaser
Node: Type
Node: Path

And each of these fields shows up in the preview. But when I try to pull the view using the code below the path isnt output:

$blog_posts = json_encode(theme_get_view_result('front_page_blog_blocks'));

function theme_get_view_result($viewname) {
  // views_get_views_result($viewname) produces the same result as $view->result;
  // Im just showing that I tried both
 //return views_get_view_result($viewname);

  $view = views_get_view($viewname);
  if(!empty($view)){
    $view->preview();
    return $view->result;
  }else{
    return 'empty';
  }
}

what I also noticed, is that the date was output as a unix timestamp, and not the format I selected (custom, 'M j').

So the result produced in my console is:

    {"nid":"1","node_created":"1312470739","node_title":"blah blah blah this is my title","node_revisions_teaser":
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor vestibulum gravida. Proin ornare nisi non orci feugiat ut hendrerit mi venenatis. Etiam diam ligula, pellentesque et vehicula sed, ultrices at lorem. Vivamus consectetur risus nisl. Vivamus luctus volutpat dolor,","node_revisions_format":"2","node_type":"blog"},

So notice: there is in incorrect timestamp, and the node path is missing. Im a total Drupal noob so I have no idea whats going on.


texts:
i've got a database query with a join like this:

$query = db_select('node', 'n');
$query->condition('n.nid', 0, '<>')
  ->fields('n')
  ->range(0, 50);

$query->leftJoin('field_data_field_prospekt_owner','prospekt','prospekt.revision_id = n.nid');

Let's say I want to get the fields from my 'field_data_field_prospekt_owner' table in the result. How do I go about that?

i tried extending the fields function like query->fields('n,prospekt') but this throws an error.

query->fields('n')->fields('prospekt') isn't working, unfortunately. I'm getting a error:

  PDOException: SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'prospekt': SELECT n., prospekt. FROM {node} n {} LEFT OUTER JOIN {field_data_field_prospekt_owner} prospekt_2 ON prospekt.revision_id = n.nid WHERE (n.nid <> :db_condition_placeholder_0) LIMIT 50 OFFSET 0; Array ( [:db_condition_placeholder_0] => 0 ) in main() (Zeile 42 von /var/www/asvg/prospekt_iframe.php)


texts:
So I am following the book Drupal 7 Pro Development book and just completed chapter 2. I cannot access my modules admin page. Here is my menu hook. Can you please point me in the right direction.

function annotate_menu(){

 //Makes category
 $items['admin/config/annotate'] = array (
 'title' => 'Node Annotation',
 'description' => 'Adjust node annotation options',
 'position' => 'right',
 'weight' => -5,
 'page callback' => 'system_admin_menu_block_page', //function from system settings.
 'access arguements' => array('administer site configuration'), //who can see this.
 'file' => 'system.admin.inc', //file where callback function is called
 'file path' => drupal_get_path('module', 'system'), //get system module path
 );

 //Makes menu under category
 $items['admin/config/annotate/settings'] = array (
 'title' => 'Annotation Settings',
 'description' => 'Change how annotations behave',
 'page callback' => 'drupal_get_form', //function called
 'page arguements' => array('annotate_admin_settings'), //formID which is function name in annotate.admin.inc
 'access arguements' => array('administer site configuration'), //who can access settings
 'type' => MENU_NORMAL_ITEM,
 'file' => 'annotate.admin.inc', //file where formID is located.
 );

 return $items;
 }


texts: Translate custom string from programatically defined block

texts:
Alright, this one is probably easy but I found online documentation only little helpful and couldn't figure it out myself.

I run a custom module that renders a custom block programatically via function hook_block_view(). Assume that $block['content'] = 'Hello';. The custom string 'Hello' does not appear in the list of translatable strings (config/regional/translate/translate) but I want to display it in, say, Spanish ('Hola') when the site language is set to Spanish.

How do I translate it / make it appear in the list?


texts:
Within an instance of hook_submit (for a custom form), I'm trying to iterate over a list of nodes, updating each of them. The general outline is

$x = node_load_multiple($nids);
$data = array(--some data--);

foreach ($data as $row) {
  $node = $x[$row['nid']];
  $node->field_some_field['und'][0]['value'] = $row['some_field'];
  node_save($node);
}

drupal_set_message('Nodes updated');

The problem I'm having is that rather than looping through the whole data array and then posting my confirmation message on the form page, Drupal updates the first node, exits the loop, and redirects to the user's home page with the message 'contenttype TITLE updated.'

Possibly relevant: I could have sworn this code block worked when the site was 7.2, but after updating to 7.23 I'm seeing this.


texts:
I have a multistep form with two submit handlers (save/submit), when "Save" is clicked I want to remove any validation applied to the node and have it's contents saved.

In my custom validation hook I am checking both the triggering_element and clicked_button for the correct button, I'm then removing  limit_validation_errors however this doesn't work. According to the api documentation it should though.

function test_workflow_form_validate($form, &$form_state) {
  if ($form['#form_id'] != 'test_application_assessment_form') {
    if ($form_state['triggering_element']['#value'] == 'Save') {
      $form_state['triggering_element']['#limit_validation_errors'] = array();
      $form_state['clicked_button']['#limit_validation_errors'] = array();

      $form_state['buttons'][1]['#limit_validation_errors'] = array();
      // Remove validation.
    }
    else {
      // Add in default validation.
      //$node = (object) $form_state['values'];
      //node_validate($node, $form, $form_state);
      //entity_form_field_validate('node', $form, $form_state);
    }
  }
}

I've removed the default node validation so my custom one is the only one present. Is there something else I'm missing?


texts:
I am using the panopoly distribution. I would like to create different subsites using organic groups and spaces module.

I have custom content type such as news and publications.
So far I have successfully triggered a space when I go to example.com/groupA/ only the news from groupA is shown.
All thanks to filters in Views where I filtered news content type to belong to current space.

Now I am trying to have a different landing (home) page for each sub site (group).
But since it's a panels page whenever I try to change it, it gets changed every where.

If only there was a way to load different content and different layout for the same landing page based on current space?


texts: Preventing a menu item from being pressed twice

texts: I have a menu item that shows up on one of my nodes and when pressed it will trigger a somewhat long process. I would like to make it so that the user is not tempted to press the menu button again but I can't quite figure out how to do that. Is there a good way to put an overlay over the Drupal window to explain that the process will take some time and prevent another click? If not, would it be possible to show an alert dialog from the menu callback, warning the user this will take some time.


texts:
I want my module (events) to have its own template files but extend the base theme currently enabled.

hook_theme():

function events_theme($existing, $type, $theme, $path) {
    return array(
        'test_events' => array(
            'variables' => array('testingvar' => 123),
            'template' => 'test_events',
            'path' => drupal_get_path('module', 'events') . '/templates',
            'base hook' => 'mytheme'
        )
    );
}

In my menu callback I have:
print theme('test_events');

This outputs the contents of the template file, but it doesn't recognize the current theme that is enabled. Is there anyway I can extend the themes layout?

Edit: current situation:

Abstract of  my directory structure:

Modules\
-custom\
--events\
---templates\
----test_events.tpl.php

Themes\
-mytheme\
--templates\
---test_events.tpl.php

events.module:

function events_theme($existing, $type, $theme, $path) {
    return array(
        'different_event_hook' => array(
            'path' => $path . '/templates',
            'template' => 'test_events'
        )
    );
}

menu callback:

print theme('different_event_hook');

Result renders from module template file, if I change different_event_hook to test_events it renders from the theme template file.


texts: no ajax response using local wamp server

texts:
I'm blocked on a very problematic error.

I have to manage a drupal 7 site, production running on LAMP server and there is a little bug that I have to fix. I don't develop this site, just I am the new webmaster.

To develop new content or test some fixature, I have a local copy of the site ( Win8, WAMP2 ).

The problem is that I have to create some contents on my local version of the site to reproduce the problem but when I click to add field to my content. It send an ajax request and I receive an empty response and my page don't display the html form that it should display. I precise that I have a response not an error but content of it is empty.

Ajax request works on production server.

I try to trace the request using firebug but I don't found name of the callback function. Request is send to http://127.0.0.1/system/ajax. The page is a form created by ajax.

What can be the source of this problem ? Maybe a difference of configuration from apache, in this case which parameter could be the responsible ?


texts:
I am currently working with drupal 7 and I'm using page manager to edit different pages on the site.

I tried creating a mini panel and adding it to a region, but i do not know how to add content panes to it. Is it possible to use content panes as blocks and add then to regions ? the reason I wanna try doing this is i don't want to choose a layout from page manager and add content panes to it instead i wanna add then to the drupal regions.


texts: Drush output comes with color in a directory root while it comes without color in another

texts:
I have set up two drupal virtualhosts in a VPS server under two different users. I had installed these at two different times so am not too sure about the specific install steps for Drush that I used. However what I see is that inside one of the drupal folders, drush commands come out with color output while the other comes without color.

That looked like a config file issue. I then tried to see how I was setting $PATH for the two.

In the one where Drush colors were coming up fine, the local vendor folder inside the drupal folder was included (actually the one outside - I am using the drupal scaffolding with composer based installs) in $PATH.

In the one where Drush colors were not coming up, the global vendor folder in the users home was included in the path.

export PATH="$HOME/.config/composer/vendor/bin:$PATH"

In the one where Drush colors were coming up, the vendor folder in the Drupal folder was included in the path.

export PATH="$HOME/www/domain/vendor/bin:$PATH"

drush status showed that drush command was being run from the vendor folder in the drupal installation in both cases.

I have seen this in the past but thought I should get to the bottom of this, this time.

Thanks in advance for your help.


texts:
When submitting a message in my site contact form in Drupal 8.x
I have printed a message

print_r($message['body'][1]);die;  //in my modulename_mail_alter(&$message)

I get the following message

Drupal\Core\Render\Markup Object
(
    [string:protected] => Message

   Test Message

     First Name
               Rahul

     Last Name
               gaikwad

)

How can I change the body content of the email.


texts: How to overwrite layout settings in Drupal Zen sub theme?

texts: How to overwrite layout settings in Drupal Zen sub theme so that it can be changed by the sub theme itself? I found that in Zen core theme there is a comment as "Only toggle the layout for the main Zen theme". Does this mean we cannot enable this setting via our sub theme? Can anyone assist me on this?


texts: How can I theme "Error generating image." error 500's in Drupal 7?

texts:
I wish to theme the error pages generated by the image module in drupal 7, I'm not sure it can be done as this is the code that runs when imagecache fails to generate a style:

else {
    watchdog('image', 'Unable to generate the derived image located at %path.', array('%path' => $derivative_uri));
    drupal_add_http_header('Status', '500 Internal Server Error');
    print t('Error generating image.');
    drupal_exit();
}

I'm not intending on having a whole themed page, but something that isn't quite as ghastly as white screen with just "Error generating image." on it. Rather at least some way for a visiting to navigate away from it and remain on the site if they wish. It would be even better if I could return a 404 instead.

This is of course, without hacking core. So anyone have any ideas or have I missed something?


texts: Add Block to Content but set it to appear after the node content?

texts:
I have added a block to appear in the Content region, however it appears above the content of the node for French, but below the content of the node for English - which is strange as (as far as I know) they're both the same content type and should be the exact same templates.

Although the block name (and /url) is the same as the English nodes' url so maybe that's causing some problems which causes the block to appear after the nodes' content?

Is there any way to specifically define that you want a block to appear after the nodes' content? i.e. through weighting inside the module that adds the block?

EDIT:
I've set the weighting on the blocks admin page, it's +15 for the block and the Main Page Content is -17. I also dragged it out of that region then back (without saving) before saving but still appears above for the French node and below for the English node...

EDIT 2:
Seems to be a problem with the cache, at least a localhost version showed same error until I cleared cache... only problem is I don't have access to clear cache directly, could I code something in the module to clear the cache?

EDIT 3:
So I have access to clear cache now, except the block is still showing up above for the French node and below for the English node... even though in Block Structure, the block is below the Main Page Content.


texts:
Actually, I have a content type with 2 fields, image field (multiple) which will contain some pictures and an attachment field (accept only one file) which is file of type PDF.

I have a view where I put my gallery and each picture opens in a colorbox. The PDF file (actually global pdf for all images) is only a button.

There was a change and the new requierement is: "For every image that goes up, must have its own PDF. Every image should have its own associated file."

Another requirement is, if the image is opened on a colorbox also appears a button (in the colorbox) which displays the PDF associated with the corresponding image.

Any idea???
Sorry for my bad english.


texts: How to store user specific data after registration?

texts:
Let us say you want to collect a bit more information about users during registration.
For example, instead of just username and email, I also want place of residenc. How do I collect and store this data per user?  At the end of the day I want to end up with place of residence of each user by doing an easy query.

PS: Currently, I have added extra fields to the form user_register_form, but I don't know how to associate this data with my new user because I don't have the new user id.

What is the right approach? Because I think this should be a trivial Drupal exercise, but am sweating :).

I am using Drupal 7.1.

// implements hook_form_alter()
// user-register-form id the id in html but id that works in php is user_register_form
function mymodule_form_alter(&$form, &$form_state, $form_id) {
  switch($form_id) {
    case 'user_register_form':
      $form['placeofresidence']= array(
        '#title'=>'where do you stay?',
        '#type' => 'textfield',
        '#required' => true,
      );
      $form['#submit'][]='mycustommodule_submit'; //add to callback submit list
      break;
  }
}

function mycustommodule_submit($form, &$form_state) {
  $stayswhere=$form_state['values']['placeofresidence']; // how do I associate this with new user?
}


texts:
I have a image field and use on cycle.

field.tpl.php:

<?php
?>

<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
  <?php if (!$label_hidden): ?>
    <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;

  <?php endif; ?>
  <div class="field-items"<?php print $content_attributes; ?>>
    <?php foreach ($items as $delta => $item): ?>
      <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?>

    <?php endforeach; ?>

My field items sorting default alphabetical but i want random. How can i do this?

EDIT: I find this codes, it valid for me? And how can i use this code for my field?

function my_theme_preprocess_field(&$variables, $hook) {
 if($variables['element']['#field_name']=="field_project_release_packages"){
 usort($variables["items"], "_my_theme_sort_package_list");
 }
}

function _my_theme_sort_package_list($a, $b) {
    return $a["#title"] > $b["#title"];
}


texts:
i'm currently using the Imagick module for Drupal 8 and the imagick php extension on the server. Whenever I try to resize images with this tool, using the settings below, I get a really down sampled version of the image, as if the all the meta data is still stripped although I specify to keep them.

As seen below the image gets really pixelated and sort of "over saturated". However I got this to work on a local server using the same settings. I just can't get it to work properly on the remote.

Setting:

Desired result:

The result I get:

So far i have tried already to switch off the meta tags, but this seems what was originally the problem on my localhost. I have also tried some of the other filters and changed the quality, but it all doesn't seem to matter. So what am I doing wrong, or what could I try to get the desired result?


texts: How do I move logic that generates HTML content in a foreach loop, to a pre-processing function?

texts:
On a module's .tpl file I have the following logic:

  <?php foreach ($element['store']['openingHours']['openingDays'] as $day_key => $opening_day):
   $i++;
   $i = ($i === 7 ? 0 : $i);
   if ($dayofweek == $i):
   if (empty($element['store']['openingHours'][$day_key . 'Open'])): ?>

      Closed today

   <?php else: ?>

     Open today until <?php print $element['store']['openingHours'][$day_key . 'Close']; ?>

   <?php
    endif;
    endif;
    endforeach; ?>

The code simply gets the current day-of-the-week from the server and loops through an array of the the store's opening days, then just prints either 'Closed today' or 'Open today'.

I've been told this should be here and that I need to move this logic to a preprocess function on my theme's template.php

But I'm unsure as to how to get the data back to the .tpl file where I can then apply it to the HTML.

Sorry if it's a broad question, but would any know what I should be doing here?


texts: Auto fill billing information in cc avenue payment

texts: I am using Commerce Cc Avenue as a payment gateway for my eCommerce site. During checkout step user enter his billing information. In the next step it verifies his/her order and redirects to Cc avenue payment gateway, there it asks user billing address again. I want to auto fill the user billing address which he/she enters in previous step. Is that possible to do?


texts:
The Drupal 7 site we've produced is intermittently experiencing slowdown on page load. Using Devel I've pinpointed the slow down to queries generated by two similar Views and the SQL generated.

The query usually runs in less than 20ms but intermittently, perhaps every hour or two will hang causing the same queries to run in 3-4 seconds each. It will continue to run mostly slowly for maybe 15mins before returning to normal. I have site caching disabled whilst I debug. Even without caching it's lightening fast when running ok.

Below is one of the queries. Could anyone please shed any light on what might be causing this delay? Many thanks.

 SELECT webform_views_leave_a_comment_17.club_code AS
 webform_views_leave_a_comment_17_club_code,
 webform_views_leave_a_comment_17.subject AS
 webform_views_leave_a_comment_17_subject,
 webform_views_leave_a_comment_17.comment_average AS
 webform_views_leave_a_comment_17_comment_average,
 webform_views_leave_a_comment_17.comment AS
 webform_views_leave_a_comment_17_comment,
 file_managed_webform_views_leave_a_comment_17.filename AS
 file_managed_webform_views_leave_a_comment_17_filename,
 webform_views_leave_a_comment_17.course AS
 webform_views_leave_a_comment_17_course,
 webform_views_leave_a_comment_17.greens AS
 webform_views_leave_a_comment_17_greens,
 webform_views_leave_a_comment_17.facilities AS
 webform_views_leave_a_comment_17_facilities,
 webform_views_leave_a_comment_17.hospitality AS
 webform_views_leave_a_comment_17_hospitality,
 webform_views_leave_a_comment_17.comment_date AS
 webform_views_leave_a_comment_17_comment_date,
 webform_views_leave_a_comment_17.comment_username AS
 webform_views_leave_a_comment_17_comment_username,
 webform_views_leave_a_comment_17.value AS
 webform_views_leave_a_comment_17_value,
 webform_views_leave_a_comment_17.club_reply AS
 webform_views_leave_a_comment_17_club_reply FROM webform_submissions
 webform_submissions LEFT JOIN webform_views_leave_a_comment_17
 webform_views_leave_a_comment_17 ON webform_submissions.sid =
 webform_views_leave_a_comment_17.sid INNER JOIN webform_submissions
 webform_submissions_webform_views_leave_a_comment_17 ON
 webform_views_leave_a_comment_17.sid =
 webform_submissions_webform_views_leave_a_comment_17.sid LEFT JOIN
 file_managed file_managed_webform_views_leave_a_comment_17 ON
 webform_views_leave_a_comment_17.upload_image =
 file_managed_webform_views_leave_a_comment_17.fid LEFT JOIN node node
 ON webform_submissions.nid = node.nid WHERE ((
 (webform_views_leave_a_comment_17.club_code =
 :db_condition_placeholder_0) )AND(( (node.title LIKE
 :db_condition_placeholder_1 ESCAPE '\\') AND
 (webform_views_leave_a_comment_17.comment_status LIKE
 :db_condition_placeholder_2 ESCAPE '\\') ))) LIMIT 25 OFFSET 0


texts: Delete content problem in Multilingual site with module Global redirect

texts:
I have a multilingual mini site with 2 pages/nodes with 6 languages enabled. I don't have the translation for some language on some pages. I was hoping global redirect would help me with this by redirecting the user to the default language when the translation doesn't exist. This part only works partially but this is not not my concern for this thread.

At the beginning I added missing translations by putting the English version instead. When I learn the existence of the module Global Redirect I decided to delete those missing translation. I downloaded and activated Gloabl Redirect and started to delete the nodes which had a bad version. But when you do so, it does not delete the node of the language you selected, it deletes the default language node!!

So in other words if I have a node in English (default) and go to Content and select the delete link of the Spanish translation it will delete the English version and keep the Spanish version!! A by-product of this is to change the default language to the next on list...

Is it a know bug? What can I do to fix this other than NOT using Global Redirect? Did I do something wrong?


texts: how to deselect a taxonomy already subscribed while submitting a form

texts:
I have a taxonomy based subscription form which alerts user when we have new posts published under subscribed taxonomy.

Currently, if a user is subscribed to 2 taxonomy, say A and B, and the user tries to subscribe to additional taxonomy, (say C and D), but when selecting chooses A again, the alert says “You are already subscribed to A” and the user has to select again. Instead it should recognize C and D as new taxonomy and subscribe the user to those.

Link:http://codepad.org/rKyZ7nq0


texts:
I tried to programmatically insert few taxonomy terms.

$arr = array('term1', 'term2', 'term3', 'term4');
foreach ($arr as &$value) {
$term = new stdClass();
$term->name = $value;
$term->vid = '5';
$term->parent ='122';
taxonomy_term_save($term);
}

This work nice.After i try to create with hand one more term but i got this error

Notice: Undefined index: href in menu_local_tasks() (line 2052 of /includes/menu.inc).

The same error i got after i tried to edit any of the taxonomy term added with code.

I clear cache.
Drupal 7.