texts: How to import XML (using an API) via Feeds module?

texts:
I have a client who uses a CRM that allows us to download data in XML format via an API. If I create a URL such as:

http://www.crmwebsiteurl.com/API/service.asmx/APISelect_XML?strCompanyAccount=client_name&strLogin=client_user_name&strPassword=client_password&strSessionID=&strTable=ClientTableName&strFields=ClientField1,ClientField2&strWhereClause=&strGroupByClause=&strHaving=&strOrderBy=

(and yes, all those empty queries/values in the URL must be as they are or the request will fail)

this URL will load an XML document in my browser, with all the content. I can then save that page (which automatically saves as an XML document) and then use Feeds and XML Xpath parser to import the data into Drupal, which all works perfectly.

The trouble is, I want to import the data directly, without having to download and save the XML file to my desktop. I know Feeds has an HTTP Fetcher, but I've tried what seems like every possibly configuration option (which really isn't that many) and I can get it to "successfully" import, but it always says there are no nodes to import (even if I've deleted all my nodes just to be sure). Obviously its not reading the XML file right.

I've seen other ways API's like to be authenticated and some tutorials on how to to those, but this (seemingly) simple authentication method (if a bit insecure) I haven't seen any tutorial on. And if I just use the entire URL (with the query, username, password, etc) in the URL field (Enter a Feed URL), it just always says "There are no new nodes".

I've also played with Feeds Import, Feeds HTTPFetcher AA, Web Service Client - but still haven't seemed to find anything that I've been able to make work.

Is this a unique situation? Or most likely I'm simply doing something wrong? Is there a tutorial I didn't come across that could help me?


texts: Store the Logged in Users's Country in the DataBase

texts:
How could I store the country of the registered user, when he/she logs in. I am hoping I could store it in the DB to later retrieve it within the reports.

I am using Drupal 7.

Many Many Thanks.


texts: How can I list the current user's orders with Drupal Commerce?

texts:
I need a View which shows the list of all orders belong to the currently logged in user.

I looked at the Administrators Order View, there are some stuff with Commerce-Line Items but I couldnt figure out how they made that


texts:
I have enabled Quick Edit module on my Drupal 8 website and it's working ok, I have edit link in the toolbar to show all edit icons for edit menu on page.

Problem is in new user role. I have new user role and I enabled Access in-place editing permission for users in this role, but there is no option to edit anything on the page or edit link in toolbar.

What I'm missing? Is there some additional permission that I need to grant for this role (they already have permission to administer blocks)?


texts: How do I create a route to a raw text file

texts: I'm working on a Drupal 8 module, and I would like to include a couple of text files, each of simulated json data, as examples. How would I include these files in my module and create a route in the module.routing.yml file that would tell Drupal that when a visitor comes to mysite.com/examples/json1 to just print the text file (json data) as-is?


texts: How to add constrain validation on entity_create

texts:
So in my BaseFieldDefinition I have this below

 $fields['name'] = BaseFieldDefinition::create('string')
  ->setLabel(t('Name'))
  ->setDescription(t('The name of the Crypto entity.'))
  ->addConstraint('UniqueField')

And I was hoping this would make this "name" field unique when creating new enteties. It does when I try to do that in UI, but when programmatically making new entities it is just ignored.

 $crypto = entity_create('crypto', array(
  'name' => "Dai",
  'status' => '1',
));
$crypto->save();

So should I use some other method for creating entities or do I need to add some manual validation here?

Also extra question, how do I find list of "addConstraint" values that are present in core?


texts: Why D7 creates two tables when i add one custom fields in user registration?

texts:
I created few custom fields for user registration in Drupal 7.

When I add the "First name" field, two tables are created: field_data_field_first_name, and field_revision_field_first_name.

Why are there two tables, if they contain the same data?


texts: Hybridauth facebook and google login not works in live server

texts:
I am using the HybridAuth Social Login for social media login for my website. The login works in my local server but the user profile picture is not fetched.

But in live server nothing works, it just returns some message like so:

  Closing..

I also changed my website url in Facebook and Google URL field for live server, but still it's not working.

Does anybody know what I missing here?


texts: Count the number of content flagged by logged in user

texts:
I want to get the number of items (content) flagged by the logged in user.

<?php
  $flag = flag_get_flag('flag1');
  print $flag->get_count($nid);
?>

The above line would display the total number of times that content is flagged. How can i get number of items flagged by the logged in user. Lets say user A has flagged Content 1, Content2 and Content 3. Then the output needed is something as:

Number of Items flagged by [current:user]: 3

Thanks


texts: Create a view to display last browsed content

texts:
I want to create a view to display last browsed content by the user. My site has a lot of content and I want to create a view, either a page or a block, to show the last browsed content by the user. That view should show the last browsed content first followed by rest. Say for example, content A was browsed 10 seconds ago, content B 10 minutes ago and content C was 1 hour ago, then the view should list them in the order: A    B   C.

Thanks


texts:
I'm probably going to need to use the PathAuto module for a current project. While using it in development, as admin, the site slowdown during changes is insane.

Is PathAuto a big memory sink, and are there ways to mitigate this?


texts:
I'm trying to implement the jquery chosen library with the image-select plugin in Drupal, but i can't get the element to render correctly. The example page uses jquery 3 and Drupal 8 does not.

Did some reading but i still wonder about:

At what point will Drupal 8 support jQuery 3?


texts: Dont want to redirect after registration, possible?

texts:
I have a lightbox pop up when a link is clicked to sign up for the site but, after signing up i don't want them to redirect to their user profile page, I need them to stay on the same exact page. Is this possible?

I tried login destination but that feature only works for the login not registration.


texts: how to configure drupal settings to be available to visualize the available variables?

texts:
how must drupal local settings be configured to display available variables using IDEs or other tools ?
I guess this is xdebug and phpstorm but i don't know how to configure it if i don't have full admin access to the server.


texts: In drupal 7 how to group fields of a view?

texts:
I have a view to display latest 10 blog pages.
1. I have a title field
2. I have a author field

now I need to group all the titles in one div and all the author in another div.

But views results always have a nested result where respective node's title and author name are together in a same div. Is there any way to separate them?


texts: Drupal 6 APC with domain access module not working for (sub-)domains

texts:
I've recently enabled APC in my environment and using it with cache backport and APC beta 7.x-1.0beta3 which is a backported version for D6 modules respectively in site running drupal 6.22 which uses [domain access module]. The APC is being put to good use as I'm able to observe better page load times on subsequent requests and good number of hits in the System Entries of caching. However the other sites do not show any such improvement and apparently are not cached altogether, I have my domain settings included at the end of the settings.php and the cache related at the beginning, as using the domain access include in front like this suggestion only seemed to mess up the APC.

$thishost = $_SERVER['HTTP_HOST'];
$site_arr = explode('.', $thishost);
$sitename = $site_arr[1] . '_';
$conf['cache_inc'] = 'sites/all/modules/cache_backport/cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['session_inc'] = 'sites/all/modules/cache_backport/session.inc';
$conf['cache_prefix'] = $sitename;
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;
$conf['cache_default_class'] = 'DrupalAPCCache';
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_block'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
$conf['cache_class_cache_content'] = 'DrupalAPCCache';
$conf['cache_class_cache_filter'] = 'DrupalAPCCache';
$conf['cache_class_cache_form'] = 'DrupalAPCCache';
$conf['cache_class_cache_menu'] = 'DrupalAPCCache';
$conf['cache_class_cache_page'] = 'DrupalAPCCache';
$conf['cache_class_cache_pathdst'] = 'DrupalAPCCache';
$conf['cache_class_cache_pathsrc'] = 'DrupalAPCCache';
$conf['cache_class_cache_session'] = 'DrupalAPCCache';
$conf['cache_class_cache_session_user'] = 'DrupalAPCCache';
$conf['cache_class_cache_update'] = 'DrupalAPCCache';
$conf['cache_class_cache_users'] = 'DrupalAPCCache';
$conf['cache_class_cache_views'] = 'DrupalAPCCache';
$conf['cache_class_cache_views_data'] = 'DrupalAPCCache';
.
.
.
/** domain access include file **/
include './sites/all/modules/domain/settings.inc';

My knowledge and hands-on with APC is quite limited and I'm uncertain how to proceed further into this... Any insight/suggestions on this would be appreciated.


texts: When a patch fails testing because it doesn't apply, and the error reads "Ensure the patch applies to the tip of the chosen code-base." what does this mean?


texts: How to add code logic to Display Suite fields without PHP in Drupal 8? Twig?

texts:
Using Display Suite in Drupal 7 I can easily add PHP logic to any custom Display Suite Field. In Drupal 8 PHP is not allowed. How can I program logic in Display Suite fields in Drupal 8?

As an example, I'd like to use a simple if/then statement to show/hide a node field. I have tried embedding Twig into the field but it does not execute. It just renders as plain text.

This is my sample code {# This is a test comment. #}


texts:
So far, I came across these 3 functions in Drupal 7, but I am not really sure what the difference between them is, and which is more appropriated to get the node ID in a block preprocess function.

menu_get_object()
menu_get_item()
drupal_lookup_path()

Can you give me any insight?


texts: Getting the values and url of an entity reference field using entity query then store it inside a variable

texts:
I'm trying to figure out how I can output the values and url of the entity reference field values and display them inside the twig. Here is a sample of the code that I have constructed. I can't seem to find out what else is missing

        // Entity Query for Academic Experience Entity Reference Field
        $academicExperience = $query->get('node')
                                    ->condition('status', 1, '=')
                                    ->condition('type','programs')
                                    ->sort('created')
                                    ->execute();

        foreach ($academicExperience as $key => $academic_menu) {

             $academicNode = _nodeLoad($academic_menu);

             //Entity Reference Field
             $variables['academic_menu'][$key]['menu'] = $academicNode->get('field_academic_experience_ref')->value;
        }

                {% for academic in academic_menu %}

                    <span>{{ academic['menu'] }}</span>

                {% endfor %}


texts: Module Redirect - fresh install not working

texts:
I have installed Redirect module on my site and created a redirect from one url to another, but it's not working at all. 404 error page is always returned.

I tried to reinstall it, reenable it, tried the dev version of module, but nothing changed.
There are no errors or warnings in site log.

Any suggestions?


texts:
I'm looking to add a plugin for Views to provide some custom functionality in the footer of a view.

First, I created the following in my_module/src/Plugin/views/area/MyPlugin.php:

namespace Drupal\my_module\Plugin\views\area;

use Drupal\views\Plugin\views\area\AreaPluginBase;

/**
 * Defines a views area plugin.
 *
 * @ingroup views_area_handlers
 *
 * @ViewsArea("my_plugin")
 */
class MyPlugin extends AreaPluginBase {

  /**
   * {@inheritdoc}
   */
  public function render($empty = FALSE) {
    if (!$empty || !empty($this->options['empty'])) {
      return array(
        '#markup' => 'test footer content',
      );
    }

    return array();
  }
}

When that didn't work on its own, I realized I needed to declare the plugin in my_module.views.inc:

/**
 * Implements hook_views_data().
 */
function my_module_views_data() {
  $data['views']['my_plugin'] = array(
    'title' => t('My Plugin'),
    'help' => t('My plugin description.'),
    'area' => array(
      'id' => 'my_plugin',
    ),
  );
  return $data;
}

With that added, I can get as far as seeing the plugin available for selection in an area under the Views admin screen. However, when I select the checkbox for it and click Apply, the button text changes to "Add and configure footer" but it doesn't move to the next step in the process.

I've had this happen when writing custom block plugins; the system don't let me place a block when the plugin has something wrong with it. Any thoughts as to what I have here that is wrong?


texts: I would like to duplicate the default product layout grid in a Commerce Kickstart2 site

texts:
thanks for looking at my post!

I have a Drupal7 Commerce Kickstart2 site.  I recently cloned the default products page so I can create a new page with the same layout.  It worked great except that the product grid that displays on the original default products page doesn't show up on my new page. Instead I have a page where the products just list vertically.  How do I fix that?

Here are the links to the two pages:

https://www.subcitizen.com/products

https://www.subcitizen.com/ames-bros-m-12.html

Thanks so much for any and all info!  I really appreciate it!

Jason


texts:
For custom content type page I used this:

function MYTHEME_preprocess_page(&$vars, $hook) {
    if (isset($vars['node'])) {
      // If the node type is "blog_madness" the template suggestion will be "page--blog-madness.tpl.php".
      $vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type;
    }
}

So now it means I can use page.tpl.php for my custom content type pages. So for the default Basic Page the template page is page--page.tpl.php and I did test it and it works. Except this:

I am trying to render some field outside . So I used this: <?php print render($content['field_banner']); ?> right outside <div id="content" class="column" role="main"> but it's not printing.

I was told this has something to do with node_load. But I'm not experienced with that.


texts: Progress Bar to prevent repeated WebForm Submissions?

texts:
I'm getting duplicate webform submissions from what I call "Happy Clickers". I would like to implement a progress bar when someone submits a webform to prevent them from clicking multiple times. I tried the pgbar module, but it's not the solution that I am looking for.

Can anyone recommend a Drupal module to accomplish this? I'm using Drupal 7.

Thanks-in-Advance,

John


texts: How to save multi date and time in node programmatically?

texts:
I want to save multi Date value in a node programmatically.

$node->field_event_date['und'][0]['value'] =?;
$node->field_event_date['und'][0]['value2'] =?;

getting the below value after print the form_state

[field_event_date] => Array
                        (
                            [und] => Array
                                (
                                    [0] => Array
                                        (
                                            [show_todate] => 1
                                            [value] => Array
                                                (
                                                    [date] => 07/02/2015
                                                    [time] => 10:30AM
                                                )

                                            [value2] => Array
                                                (
                                                    [date] => 07/02/2015
                                                    [time] => 12:30PM
                                                )

                                        )

                                )

                        )

Getting error

$node->field_event_date['und'][0]['value'] =
    $form_state['input']['line_item_fields']['field_event_date']['und'][0]['value']['date'];

$node->field_event_date['und'][0]['value2'] = $form_state['input']['line_item_fields']['field_event_date']['und'][0]['value2']['date'];

But i need both date and time. I think i need to combine date and time and convert it into time stamp to save but do not understand how to combine and convert.


texts:
This is my code :

$form['how_many'] = [
  '#type' => 'checkboxes',
  '#required' => true,
  '#options' => [
     '1' => t('one'),
     '2' => t('two'),
     '3' => t('three')
  ],
  '#title' => t('How many')
];

I want to get the checkbox values.

When I do $form_state->getValue('how_many');, I get an array with filed value as well as non-filled as 0.

If i do $form_state->getValue('how_many[1]');, I get nothing and if I do $form_state->getCheckedCheckboxes('how many'), the page shows nothing.


texts: The operators "Is one of etc" not working with exposed filters

texts:
The "Is one of etc" operators do not seem to reduce the result set on exposed filters. So for example if I have all fruits and select only mango and apple with "is one of" - The result set only shows mangoes and apples if I do not expose the fruit filter. But if I expose the fruit filter, it shows all the fruits.  My view is based on a search index configured with search API.

Is this expected behaviour or am I missing something?


texts: All my Js are called in the body, how can I fix that situation?

texts:
I a have a drupal 6 website to fix. All the scripts are called in the body, even with the scope value set to "header" or "footer" in the drupal_add_js function.

It's a problem because some script are called before Jquery and doesn't works.

What i want to do is :

-> Call each script in the proper place (header or footer)
-> Call the scripts in correct order

Drupal do it well on my other sites, so i have to found what generate that situation.

So my question is : how can i test my website to find the problem? Do you have idea, suggestions? Do you have ever meet that situation? Thx you.


texts: drupal commerce - when adding to cart on review page, get redirected back to checkout

texts:
I am using Drupal commerce. For particular reasons, I found it necessary to programatically add items to the cart one the review page. The problem is: when I do this, I get redirected back to the checkout page, which I don't want. Here is my code:

foreach($registrants as $key=>$registrant) {  //for each additional registrant in the event order object
          if($key == 0 && $memberStatus == "Member") { //the first additional registrant gets the member price free, if the applicant is a member
            //$line_item = commerce_product_line_item_new($product, $quantity);
            //$line_item = commerce_cart_product_add($event->product_id, $line_item, TRUE);
            commerce_cart_product_add_by_id($memberGuestId);
            $order = commerce_order_status_update($order, 'checkout_review', FALSE, TRUE, t('Additional registrants have been added to the cart'));
            drupal_goto('checkout/' . $order->order_id . '/review');
          }
          else {
            commerce_cart_product_add_by_id($nonMemberGuestId);
            $order = commerce_order_status_update($order, 'checkout_review', FALSE, TRUE, t('Additional registrants have been added to the cart'));
            drupal_goto('checkout/' . $order->order_id . '/review');
          }
        }

I even tried forcing it back to the review page with a goto, and no luck. What is happening here?


texts:
How do I print breadcrumbs on page.html.twig?

I tried {{ breadcrumb }} but it's not working.


texts: New URL for the node overrides the URL of existing node using pathauto module

texts:
I'm using Pathauto module to set the URL for the nodes in my site. I have already created about 20,000 nodes in my site. Usually, the Pathauto module doesn't allow to the users to create the node with existing URL by giving the error as "Path already in use". But in my case, I can change the URL of a node with an existing URL of a node. For example parks located in same country,

Gandhiji Park - /gandhiji-park (located in state1)

Gandhiji Park - /gandhiji-park-0 (located in state2)
I can change the URL of the park in state2 as /gandhiji-park and the node is saved in that URL.

If I search for gandhiji park in state2 the search filters out the park but the URL took me to park in state1.
Can anyone help me in this?


texts: How to create a email notification to subscribers and the author who posted a comment programmatically in drupal 7?

texts:
I want that if a user subscribe to a comments & post that has been posted by an author,  so how i can send mail notification to both the author and the subscriber at the same time.
I want that author should get a notification that he has some comment on his post.
and the subscriber that author has posted some status or post.

    <?php
/*
 * Implement hook_menu()
 */

function comment_notification_menu(){
  $items=array();
        $items['admin/customize'] = array(
          'title' => 'Send Comment notifications',
        'discription' => 'Admin will send notification to user about updates',
        'type' => MENU_NORMAL_ITEM,
        'page callback' => 'drupal_get_form',
        'page arguments' => array('comment_notification_form'),
        'access arguments' => array('access adminstration page'),
        'access callback' => TRUE,
          );

  return $items;
}

/**
 * Form Structure
 */

function comment_notification_form($form, &$form_state){
  $form=array();
  $form['send_mail_from']=array(
    '#title' => 'Send Mail From',
    '#discription' => 'To whom you want to send form',
    '#row' => 5,
    '#columns' => 10,
    '#type' => 'textfield',
    //'#required' => TRUE,
    '#default_value' => variable_get('send_mail_from'),
    );
//here the admin can wite subject for the mail.
  $form['mail_subject']=array(
      '#title' => 'Subject',
      '#discription' => 'the purpous of this mail',
      '#type' => 'textfield',
      '#size' =>149,
      '#maxlenght' =>200,
      '#required'=>TRUE,
      '#default_value' => variable_get('mail_subject'),
    );
  $form['mail_body']=array(
      '#title' => 'Body',
      '#discription'=>'the body of your mail.',
      '#type' => 'textarea',
      '#row' => 20,
      '#columns' => 50,
      '#required' => TRUE,
      '#default_value' => variable_get('mail_body'),
    );
   $form['mail_bcc']=array(
      '#title' => 'BCC this mail to all',
      '#type' => 'checkbox',

    );

   $form['help'] = array(
        '#theme' => 'token_tree',
        '#token_types' => array('node') ,
     );

  return system_settings_form($form);
}

/**
 * Implement hook_comment_insert().
 */

/*
 *Implement token_replace(). , variable_get()
 */

function comment_notification_comment_insert($comment){

if ($comment->field_comment_notification['und'][0]['value'] == '1') {
      global $user;
      if ($user->uid == 1){

        $user_mail = $user->mail;//user has login
        //dsm($email);
  }
  else{

       $user_mail = $comment->mail;//uesr has not login
  }

      $to = $user_mail;
       // $to = 'm.nikhilanant@gmail.com';
      $message = token_replace(variable_get('mail_body')); // Body of your email here.

$subject = token_replace(variable_get('mail_subject')); // subject of e-mail
$body = token_replace(variable_get('mail_body')); //it might be any variable from the form eg. $form_state['values']['your_field']

//params is the array passed to hook_mail function
$params = array(
    'subject' => $subject,
    'body' => $body,
    );
      $message = drupal_mail('comment_notification', 'loaded',
        $to,language_default(),
        $params,$to, TRUE);
    }

}

function comment_notification_mail($key, &$message, $params) {
/*dsm($key);
dsm($message);
dsm($params);
*/
  switch($key) {

    case 'loaded':
      $message['subject'] = token_replace(variable_get('mail_subject'));
      $message['body'][] = token_replace(variable_get('mail_body'));
      break;

  }
}


texts:
I'm thinking of making a module for Drupal 7. The main content aren't nodes, it will be in a different table. Can I use the default comment module or it is only for the nodes?

Sorry for my english.


texts:
At some point I found the need to modify an SQL query generated by Views, in the end I overrode views_pre_execute and changed the query for that specific view.

This feels like an ugly hack to me and I wonder if there is a more elegant and maintainable way to do that. Ideal would be a way that would allow me to directly modify the query from the Views UI.


texts:
I'm getting internal server error on node save.

In db log messages there is no such error regarding this issue.

In apache error log I have these messages

mod_fcgid: read data timeout in 40 seconds, referer: http://test.com/node/add/photos
[error] Premature end of script headers: php-fcgi-wrapper, referer: http://test.com/node/add/photos


texts: How to pre populate the commerce shopping cart with products

texts:
Is there a way to pre populate the Shopping cart with all products similar to this example?
http://www.taytocrisps.ie/park/book_tickets

I only have 5 products on the site and I want to skip one step and add to all products to the cart. The user then selects the number of the products in the cart and goes straight to billing information and payment.


texts: ajax_command_invoke adding a new item in a field collection

texts:
I'm using the field_collection module.
A collection has a "custom field" I've created, which rely on a jQuery plugin.
When I add another item in my collection, the jQuery plugin is no more invoked, and the field doesn't work anymore.

At the first load, all is working, it's only after adding a new item.

I don't know how to invoke the jQuery plugin initialization, there is probably something with the ajax command "field_add_more_js", but I can't figure out which hook or which solution I can use :(

Do you have any idea ?
many thanks


texts:
I have a view that displays a list of coupons that a user has earned. These coupons are provided by sponsoring companies and are not used on my site. Rather than doing an API integration to find out when a coupon is used, I just have a VBO view that allows users to mark coupons as "used".

Is it possible to disable the VBO checkbox if the coupon has been marked used? Or is this even the right approach to the issue?

As far as I know, the only real way to do this is by adding disabled attribute to the checkbox's <input> tag.

Thanks in advance for the help.


texts: hook_entity_field_access - trying to check if there's a value

texts:
I am trying to check if a given FieldItemListInterface is empty or not (and if not, grab the entity)

Using the example in https://www.drupal.org/project/examples - the team I'm on was able to get an access function written that should theoretically work only if there are items with an entity in them.

However whenever we have the correct field definition name, and check for items, they're all empty:

if ($items) {
// Code does not execute here - $items value is always NULL.
}

I'm not quite sure why but for some reason the value is always NULL, even if I would think it should be full.

Why exactly would this value be NULL if the field definition exists on a given entity, and has a value?

What am I missing?

Further code example:

function MY_MODULE_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {

if ($field_definition->getName() != 'field_attendee_only_content') {
    return AccessResult::neutral();
  }

// Code gets to here.

  if ($items) {
// Code here is never executed. $items is ALWAYS NULL.
    $entity = $items->getEntity();
  }
}

For additional information, the field in question is a file field.


texts: #2013 error when starting the dev desktop

texts:
My computer (a Mac) froze while I was working on a site, and I had to switch it off by holding onto the on/off button. When I tried restarting the dev desktop, it kept giving the "Process start timeout" error; when I tried accessing the database, I got the following message:

  #2013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 61
  phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

Do you have any idea on how I can resolve this?

I've found a solution, but now I keep getting this message:

  The specified file temporary://fileJ75lqi could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.


texts: How to get all values from a new node being created in hook_ENTITY_TYPE_presave()

texts:
Drupal 8.7.2

function mymodule_node_presave(Drupal\Core\Entity\EntityInterface $entity) {
  data_dump($entity->original); //is empty because its a new node, not a node being updated.
  // How to get all values at one time?
  // By values I mean the same value you would get from:
  data_dump($entity->get('title')->value);
  // but from all fields and not just one field at a time.
}

I have a custom content type that has 30 custom fields that I need to examine inside this hook.  I'd like to avoid getting the value of each field individually.

Thank you for your time.


texts: Change value on validate form when I create or edit a block

texts:
I need change a value to element on form validation.

I have this code:

/**
 * Implements hook_form_FORM_alter().
 */
function MY_MODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if ($form_id == 'block_content_MY_BLOCK_form' || $form_id == 'block_content_MY_BLOCK_edit_form') {
    $form['#validate'][] = '_custom_validate';
  }
}

I want change the value of field field_test. This field is plain text.

function _custom_validate($form, FormStateInterface $form_state) {
  $form_state->setValueForElement($form['field_test'], 'changed');
}

But when I saved this block, the field field_test doesn't change its value.

What I am doing wrong?


texts: How to add another condition to a specific active facet?

texts:
I did try to add a condition using hook_views_pre_execute or hook_views_query_alter, but since Im usiong SearchAPI, theres is no point apparently in using these functions (no $query in views_query_alter, and no query too in views_pre_execute

Maybe using hook__search_api_query_alter could d othe trick but I dont know how to implement it.

My question is : How can I achieve this ?

Knowing that I need to add anoteh condition only when items of a specific facet are active (among a few other facets).


texts: Show node in view based on dropdown in seperated content type

texts:
I have two content types. One content type is 'sport' and a other content type is 'teacher'. I collected the content type 'teacher' with views and I display the fields in a block (this is important for my site set-up).

My content type 'sport' is seperated from the content type 'teacher' (this is also important for my site set-up). My content type ‘sport’ is the content type where my block ‘teacher’ is showing up.

My page is look like this:

If I create a new sport like basketball, the information of soccer changes into the information about basketball and the teacher should be Rob (choose from a dropdown when creating a page from content type 'sport').


texts: The question is - what may be the reason for exposed form to not be working/showing in a block? Thanks so much - hope someone has an idea about that.


texts:
I have a managed_file form element. I want to trigger an AJAX callback when a user clicks the upload button. But I can't seem to get anything working by attaching the #ajax element to the managed_file element. I know the managed_file element creates an upload button automatically, so I tried to hook into that using hook_form_alter but the button doesn't seem to have been created yet, so I can't attach the AJAX handler.

Any ideas?


texts: Drupal 7 - Dynamic Allowed Values Field Widget

texts: I have a project I'm working on where each content manager/author would have a different set of allowed values on a select input for each node created.  Is hook_form_alter the best method for me to dynamically generate the options?  And what would the syntax kind of look like?


texts:
I have added a new field to comment table, called "paragraph_id", I have also added a field to comment form that ask users which paragraph they want to put comment on and what they enter will be saved in "paragraph_id" field.

So now I want to show the value of "paragraph_id" in the comments, beside showing the subject and the body of the comment.

There is a hook called "hook_comment_view" , and it can be used to add additional data to the comment before theming.

This is the hook:

function hook_comment_view($comment, $view_mode, $langcode) {
  // how old is the comment
  $comment->time_ago = time() - $comment->changed;
}

I tested this hook by changing it to the following:

function Annotations_comment_view($comment, $view_mode, $langcode) {
  // how old is the comment
  $comment->subject= $comment->paragraph_id;
}

and instead of subject it showed the data in paragraph_id field. But how can I add a new field to comment display form, for example called : Comment on Paragraph

and then write this:

function Annotations_comment_view($comment, $view_mode, $langcode) {
  // how old is the comment
  $comment->Comment on Paragraph = $comment->paragraph_id;
}


texts: I need to insert HTML markup (spans, classes, h2 tags). However, webform appears to be filtering out all markup from labels. Has anybody succeeded in inserting html markup in labels, and how did you do that?


texts: How do I add administrator approval on webform submitted data?

texts:
I have the functionality that when any anonymous user submits a webform, then I display the submitted webform data in my new page, but I need admin approval before that submitted data displays on another basic page in Drupal 7.

Does anyone know about admin approval for webform submitted data?


texts:
With the major changes to Drupal with version 8, it seems I would need Drush 7.x or earlier to work with Drupal 7.x. I tried to rebuild the cache and I got errors related to namespaces in PHP. It seemed to be looking for features that were not part of Drupal 7.x.

Are there different commands to clear the cache for a Drupal 7.x site?
I tried drush cr and it came back with errors indicating it was trying to find code using namespaces, but Drupal 7.x core doesn't use namespaces in the code.

I tried it on Ubuntu and on Windows.


texts: 8 - Cannot get clean URL's to work in macos mojave

texts:
Trying to install Drupal 8 on my macos mojave but cannot get clean URL's to work. But failing.

Here are my configs at /etc/apache2/httpd.conf:

Rewrite mod and vhosts include is uncommented...

LoadModule rewrite_module libexec/apache2/mod_rewrite.so
Include /private/etc/apache2/extra/httpd-vhosts.conf

<Directory "/Library/WebServer/Documents">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Vhost:

<VirtualHost *:80>
    DocumentRoot "/Users/admin/Sites/drupal8"
    ServerName drupal8.test

    <Directory /Users/admin/Sites/drupal8>
      Options Indexes FollowSymLinks
      AllowOverride All

      RewriteEngine on
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </Directory>

</VirtualHost>

As expected, after installation all admin pages are returning a 404.

Edit:

apachectl -M

 core_module (static)
 so_module (static)
 http_module (static)
 mpm_prefork_module (static)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 reqtimeout_module (shared)
 include_module (shared)
 filter_module (shared)
 mime_module (shared)
 log_config_module (shared)
 env_module (shared)
 headers_module (shared)
 setenvif_module (shared)
 version_module (shared)
 slotmem_shm_module (shared)
 unixd_module (shared)
 status_module (shared)
 autoindex_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 userdir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 php7_module (shared)
 hfs_apple_module (shared)


texts: How to generate images for profile picture in Drupal 7?

texts:
Let's say I've a site with hundreds of users. I would like to provide a profile picture to users who don't have a picture on their profile.

How can I do that?


texts: Is there a way to send password to the user through 'Welcome (awaiting approval)' email?

texts: I am working on a Drupal site where, i want to send an email to the user providing him with the password. Is it possible.....?


texts:
How to add last IP address for online user ( only last IP address ) and link to ban user IP address ?

i tried display all ip address but that showed to me all ip addresses from any time

i want show last ip address


texts: I configure the facebook modules. I created facebook Apps and I gave facebook auth id and secret key and all. But I couldn't connect with facebook.  I got this type of Error?


texts: How can I display a taxonomy term's ancestral tree on a content page?

texts:
I am using Drupal 8. I have a hierarchical taxonomy vocabulary like this (simplified):

Animals
-Vertebrates
--Fishes
---Butterflyfishes
----Chevron Butterflyfish

On a taxonomy term's page, I automatically get the ancestral tree as breadcrumbs. For example, on drupal/Butterflyfishes I see this:

Animals >> Vertebrates >> Fishes

If I add Butterflyfishes as a Taxonomy term entity reference on a content page (i.e. not the taxonomy term's page itself), how can I also display such an ancestral tree on that content page?


texts: PHP ignored when calling views bulk operation from rules

texts:
We have a view with a Global PHP filter that returns the uid of users based on the contextual filter's date received from a rule (set to run weekly, once).

The view on work fine with arguments on it's own, but seems to ignore the custom PHP filter we've included, once it's called from rules.

Not quite sure what the issue is or if it's simply a bug.


texts: How do I migrate from Rhythmyx to Drupal?

texts: I am working on migrating a site from Rhythmyx to Drupal 7, and since they are so different I was wondering if anyone has done that and how they did it.


texts: How can I make Private Messages in Drupal 7 with user user pictures like in Facebook?

texts:
There are many people who want to see their Private Message module in Drupal to look like Facebook - i.e. with user pictures.  Pictures make messages more "personal" and "closer" than e-mails.
I made it work in D5 and D6 by putting functions into template.php, but for D7 I can't find any such snippet that would work for D7.

I've written more about this here http://drupal.org/node/1549540  There's already much of the snippet there, but the DB query returns an error.

Can someone please help write a lasting solution for drupal user in D7?


texts:
what I need do is not an ecommerce site.

On my drupal website I need a simple web form with a payment (by paypal) and a node reference field prepopulated (by the entity refence and entity reference prepopulate modules).

The scenario is this:

I have a content type called Team.
Only the admin can add nodes for this content type.
This content type has field of type user reference (by entity reference module). This field is empty to default.

Now, when an authenticated user visits one of this nodes, he can click on a link Administer this team!.
If he click on this link, he go on the payment form and it set the referenced node field to the clicked node id. Now with the payment webform he can pay.
The price is always 49 Euro, so he doesn't need set it.

After the payment I would like set an action (by rules module) that fetch the user that pay, the referenced node and set the user on the user reference field on the node.
In this way, trough the nodeaccess_userreference module, the user can start to administrate his team's page...

Hi tried to do this with the payment module beacause this has a good implementation with rules module, but I don't understand how to do a simple webform (at the url www.example.com/pay-your-team) with the reference to the node and without allow to the user change the price.

Can you help me?!

Thanks a lot!


texts: When should one use #value_callback and when #element_validate?

texts:
I've tried to get into custom element creation but ran  into problems with #value_callback and when #element_validate, more specifically their lack of documentation.

Imagine you have a custom element called db_connection whose output is supposed to be a is supposed to be an SQL connection string.

The element itself consist of a few select elements and one textfield. The user then simply selects (let's say) the database in the first one, table in the second one, and writes numerical of desired row in the last textfield.

My question is, when should you go trough the individual inputs and create the SQL connection string from them? Should it be in #value_callback or in #element_validate?

The names suggest the latter should be more suitable but my experience so far say the very opposite... It also seems to me that other modules (date) do it in the former one.

If one should really do it in #value_callback then how should he approach validation? As far as I know, the value callback is called before validation happens so it might have to deal with invalid individual inputs from which it might be impossible to construct the final output (SQL connection string in our example)?

And if it in fact is to be done in #value_callback than what purpose does #value_callback serve? What should it do, what should it return, ...?

As of my research:

This article suggests that one should use  #value_callback to transform 'default_value' to element friendly data form and use #element_validate to transform inputed data to store / later use friendly form.

So basically it suggests to go with #element_validate for the SQL connection string creation and use the #value_callback only to properly set up the element in case the SQL connection string is given as default value.

In addition to this question I also have this one (that is more about #value_callback). Already partially answered.


texts:
I'm using uc_best_sellers to count the number of times a product has been sold.

The module provides a numeric views filter like this:

I'd like to have a view like this:

A product would be a best seller if it was sold more than 50 times (in my case).

What would I need to achieve this filtering style?


texts: How to create links which pass arguments to a page?

texts:
I am making a website which displays table from a database. For every row of the table I want to provide a link(or button) which will be placed in the last column and will redirect to a page displaying records from another table associated with that row. Is there a way to create such link which would pass an argument (row id) to another page so it could display apropriate records?
Thanks


texts:
I am trying to convert a view to a form as follows:

I need to have a table of articles (which can be produces easily by views) and inserting a checkbox next to each row (article), and a button next to this table as Submit button.
The created form out of the articles` view should be able to initialize the value of the checkboxes before showing them (which can be done somehow by form_alter).

So, the problem is that I really don't know how to create this form.

I used VBO, but VBO does the operation for the selected rows! I need a method which can help me to set the values of checkboxes by code, before views render, and when the submit button is clicked, whole rows should be checked!

can you please suggest a tested & working solution?

thanks


texts: How to use Views Isotope in Commerce Kickstart?

texts:
I want to do the same as what is shown in the video about the Views Isotope module, but within Commerce Kickstart (CK).

Gareth Hall, shows us how to drupal 7. I've done the same for CK, but I can not get that purpose, that is, not filtered. I click on the tags and does not give any effect or filter.

I thought it might not be compatible with CK or perhaps is making a conflict with some jQuery or something out there.

Please any suggestions?

Update:

I installed the module View Isotope
I activated "Isotope Example" and "Views Isotope" modules
I created two views (and filter for content) as explained in the video.
I have also used the version "Isotope Example", for that I have added content in "tags" and "articles".

And still the same. does not filter anything.

Now, also I have since only a new version of Drupal 7 (without CK). For this I needed to install/activate other modules, such as: Features (enabled), Image (enabled), File (enabled), Field (enabled), Field SQL storage (enabled), Taxonomy (enabled), Options (enabled), Views (enabled ), Chaos tools (enabled), Views Isotope (enabled), jQuery Update (enabled), Libraries (on)

And still the drawback.

I am convinced that something is missing but I do not know why.

Any help?


texts: How to test if a config entity can be deleted?

texts:
In my custom module are in hook_unistall all its config entities deleted. One of the entities causes after uninstall the following error:

  A non-existent config entity name returned by
  FieldStorageConfigInterface::getBundles()

Is there some possibility to test, if the config entity is needed? I look for something like:

foreach ($configs as $config) {
  if (\Drupal::configFactory()->getEditable($config)->canBeDeleted()) {
    \Drupal::configFactory()->getEditable($config)->delete();
  }
}

I tried also to add the following lines in all configs:

dependencies:
  enforced:
    module:
      - svg_verzeichnis

After that works the uninstall in one module correct, but in another module I receive still the same error. In the error message is no info, which config is missing...


texts:
I want to move the CSS and JS cache folders (sites/default/files/css and sites/default/files/js to another place. Is this possible?

I want to do this because I'm planning to have the files folder on a remote file system and I think that accessing the CSS and JS from remote would slow down the site.

Edit: I'm using Drupal 6.


texts:
I'm printing the output as described in here: How to programmatically render a node's teaser using the theme layer? in block using PHP filter.

Also I've a theme implementation file named: views-view-field--field-image.tpl.php in the custom Mobile theme directory with this content:

<?php

?>
<?php /*print $output;*/ ?>

This is hiding all image field output but not the output of drupal_render($view).

How to hide the images in this redered output as well?


texts: SVG icons do not show up when remotely connected

texts:
I have installed Drupal 8 in my linux machine for testing. Everything seems fine initially when I'm accessing D8 from my local machine.

However when I tried to access it via another machine on the same network, the svg icons do not show up. After further investigation using firefox element inspect, I realized some of the request urls are from 192.168.1.18, which is my linux machine IP, while the rest are either from localhost or 127.0.0.1.

Am I missing any configuration here?

Thanks


texts: How to make use of Devel debugging functions on large or complex objects

texts:
I am having trouble making real use of Devel's debugging functions kint() and dpm() in my modules and twig templates. They work fine for primitive variables, flat arrays and such, but if I want to inspect into some object like an EntityRerefenceFieldItemList they either cause the site to crash (white page) or generate so much data such that the scripts for expanding the list no longer work.

How do I circumvent these problems?


texts:
For some reason I don't see the views theme suggestions in my twig debug information? What do I miss?

In my development.services.yml in set debug to true.
I do see debug information and theme suggestions from other page items.
I do see views debug info but not the theme suggestions. See image below:

On other website I see suggestions like this:


texts: DIV covering over the login buttons in commons-origins theme

texts:
We're using Commons 3. It uses a sub-theme of Adaptive Themes (AT). There appears to be a DIV that is blocking users from clicking on the signup | login area.

Should I file a bug on this or work around it with CSS?


texts: Is it possible to have two forms displayed in two tabs but each in its own class?

texts:
I have a custom Profile Edit form, and then I want to add a Deactivate Account Form, displayed in a tab "Deactivate Account" in the custom "My Profile" page.

How do I render this Deactivate Account form in a tab of My Profile page?

Examples I've seen treat the form as one, which would result in a massive Form class.


texts: Pay order only after it been placed and validated

texts:
I need to create a following workflow for the store checkout:

The user adds a product(s) to a cart.
The user goes to checkout.
During checkout, the user can register or authenticate on site. This is required and there is not possible to checkout as a guest.
Then it goes to the pane with contact information and payment information (? not sure do I need it at this step).
Then the user sees the last step of checkout — review.
Then the order is placed.

What I need is to send this order to validation by the store manager to ensure the product can be crafted or already exists.

I thought about CheckoutFlow plugin at first, but this does not exactly solve the problem. If I set order state in onStepChange()  differ from 'place' the order is messed. There is no order ID on complete step and order as well listed in cart.

I also thought about special CheckoutPane that blocks further checkout before the manager is change order status. But this also not looks like a good idea, and limit order numbers to the single.

The obvious solution here is let the user finish checkout as soon as possible, then he got the message that order is only set to validate now. And only after additional manual actions from the store manager, there will be possible to pay for the order (it can took days, so there will be additional emails).

I think I will use custom .workflows.yml for further order processing. When the manager is set status "validated" next to it will be a "payment" state. During this state, I want to show payment form on the user order page (entity.commerce_order.user_view) or maybe better create a special route with order_id and generate form there (in this case it also will be possible to send this link in the notification email).

Also, I will add EventListener for commerce_order.order.paid to change state from "payment" to "fulfillment".

Maybe there is a better solution and I don't see it? Did I choose the right direction to solve the issue? Are there any drawbacks to manage payments manually or behaviors I need to take into account?

UPD

I didn't mention in the original post but it seems to be very important in that case - the order can be edited after or during validation in some cases, so total amount will change and as I understand, previously authenticated payment with gateway will be invalid.


texts: Drupal 7 Core Module Function for node_save?

texts:
In Drupal 7, i want to put a additional code when the Save button is Clicked (Saving) in "a content" form (New or Edit).

I don't want to know the hook (because i don't want to make an obvious Custom Module). Because i don't want to let other users know the operation by having a obvious Custom Module which will be listing inside the Module Panel. So i want to make a Silent Customization inside the Existing Drupal Core Module (correspondence Function).

Thats why I just want to know the Function in the Core Modules which finally process the Node Save task.

Can anyone please describe which Function (in Core Modules) is finally processing the Drupal Node Save? (Save` finally may be for both New Item Insert or existing Item Edit.)


texts: Change module settings stored in an array with drush

texts:
I would like to configure a module (addtoany) settings with drush. This is the variable:

addtoany_nodetypes: Array
(
    [about_us] => about_us
    [contact] => contact
    [page] => page
    [legal] => 0
    [webform] => 0
)

So that, for instance:

[page] => page
[legal] => 0

becomes

[page] => 0
[legal] => legal

But I am rather new at drush and I am at a complete loss. Thanks for your time.


texts:
I am using HTML Mail, Emogrifier, Pathologic and Echo modules to theme the outgoing Drupal emails into a template based presentation.

So far, I guess it has not been too hard, but I am having a hard time getting the HTML Mail test message to allow HTML. I am using the Full HTML filter on the test message edit, and using Unfiltered for Post filter setting.

I get my test message, but its stripped of <h> tags and <p> tags and anything that isn't an anchor, <code>, <span>, or list. Does anyone know why?

I tried editing various filter formats and nothing affected it. It would seem like it keeps using Filtered HTML no matter what I select, but even still, it is not showing <h> tags and <p> tags.


texts: Are hooks a thing in their own right, or are they actually implemented as events under the hood?


texts: How can I output log messages to stdout/stderr?

texts:
I can create log messages really easily in Drupal 9.x like this;
\Drupal::logger('mymodule')->error("something went wrong");

I see these messages appear in /admin/reports/dblog, but it would be convenient if I had the option to print them to stdout, or perhaps a file that I could tail. Is this possible?
Note that this question looks similar but I think it's for an older version of drupal using watchdog, so I don't think it applies: how to show admin/reports/dblog in terminal ( cli )


texts: How to change timezone format for user/site settings?

texts:
I want to change the user configurable timezone format on the regional settings and user settings form.

For example, it displays as Asia/Kolkata: Friday, October 9, 2015 - 17:24 +0530 I want to display it as Asia/Kolkata. I have used following code but not working.

function my_modue_form_system_regional_settings_alter(&$form, &$form_state, $form_id) {
dpm(timezone_identifiers_list());
dpm($form);
$form['timezone']['date_default_timezone']['#options'] = timezone_identifiers_list();
}

Is it possible to do this?


texts: Do I have to create a module for just one _alter function?

texts:
I want to write a hook_entity_info_alter function.

Do I have to create a module just for this one function?


texts: Call a drupal behavior method from inside another behavior

texts:
How do you call a drupal behavior method from inside another behavior? My example below

(function ($) {
  Drupal.behaviors.exampleOne = {
    attach: function (context, settings) {
      $('.example', context).click(function () {
          $(this).next('ul').toggle('show');
      });
    }

    exampleMethod: function (context) {
      console.log('test');
    }
  };

  // call exampleOne from inside exampleTwo
  Drupal.behaviors.exampleTwo = {
    attach: function (context, settings) {
      $('.example-link', context).click(function () {
          Drupal.behaviors.exampleOne.exampleMethod(context);
      });
    }
  };
})(jQuery);

See how I try to call exampleMethod() that belongs to behavior exampleOne inside behavior exampleTwo? I would think I can call it like that but I keep getting undefined when I call it. Though if I call it like this console.log(Drupal.behaviors.exampleOne.exampleMethod);, I get the function written out.


texts: how to prevent a theme from using templates of a sub themes (placed inside the parent theme dir)?

texts:
my folder structure looks something like this:

 themes
└─  foo
   ├─  bar
   │  ├─  templates
   │  │  └─  node.html.twig
   │  └─  bar.info.yml
   ├─  templates
   │  └─  page.html.twig
   ├─  foo.info.yml
   └─  foo.libraries.yml

now I run a multisite. one site is using the foo theme and the other uses bar.

The site using the foo theme also invokes the template
/theme/foo/var/templates/node.html.twig

Why is that so?
I thought the foo theme only invokes templates inside its own templates folder? I expected this to be the point of the templates folder. Is that assumption wrong?
can I prevent this behavior without moving the subtheme somewhere else?


texts: Why do many Drupal themes markup images with typeof="foaf:Image" attribute?

texts: Does this attribute simply enhance semantics?


texts:
I am using drupal 7, have a content type and two taxonomy categories, size and shape.

Im trying to build a dynamic url such as mysite.com/node/nid/tid/tid, which would get rewrote as e.g mysite.com/page-1/large/square.

I want the content of the url to just show the node, so in this case node/1. But I am also going to make 2 blocks one for category size and another block for category shape which will get the relevant IDs from the url and show the relevant content, in this case block 1 will show large and block 2 will show square.

I thought I could generate the page in views by setting the URL to node/%/%/% or node/%//
and setting arg 1 to nid, but this comes back as page not found.

So I am wondering is this possible in views if not how can I create a url such
/arg1/arg2/arg3 which represents /a nid/a category 1 tid/a category 2 tid, and then populate the page dynamically?

Thanks for any help

edit/

So I have got the arguments working. mysite.com/%/%/% by setting the last argument as the target page rather than the first argument. But how can I rewrite the url. So arg1 becomes node title, arg2 becomes term id 1 and arg3 becomes term id 2 title?


texts:
I have a Drupal 8 installation set up that is using a custom Bootstrap theme as the default theme. I have a View created to be a blog, and want to give it a different custom theme than the default. I have the path set as "/blog". Is there a simple way of doing this through code (specifically referencing either the URL or the view) or a menu option I've overlooked?

I've looked at other related questions on here such as: How to apply theme to Drupal view or block

But in my View display settings there is no "Theme : Information" option available.

Any help is greatly appreciated! If there is more details I can provide for a solution, please let me know!


texts: Drupal 7.22 video display in block gone wrong after upgrade

texts:
I'm  a newbie and I just upgraded to Drupal 7.22 and installed CKEditor as well.
When I edited a block with embedded with CKEditor enabled, the video thumbnail disappeared.
Disabled CKeditor, re-edited the block, thumbnail re-appears.
Re-enabled CKEditor, thumbnail is still there.
Create new block to display same video with same embed code:  No thumbnail.
So, somehow CKEditor is blocking the creation of Full HTML.
Anyone else had this problem?


texts: Media module and wysiwyg inserts image link rather than rendered image

texts:
I'm using wyswig and ckeditor with media module to insert images into the body field of a node.

Instead of displaying the image it displays a link to the image. Viewing source this is what is inserted:

 feature_MB2.jpg

I have "Convert Media tags to markup checked" and I am NOT limiting HTML tags. Any ideas why it's stripping out the "[" and "]"?

Thanks,
Jon


texts: New multisite server: should I use CPanel? And Symlinks?

texts:
I'm commissioning a new server to host a mix of D6 and D7 sites.

My old server had Plesk, which was a bad idea for Drupal, as I spent most of my time trying to get around its security to allow a multisite configuration to work.

The first question I have is whether to install CPanel or manage the site through the command line?

My second question is a bit more involved.

Currently I structure my Drupal setup as follows:

/var/www/drupal/drupal-7.26 (Current Drupal version)

/var/www/drupal/drupal7 (Vhost points here - Symlink to drupal current version)

/var/www/drupal/sites7 (Drupal sites directory - keeps it separate from the current drupal version)

/var/www/drupal/drupal-7.26/sites (Symlink to above sites7 directory)

I've found that keeping the sites directory separate from the Drupal install directory helps when upgrading the core Drupal version, but it does seem to break the ability to use D7's module upgrading.

Any thoughts on whether it's worth sticking with this structure, or should I switch to plain directories?

Thanks,

James


texts: Content not displaying for anyone other than Admin

texts:
I have a problem with Drupal 7. I recently set up Context module to display some blocks on given conditions and everything seemed to be fine. However, when I logged out every text in a block within a Mini panel disappeared on front page, and on every internal page content body (title still visible) is gone too.
I flushed the cache several times. In permissions anonymous and other users have "view published content"(this is a lazy translation from french) enabled. In didn't apply any kind of user role condition in Context, nor do I have any css/js error in console. Other than those which are only alerts:

Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead[En savoir plus]jquery.min.js:1
L’utilisation de « getPreventDefault() » est obsolète. Utiliser « defaultPrevented » à la place.

Please help me through these darks times...I'm running out of options
Thx in advance


texts: How can I check if a node references a Drupal Commerce product?

texts: Is there a short function in Drupal Commerce API that returns TRUE (or something else) if a given node references a product?


texts: How to add domain access to custom entity?

texts: Trying to do this for a custom entity, but it seems like Domain Access doesn't have its own entity to reference, and I'm not quite sure what method to use.  I'm still looking into it, but since I couldn't find a question on it yet, I thought I'd post this ahead of time in case anyone else has done this.


texts: Set all boolean certain fields to 0 if 1 with rules

texts:
I'm trying to reset all field_flag fields of all terms of a taxonomy value, where field_flag is TRUE (or 1).

Does anyone know how to do that?

Maybe some more back-story: I have a rule that gets fired on creation and editing of a taxonomy term when it has the field_flag in it.
Now out of this I want to "reset" all field_flags since only one term can have that field checked.

Thanks!


texts: How to htaccess redirect homepage url to external url without affecting other internal website links

texts:
I have an archive website say here:
www.myarchivesite.com
I do not need this site, just a subfolder here
www.myarchivesite.com/useful-pages-in-here/
Is there anyway, for example htaccess, that I can redirect all requests to my homepage www.myarchivesite.com to my new site www.mynewsite.com without breaking the contents of the subfolder www.myarchivesite.com/useful-pages-in-here/
Thank you.


texts: drupal 7 exposed view show or hide photo

texts: I have a photo field that I want to show or hide depending on if the user has selected it as a tickbox. I tried to add a condition for the photo but there doesnt seem to be an option when to hide the photo.  I had a look at the fid properties of an exposed view but I am thinking I will need to create a custom field and then write my own query for showing or hiding the image field. Please let me know if you need more information to best answer the question.


texts: Externally Requesting Browser Test Created URL for Relaxed Replication

texts:
I am trying to write a browser test for for a workspace replication via relaxed web services using the multiversion, replication and relaxed modules. For this purpose I set up an external Drupal installation as a content repository to clone from.

The content repository is installed locally and is reachable as I have tested it with an other Drupal instance as a replication target.

My problem is that the Drupal instance created by the browser test always gives me a 404 error once I try to reach it like follows:

\Doctrine\CouchDB\CouchDBClient::create([
      'url' => 'http://replication_user:password@browsertest.url/relaxed/live',
      'port' => 80,
 ])->getDatabaseInfo('live');

The local url and WorkspacePointers are set up correctly and the rest resources are also active. I even have a custom Drupal profile which activates all needed services and writes all configs for this functionality to work and it is being used by dozens of sites, but using relaxed replication in a test (even with the working profile) seems impossible…


texts: TinyMCE on Drupal 7 adding class to  instead of

texts:
I have a custom class that I want to be able to add to parts of a sentence using a <span> tag. It's a title field, so I don't want it to be wrapped in a <p> tag. However, TinyMCE insists on wrapping everything in <p>.

I thought configuring my input filter to strip out <p> tags would be a good solution, and everything works on my dev environment, but on the staging environment, the classes are being added to the later-removed <p> tag instead of a <span>.

Using <span> instead of <p> is particularly important because the user needs to be able to add the custom class to single words in the title without including the whole title.


texts:
I'm trying to update a paragraph with this code:
$entityManager = \Drupal::entityTypeManager();
      $paragraph = $entityManager->getStorage('paragraph')->load('1');
      $paragraph->set('field_test','testValue');
      $paragraph->save();

But I received this error:
Drupal\Core\Entity\EntityStorageException: Update existing 'paragraph' entity while changing the ID is not supported. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 846 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Stack:
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 837)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 395)
Drupal\Core\Entity\EntityBase->save() (Line: 171)
jnjmdc_content_card_module_help('help.page.jnjmdc_content_card_module', Object)
call_user_func_array('jnjmdc_content_card_module_help', Array) (Line: 392)
Drupal\Core\Extension\ModuleHandler->invoke('jnjmdc_content_card_module', 'help', Array) (Line: 144)
Drupal\help\Controller\HelpController->helpPage('jnjmdc_content_card_module')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Do you know why?
P.s. If I try to update with the last ID it works. It doesn't work only for old Paragraphs.


texts: Responsive not working after converting html theme to Drupal theme

texts:
While trying to convert a HTML responsive theme to Drupal 7 theme, it's responsive is not working!!!

Can anyone help me with this to sort the issue? We have copied Bartik theme and removed the CSS and pasted the HTML5 theme CSS and JS that we created. changed the index.tpl into page --front.tpl.php and copied it into the template folder. In the page-- front.tpl.php we give all the path for CSS and JS as:

<?php $path="http://".$_SERVER['HTTP_HOST']; ?>
<link rel="icon" href="$path.">
<link rel="shortcut icon" href="images/favicon.ico" />
<link rel="stylesheet" href="<?php echo $path.base_path().path_to_theme()?>/css/style.css">.

"As specified we gave path for all CSS and JS files, but don't know where we went wrong!!"


texts: Listing module under one custom module heading

texts:
I have created Menu type called Form submission. Under this I want to list all the Form submitted values. There are two forms one is Contact form and help form. I want to display these two as Contact and help form under the menu type Form submission.

Example: When I click Contact it has to show the contact list.

How to list the Contact and help form under the Form submission in admin page. I build it as custom module.


texts: How do I collect an end date when creating a Date field in code?

texts:
This is my field definition:

'ms_date' => array(
            'field_name' => 'ms_date',
            'type' => 'datetime',
            'cardinality' => 1,
            'settings' => array(
                'cache_count' => '4',
                'cache_enabled' => 0,
                'granularity' => array(
                    'day' => 'day',
                    'hour' => 'hour',
                    'minute' => 'minute',
                    'month' => 'month',
                    'second' => 'second',
                    'year' => 'year',
                ),
                'timezone_db' => 'UTC',
                'todate' => '',
                'tz_handling' => 'site',
            ),
        ),

and the instance definition:

 'ms_date' => array(
        'field_name' => 'ms_date',
        'entity_type' => 'node',
        'bundle' => 'ms_core',
        'label' => $t('date'),
        'widget' => array(
            'active' => 1,
            'module' => 'date',
            'settings' => array(
                'increment' => 15,
                'input_format' => 'm/d/Y - H:i:s',
                'input_format_custom' => '',
                'label_position' => 'above',
                'text_parts' => array(),
                'year_range' => '-3:+3',
            ),
            'type' => 'date_text',
            'weight' => '1',
        ),
        'settings' => array(
            'cache_count' => '4',
            'cache_enabled' => 0,
            'granularity' => array(
                'day' => 'day',
                'hour' => 'hour',
                'minute' => 'minute',
                'month' => 'month',
                'second' => 'second',
                'year' => 'year',
            ),
            'timezone_db' => 'UTC',
            'todate' => '',
            'tz_handling' => 'site',
        ),
    ),

I'm using these structures with field_create_field and field_create_instance respectively.

Currently the "Collect an end date" textfield is missing when I create this field. How do I enable it?


texts: How do I restrict access to the install.php file

texts:
In my Drupal 8 site, the install.php file is accessible.

How can I restrict the access to that file?


texts: Sending email to hidden field using webform after calling hook_form_alter?

texts:
Drupal 7.14, Webform 7.x-3.17 : I built a webform that has a hidden field "lt_email", and I'm assigning a session value to it using hook_form_alter -

function wbl_form_webform_client_form_1_alter(&$form, &$form_state) {
   $form['submitted']['lt_email']['#default_value'] = $_SESSION['Some']['Email'];
}

When I var_dump or dpm the ($form) I see the session value for lt_email, but after I hit submit on the webform, the value goes away, it doesn't get assigned.

Since %session[id] didn't handle multi-dimensional session arrays, I used the hook_form_alter workaround. I was under impression hook_form_alter would grab the session value, assign it to hidden field, and once submitted, the hidden field would retain the value, which I then use as the email component for the webform that gets triggered automatically. THe hidden field is blank upon submit.

I'm logged in as root, and all the other fields retain value upon submit (ie, name, address).


texts: How to inline edit node fields in a view

texts:
I have a table view of content node fields, and I need to be able to edit them inline.  It looks like the Edit module would work, but I'm not sure if it works with views.  When the user clicks on a field in a result row, they should be able to enter the new value, and the data for that field in that node should be updated.  It also needs to be compatible with the Field Validation module.

EDIT: This also needs to work with the Addressfield module.


texts: Is there a NULL value for a multi-value list?

texts:
I have a list that accepts 5 different values, but some things on my spreadsheet are empty, meaning its none of the 5 things. However during the feeds import, it is saying my empty field is not a valid selection.
Is there a way I can still import even though the value is empty?


texts: Standard way of filling webform fields with session or cookie values

texts:
Is there a standard way of filling Webform (hidden) fields with session variables and cookies?
In previous versions of Webform (4.x?), I've read that some placeholders could be used for setting the default value the one in a cookie or session variable, but this functionality was apparently removed (maybe when Webform switched to use the more standard Token module?)
I'm imagining two ways of doing this, but all of them may require custom code:

Implementing a custom component that acts like a hidden field but that gets its value from a specific cookie/session variable of choice.
Exposing cookies & session variables as tokens, and then use default Webform default value mechanism with tokens. Ideally, I would like the form editors to be able to choose any cookie/session variable they want, so I'm not sure this can be done that way.


texts: What options exist for search result weighting (e.g. promoting same score results higher in the results)

texts: I'm impressed with search in core; especially when empowered with the Search Configuration module. However I'm skimming the modules in the search category & not seeing anything that allows for arbitrary result weighting, perhaps the sticky bit could be used for this, but I was looking for something more granular; like a specific content type having a specific taxonomy term would float higher in the results.


texts: How to disable 'Path prefix language code' for admin panel?

texts:
My sites requires the use of 'Path prefix language code' under admin/config/regional/language/edit/en to append the language prefix to the URL path, so if the language is English, node/1 would become en/node/1

The problem is that when I am trying to translate content, the links to the translation pages contain this prefix too, and that will reach a page that is not there:

/tc/my-node-title/edit/zh-hant is the wrong path, the correct path is...

/my-node-title/edit/zh-hant

So is there a way to remove the language prefix on the admin panel?


texts: Why doesn't Entity translation show translated title in taxonomy term view?

texts:
My basic page content type is using entity translation. The language switcher works well when viewing the node. When observing a view that filters by taxonomy term, the node's title is always from it's initial language. How do I enable the contextually correct title to appear?

Demonstrated here: http://45.79.167.134/drupal/skills-development. Notice the title remains the same while the summary changes based on language.

Also note that the link for the title is always for the original language's node.


texts: How to force regions to render in Overlay

texts:
I've created a Seven-subtheme for use with the Admin Overlay and have added Header and Footer regions, however these do not render, despite showing on the "Demonstrate Regions" page.

I have tried to set overlay_set_regions_to_render(array(...)) in custommodule_init() however this fails to influence anything.


texts: How to NOT "Print" a section by using Print module?

texts:
I installed "Print" and "Book Made Simple" modules on Drupal 7. The Print module also print the button "add this child" from "Book Made Simple". How can I not print "Add this child" on PDF?

below screenshot is showing where the button from "Book Made Simple"

And here is the screenshot of a PDF contained "Add child page" and icon.


texts:
I have a views slideshow where an image is linking to the node. Now I want one of the slides to link to an external site.
How do I get this to work?
Maybe I can rewrite the output for the image field in a tpl.php file, but I don't know how to do it.
Any suggestions is appreciated. Thanks


texts:
Hey I am using the Empty Front Page module https://drupal.org/project/empty_front_page on a sub-theme(Bartik) but the problem is that when I open my domain I see an empty screen and none of the tabs are open. Can I somehow omit this empty page and direct the user to the home tab of the website meaning www.example.com to example.com/home?

PS: I am new to php and Drupal!


texts: How can I have a nested slideshow with paragraphs and views?

texts:
Initial situation

I have a node type with a paragraph field. Each paragraph of the paragraph field is rendered among themselves.

What I want to achieve

The paragraph field inside the node should render all the paragraphs as a slick slideshow.
The node containing the paragraph field and all the paragraphs should also be part of a (second) slick slideshow (via a view filtered by the content type).

In short, the user will have finally a slideshow (with the single paragraphs) nested in a second slideshow (with the nodes).

Problems

The module slick views allows it to display the nodes of the node type as a slider.
That's fine to realize the node slider.

The module slick paragraph only allows to create slideshows as a paragraph type, but not rendering the paragraphs of a node themselves as part of a slideshow.
They are still rendered among themselves inside the "node slider".

So here i struggle a bit - any idea?

Thanks in advance,
Phil


texts: Setting a Twig to a specific Form Container

texts:
As the title says,

There is a specific Form Container that I would like to add a twig to that is on a page having its own twig. No theme hook name suggestion is provided when I inspect its element.

My purpose is to style the specific form to be a credit card form.


texts: How to pass dynamic parameters through a local action button?

texts:
I created a local action button with the following in my_module.links.action.yml:

my_module.content.action:
  route_name: node.add_page
  title: 'My action'
  deriver: 'Drupal\my_module\Plugin\Derivative\ContentByDomainLocalActions'
  appears_on:
    - view.affiliated_content.page_1

Then, the local action button appears in the page admin/content/domain-content/firstdomain_local

I'd like use the argument firstdomain_local from this URL path to pass it in my local action button.

So, I retrieve the param from \Drupal::routeMatch() in getDerivativeDefinitions, like in this tutorial:

class CustomLocalActions extends DeriverBase {
  public function getDerivativeDefinitions($base_plugin_definition) {
    $this->derivatives['example.action_id'] = $base_plugin_definition;
    $this->derivatives['example.action_id']['title'] = "Add content";
    $domain = \Drupal::routeMatch()->getParameter('arg_0');
    $this->derivatives['example.action_id']['route_parameters'] = [
      'domain' => $domain
    ];
    return $this->derivatives;
  }
}

But the param of the local action button is only updated after I clear the cache. I have to clear the cache each time I use different parameter value in the URL.

What's the correct way to pass dynamically this argument?


texts: How can you require users to change their passwords on first login after migration?

texts: We are planning to migrate users from another CMS to Drupal. We can migrate usernames, but not passwords as the encryption is different. So we shall have to assign passwords to them. Earlier versions of Drupal had the ability to force a password change at first logon, but Drupal 9 seems to have lost it?  What am I missing?  People have answered the question before, but, as I said, not for Drupal 9.


texts: what is the importance of delimter in a feeds module

texts:
Guys what is the importance of the delimiter in feeds module. cause i only leave it as is. i dont change it so maybe its the one causing the instability of my import process.

By the way im trying to import large files from database which i converted in to chunks of csv files, which i have no luck in accomplishing. So can someone enlighten me the role of delimiters in csv and in feeds module


texts:
Custom CSS for title fields of Articles specified in content creation

As an example, I have a view that displays my latest 10 articles but want the titles to be different colours. I want these colours to be determined based on what I input at the content creation form, whether it be in a separate field or by defining/attaching a specific class to each new Article.

Is there a way to do this or a better solution to my problem available? Thanks in advance :)


texts: How to add a line break between each components in Email template in Webforms

texts:
I have the Webform 7.x-4.13 version module enabled.

I have a Webform node with more than 30 form components. In Email Settings, I have created a custom email template where I used the token: [submission:values].

Then I test the webform submitting a message. The problem is that [submission:values] print out the components values in a very plain way, no break line between the title and the value for each component. How can we add a line break between each components in an email.

I tried using "Send e-mail as HTML" option as well.

Can we do this using CSS/theme? If yes, Please tell me the procedure.

Thank you in advance.


texts: Ubercart Discounts (Alternative) needs Content module

texts: I have installed Ubercart in Drupal 7. My client needs to be able to have special pricing for members, so I added Ubercart Discounts (Alternative). I also installed CCK as a per-requisite. However, the installed module says it needs the Content module. I am not able to find this module.


texts: Setting $cookie_domain variable for specific folder structure

texts:
During configuration of Ckeditor I have to setup the cookie domain variable. I have added my site in subfolder like www.example.com/mynewsitefolder, where www.example.com is my current and running site.
First I tried something like $cookie_domain = '.example.com/mynewsitefolder'; but that doesn't allow me to log in.

How can I set it, so it works on a sub-folder?


texts: Twitter Module - Could not obtain a valid token from the Twitter API. Please review the configuration

texts:
I've tried a lot of things after googling this problem.
I've uncommented the OpenSSl Extension in PHP.Ini, the callback URL's match, I've changed the Twitter URL to https, but I can't get the module to add an account.

Help appreciated.

Ant:-)


texts:
A site's been developed on localhost and I want to move it to my new hosting, which uses Plesk.
This hosting doesn't have DNS pointing to it, although the domain is added. (The domain name is currently pointing to my old hosting.)

I have changed $base_url to the preview URL Plesk provides:

$base_url = 'https://the-url-pleskprovides:8443/sitepreview/http/myurl.com';

I can access the site and even browse, but I can't login because login redirects to https://the-url-pleskprovides:8443/user instead of https://the-url-pleskprovides:8443/sitepreview/http/myurl.com/admin/.

Is there any way to work with Plesk preview, or with Drupal without a domain?

Any help will be highly appreciated.


texts: Address module PHP error due to missing interface

texts:
I've installed the Address module and run Composer. I've checked the CommerceGuys/Addressing dependency is present. This was working fine, until a recent update (I'm not sure whether it was Drupal 8.2 or Address beta 4), but now the site is giving the following error.

PHP Fatal error:  Interface 'CommerceGuys\\Addressing\\Model\\AddressFormatInterface' not found in /var/www/drupal/sites8/all/modules/address/src/Entity/AddressFormatInterface.php on line 16, referer: https://www.google.com/

Can anyone halp?

James


texts: Use an exposed filter in Views to list all nodes with same title

texts:
I want to use an exposed filter in my view to allow users to list all nodes with the same title.

I have tried the link below but I have to manually pass the argument via the URL to get it to work.

Views related nodes with same Title


texts: Ability to pass data "up" from template_preprocess[whatever] to template_preprocess_page?

texts:
I'm using template_preprocess_panels_pane and I have custom css that need to be generated and inserted in the header depending upon data in the panels pane.

I can do drupal_add_css from template_preprocess_panels_pane, but in the situation that there are 20 panes that need custom css, it results and lots of duplicate data being added to the header. It would be cleaner if I could pass all of this CSS up to template_preprocess_page and add it to the header from there. Likewise, if I want to add data to--for instance--the page classes[] from template_preprocess_node (or whatever)....is there a way to achieve this?

Thanks!


texts:
Hi on my server I need to be running cron as an authenticated user in order for the directories that I need to access during a specific function to be writable.  How can I make cron or at least part of this cron run be run as an authenticated user for drupal 8.  I found some documentation but only for drupal 7 .
thanks


texts: Update view based on hierarchical select

texts: When a student goes to register they select their state and then their school (the state and school are stored as taxonomies). What I have not been able to figure out is, then the possible teachers needs to only display the teachers associated with that school and an option for not listed. The teachers are being pulled from a view that displays their username and then first and last name in brackets. Attached on the users profile and the view the teacher field is using. The contextual filters is set for a display all.


texts: Is there a way to ask migrated users to complete their profile?

texts:
I hope to migrate users in the database (using Drupal 7).

How will I handle the fact that they have no password, and will need to create one before accessing their profile?

Password is currently on the Join Form and these migrated users shouldn't have to go through the Join form.

Also - what do you suggest for mass email?

Thanks!


texts: Add "Request new Password" link to user logIn page

texts:
I am using the Logintoboggan module to redirect users to the login page when they try to visit a page for which they don't have the permission to visit.

How do I add a Request new Password or Forgot Password? link to this page?


texts: How do I create hierarchical taxonomy terms on import nodes?

texts:
I use drupal 7 and the feeds module.

I have an excel file that contain 10 fields,So I want to import these 10 fields to specified content type as node and  for 3 fields of those create hierarchical taxonomy terms on importing file.
For example My excel file have 10 columns.

  column 1 (cars name)

  BMW
  Chery
  MVM

  column 2 (cars model)

  BMW 110
  Chery tigo 5
  MVM 110s

  column 3 (color)

  red
  black
  silver

  column 4

  ...
  ... . . . .

I want to import this file and after importing have 3 hierarchically taxonomy like following that assigned to nodes of content type.
Taxonomy terms is not added by me to content type yet and I want to create taxonomys and terms automatically and assign automatically to nodes.

I have created 3 taxonomy vocabulary in my drupal site (but not added any terms to those):
1- Car name (taxonomy vocabulary 1)
2- Car model (taxonomy vocabulary 2)
3- Car color (taxonomy vocabulary 3)

I want to have taxonomy terms such as:
-car name :
  -BMV
       - BMV 110
           - red
  - Chery
       - tgo5
          - black

Please Help me for importing some fields of my file as taxonomy terms and sub terms .

I Can't type english verywell.sorry
thank you


texts:
if ($variables['node']->type == 'netrunner_card' && $variables['view_mode'] == 'full')
{
    $blinksFileName = $variables['node']->field_card_type['und'][0]['taxonomy_term']->name;
    $blinksFileName = str_replace( " ", "_", $blinksFileName);
    $blinksTemplateName = 'node__netrunner_card__' . $blinksFileName . '__full';
    $variables['theme_hook_suggestions'][] = $blinksTemplateName;
}

I can't get the tpl to load! Ive got two tpl files currently for two types of cards.

'node--netrunner-card--Runner-Identity-Card--full.php'
'node--netrunner-card--Operation--full.php'

and I even tried:
'node--netrunner-card--Runner_Identity_Card--full.php'

Nothing. I'm so confused at this point I don't know where else to go...
Any help would be appreciated.


texts: 'Userpoints Transactions: Description' doesn't appear in Views

texts:
I am building a site using Drupal 7 and the User Points module.

I have an original user points page. There I have table with the column "reason".

The HTML code for the "Reason" field (same as description?):

Commented on New Question f...

But, I tried to create a new table for transactions in Views.
For some reason, the "Userpoints Transactions: Description" is not showing in views.

Below you can see that the "description" column is empty:

This is the HTML code I see in the view:

Description:

why the "Userpoints Transactions: Description" does not shows up
through views?


texts:
I have a Custom Layout Plugin at times will have no content in a certain section. How do I get twig to test if a section has content inside of it before Drupal8 renders the template.

The twig if statement that does not work is: {% if content.content_left %}

This is the entire twig layout

        {{ content.top }}

            {{ title_suffix.contextual_links }}

                    {{ content.content_top.node_title }}
                    {% if content.content_top.field_sub_title|render|trim is not empty %}
                        {{content.content_top.field_sub_title}}
                    {% endif%}

                {{content.content_top|without('field_sub_title','node_title') }}

                {% if content.content_left %}

                        {{ content.content_left }}

                        {{ content.content_body }}

                {% else %}

                        {{ content.content_body }}

                {% endif %}

                    {{ content.content_right }}

        {{ content.bottom }}


texts: Correct format of data to send at services endpoint to create node

texts:
I have set up a services endpoint using services module and I am using Mozilla Poster add on to test it. I was able to create a user by sending data from Mozilla Poster in x-www-form-urlencoded format with parameter names "name", "pass" and "mail". Now I am trying to create a node but it is showing the error: "Title field is required".

What should be the parameter name for title field to be sent to the services endpoint? I tried using "title", "field_title" etc but it is not recognizing it. There is a nice tutorial here to determine data structure to be sent to create a node at remote website. But this tutorial tells how to send data in json format. I want to send data in x-www-form-urlencoded and create a simple node. The HTML code of title field of node create form at my remote website is:

<input class="text-full form-text required" id="edit-title-field-und-0-value" name="title_field[und][0][value]" value="" size="60" maxlength="255" type="text">

Kindly help me to figure out correct format to send title value in x-www-form-urlencoded format from Mozilla Poster in order to create a node.


texts: Disabling auto-translation from English to another language?

texts:
I've installed Drupal 8 and setted the site to be in Hebrew. It was changed to Hebrew, but from some reason, all the management system area\navigation\menues themselves were also translated to Hebrew. Such a thing never happened to me In Drupal 7.

In Drupal 7 when I was installing sites and setting the language to Hebrew, I would only have everything moving to the right (Hebrew is an RTL language) and the usage in the language became available, but I never, ever, had all the site translated automatically.

Is there a way to allow Hebrew without translating every part of the site to Hebrew?


texts:
May we use git with a Drupal Site ?

Because I'm trying to use Git with a Drupal site and it seems that not all the information that are pushed !!!

Thank you


texts: How to set up registration for event with parallel sessions?

texts:
I would like to set up the registration for an event.
During the event there are various parallel sessions.

(I was thinking in using the entity registration module)

Needs / problems encountered:
The (registered) user needs to chose the session he/she would like to attend (shouldn´t be possible to sign in for sessions given at the same time!)
Each session has a maximum capacity.

Any idea how to achieve this?

Thanks in advance


texts:
What I'm trying to do is

$entities = EntityInterface::loadMultiple();

That should give me all entities.

But when I call it, it gives me this

  Fatal error: Cannot call abstract method Drupal\Core\Entity\EntityInterface::loadMultiple()

What I need is the type and the bundles of the entities.

I don't want to get specific entities like Node, Comment, Block etc. I want to get them all.

$fields['node']['article'] =  <<<< I want that dynamic.

Something like that

foreach($entities as $entity) {
  $fields[$entity->getType()][$entity->bundle()] = ....
}


texts: Preprocess a Paragraph when Added to Content Type

texts:
I'm trying to disable a field in a Paragraph when it's added to a certain content type. Currently I'm using the following:

function my_module_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  switch($form_id) {
    case "node_content_type_form":
        $form['field_paragraph_content']['widget'][0]['subform']['field_paragraph_field']['#disabled'] = 'disabled';
      break;
  }
}

This works only after the node containing the paragraph has already been saved. When the paragraph in question is first added to the node the field_paragraph_field is not disabled.

How can I preprocess the Paragraph form when it is initially added to the content type so this field is always disabled?


texts: How to export format settings (label, weight, etc) for body field, image field, and tags field

texts:
I'm trying to export my layout settings that I did in Display Suite for my article content type full content view. All my settings for various fields (label and order) do take except the image, body, and tag fields. For example I change the label for the body field to hidden, export, and clear my db but when I go back to look it shows it as 'above'. I've tried to go into the exported code for display suite itself and insert in a 'label' => 'hidden' into the array also but that doesn't work either.

The order issue is where the tags field always show up before the body field. I've even checked the ds_layout_settings_info() function and the weight numbering of the array looks correct.

Why is it that only those three fields won't export correctly? Someone said that those specific settings are in core/field api fields but I can't find what to export in Features.


texts:
I believe I've got a jquery conflict, but for the life of me I can't find it.
I admit, I'm not the best with jquery.

I'm using D7 with jquery update (7.x-2.3+6-dev) and I'm trying to get the jquery based SmartMenus to work: http://www.smartmenus.org/

For the most part I've got it installed and working, but the problem I'm having is that the drop down menus will not close when I mouse off them.

The menu can be seen here:
http://www.multibrand.visionmix.us/

I'm not sure what other kind of information to post, so please let me know and I'll add it.
I'd really appreciate any help.


texts:
I have an unusual bug i've encountered during development of a client site -- it appears that for all Editable menus, when I click on edit, the site loops me into a Redirect Loop, pointing to a menu call I have for a custom module (see below). I'm not sure what the cause could be here, and there's a lot of code that needs to be sweeped through to determine the culprit.

I imagine if this is occuring in Admin, it could have consequences when we eventually hand the site over to the client. What are my best approaches to go about debugging this issue, starting with disabling offending modules?

The hook_menu() call for the routing rule that ultimately loads from the loop is below:

function example_checkin_menu() {
  $items['checkup'] = array(
    "title" => t("Checkin"),
    "page callback" => "drupal_get_form",
    "page arguments" => array('example_checkin_form'),
    "access arguments" => array('view check in form'), //Assigned to all roles
    "type" => MENU_LOCAL_TASK,
    'file' => "example_checkin.form.inc",
  );

  return $items;
}