texts: How can I print a text field's database value with devel so that it displays on all nodes?

texts:
I want just the text field's data without an of the "field-" divs wrapped around it. It's a link so I want to do something like <?php print render($content['field_download_link']); ?>.

$...['content']['system_main']['nodes'][7533]['field_download_link']['#field_name'] is the path of the field I want to display, but I want it on every node of the content type feed_item, not just 7533.

I tried placing <?php dpm($node); ?> at the top of node--feed-item.tpl and <?php print dpm($node['content']['system_main']['nodes'][7533]['field_download_link']['#field_name']); ?> where I want the field, but it just causes the page to load without any css.


texts:
I made a custom module, in which I dynamically add regions. The thing is, I want to make just the region part of the cache to refresh after. So drupal_flush_all_caches(); isn't the solution, since this takes too long, as well as it sometimes crashes the site.

Could anyone tell me which function I need to specifically clear the region/blocks cache? I tried all logical functions from the drupal_flush_all_caches(); function. I also couldn't find the right call from cache_clear_all();.

Any help would be appreciated.


texts:
I have a view that shows a list of students and their associated classes (which is an entity reference multi value field).

If you look in the image you see it comes out fine in the first view (except the Class/Group values are currently the node titles / how they appear when you select them on the Student node).

I would like them to show a different field on the "Class" node which is called field_class_name

To do this I add a relationship in then add the field in and use the relationship to bring it into the view. This causes duplicates and I cannot find any way around it.

The outcome of the view should be the same as the first but with the "Class Name" having comma seperated values and not duplicate rows in the results.


texts:
Need to add dynamic class in li element of below code like dymanic democlass1,democlass2...... so-on in loop.

 {% if prefix_text %}

{{ prefix_text }}

 {% endif %}

{% for button in buttons %}

      {{ button.svg | raw }}
      {{ button.text }}

{% endfor %}


texts: I imported products with the help of feeds via commerce product processor. The images from http://example.com/image.jpg downloaded successfully.  But why does not loading the images from ftp://account:123@xx.xxx.xxx.xxx/image.jpg ?


texts: Caption on CKEditor with Media embed only allows 128 characters

texts:
Using Drupal 8, the Media module, and the CKEditor that comes with D8. When you add an image media item, you get your screen like this...

But that caption field only allows 128 characters. Media (I believe) seems to be setting a maxlength of 128 (maxlength="128"). You can still add more characters if you Embed, then edit the source it supplies, but it's still going to chop off what you've added if you double click on that image (it's technically a drupal-entity element) to bring the "Embed media" window up again.

Since this "Caption" field is not dealing with any kind of data/database storage constraints, 1.) can I change this and 2.) does this even make any sense for it to have a maxlength set?

If anyone has a clue how to change it, that'd be most helpful.


texts: Using jQuery from Google CDN doesn't work

texts:
I used drupal 6.22 and I enabled the jQuery Update and jQuery UI modules; I used the latest version (JQuery 1.6.4 and 1.8.16) in my libraries. When I added this code in template.php (my theme) all the page worked correctly in my web site.

drupal_add_js('sites/all/libraries/jqgrid/js/jquery.js');
drupal_add_js('sites/all/libraries/jqgrid/js/jquery-ui-custom.min.js');

When I decided to use a content delivery network (CDN) some of the pages don't work correctly.

drupal_set_html_head('<script type=text/javascript src="https://www.google.com/jsapi?key=my site"></script>');
drupal_add_js('google.load("jquery", "1.6.4"); google.load("jqueryui", "1.8.16");'

Why is this happening?

If I use the following code, some of the pages still don't work correctly.

drupal_set_html_head('<script type=text/javascript src="https://www.google.com/jsapi?key=my site"></script>');
drupal_add_js('google.load("jquery", "1.6.4"); google.load("jqueryui", "1.8.16");


texts:
I'm a member of a student group. A couple of years ago some former members build a knowledge management system on top of Drupal 7. It worked great since then but know we want to migrate to Drupal 8.

I cloned the existing Drupal 7 to a new VM and installed a Drupal 8 instance alongside. I then used the web based migrate tool. As expected, I ran in a lot of errors and are now working my way trough them.

One Error where I got stuck is the one mentioned in the title. The whole error message is:

  The "text_plain" plugin does not exist. Valid plugin IDs for
  Drupal\Core\Field\FormatterPluginManager are: comment_username,
  comment_default, comment_permalink, datetime_default,
  datetime_time_ago, datetime_custom, datetime_plain, file_link,
  file_table, file_extension, file_size, file_url_plain, file_filemime,
  file_default, file_uri, file_audio, file_video, file_rss_enclosure,
  image_url, image, link_separate, link, list_default, list_key,
  entity_reference_rss_category, text_default, text_trimmed,
  text_summary_or_trimmed, author, user_name, basic_string,
  email_mailto, timestamp, number_unformatted, language, boolean,
  entity_reference_label, number_integer, string,
  entity_reference_entity_view, uri_link, timestamp_ago,
  entity_reference_entity_id, number_decimal
  (/var/[...]/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:53)

I started looking around and found this issue:
https://www.drupal.org/project/drupal/issues/3042223
Form what i understand, this should solve my problem. However, I am already using 8.7.4 and according to the release notes, it should contain the patch. To confirm that, i looked into the sources of my installation and the patch is definitely installed.

What could i do to solve this issue? I am thankful for every hint.


texts: Customize Error/Success Messages in Drupal 7

texts:
I need to customize the success/error message after submitting details. It needs to cover areas like contact form, forum create etc.,

Especially below message,

Drupal Version : 7.57

Theme : Bootstrap

Also, Is there is any possibility defining a new style for above messages?


texts: Drupal Authentication with ActiveDirectory

texts:
I'm trying to make Drupal work with ActiveDirectory just for authentication. I'm using Lightweight Directory Access Protocol.

I always get this message:

  Warning: ldap_search(): Search: No such object in LdapServer->search() (line 257 of D:\wwwroot\drupal\sites\all\modules\ldap\ldap_servers\LdapServer.class.php).
  Test sandbox-edu LDAP Server Configuration Binding with DN for non-anonymous search (testuser@sandbox.edu). Using password entered in form.
  Successfully bound to server
  Failed to find test user userone by searching on sAMAccountName = user one.
  No such object

Here are the settings of the Server Properties:

sid = SANDBOX_EDU
name = sandbox-edu
status = 1
type = ad
address = LDAP://10.100.100.2
port = 389
tls = 0
bind_method = 1
basedn = Array
binddn = testuser@sandbox.edu
user_dn_expression = cn=%username,%basedn
user_attr = sAMAccountName
mail_attr =
ldap_to_drupal_user =
testing_drupal_username = userone

Can anyone who were able to get this module working with ActiveDirectory show us a sample of the setting?

If there's any other way other than using this module, please also recommend. I really need Drupal to work with ActiveDirectory for authentication because we have many students here.


texts: Replace tables with divs in pages generated by views

texts: How can I replace the page layout generated by views with the grid format into something  tableless? I need those columns displayed in css stylished divs.


texts: How do I pass JavaScript variables back to PHP?

texts:
I'm trying to build a Drupal 8 module with a jQuery plugin. I wanted to pass some of the JavaScript variables to PHP so that I can save the variables into database.

This question asked about the way to do it in Drupal 7. Since hook_menu() is gone in Drupal 8, how can I accomplish this task?


texts: Dynamically display view block based on based on different view filters

texts:
I have a view as a page layout. That view allows the user to choose from a list of tags to filter content.

What I'm trying to do is - when someone selects one of the tags to filter content, a separate view block is displayed, based on the tag they select from the filter list.

Is there a way to do this?


texts:
I have a content type with 4 different sections to it.  At the bottom of each section, there are 2 "Call to action" links.

These links all point to the same 2 urls.  I'd like to be able to set up 2 fields of the type "link" and then re-use those fields 4 times, instead of having to set up 8 links.

Is this possible?

Is there a better way of doing it ?


texts: D8 render a contact form from theme preprocess

texts:
I want to render a form in a node view. I made an entity reference to a contact form, then in the preprocess_node I'm trying to get the render array of the contact form.

function mysupertheme_preprocess_node(&$variables) {
  $node = $variables['node'];

  if ($node->getType() == 'mynodetype') {
    if (!empty($node->field_mynodetype_form->referencedEntities())) {
      $contact_form = $node->field_mynodetype_form->referencedEntities()[0];
      $message = \Drupal::entityManager()
      ->getStorage('contact_message')
      ->create(array(
        'contact_form' => $contact_form->id(),
      ));

      //$form = \Drupal::entityFormBuilder()->getForm($message);
    };
  }
}

I don't know how to call entityFormBuilder in preprocess. Is this the right way to do this ? How can I display a choosen contact form in a node ?

Thanks


texts: Drupal 6 site importing with lack of data

texts:
I'm assigned to do some theming tasks on existing site, but had problem setting up site locally. I was provided with sites files and sites/design folder which consist of settings.php,modules,themes. I created a multi-site structure. I was also provided with one database file d6_design.sql. Apparently, this site is based on d6_design database and also sync data from other website which use database d6_liaa. So the thing is, when I launch site locally I get an error Table d6_liaa.users does not exist. and some other errors related to d6_liaa database. The main content is seems to be stored on d6_design database, but users and other tables from d6_liaa database. So my question is if the provided data is enough to launch the site locally and if yes, then what's wrong with my setup or settings.php file and I can't create connection with the site database, otherwise am I supposed to have database d6_liaa. The following is provided settings.php content adjusted to my localhost settings. Also after setting up page and seeing table not found error hitting the refresh page button everything just crashes and Page is not available. In settings.php file I can see that some kind of connection is declared to d6_liaa database, but is that meant locally or by accessing site.

<?php
$db_url = 'mysql://root@localhost/d6_design';

$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';
$conf['cacherouter'] = array(
   'default' => array(
    'engine' => 'apc',
    'servers' => array(),
    'shared' => TRUE,
    'prefix' => 'design',
    'static' => FALSE,
    'fast_cache' => TRUE,
  ),
);

$db_prefix = array(
'default' => '',
'users' => 'd6_liaa.',
'sessions' => 'd6_liaa.',
'authmap' => 'd6_liaa.',
'profile_fields' => 'd6_liaa.',
'profile_values' => 'd6_liaa.',
'drconnect_users' => 'd6_liaa.',
'fbconnect_users' => 'd6_liaa.',
'linkedin_token'  => 'd6_liaa.',
'twitter_account'  => 'd6_liaa.',
);

$conf['install_profile'] = 'd6_liaa';
$conf['maintenance_theme'] = 'design';
$conf['site_name']         = '';

$conf['insert_absolute_paths'] = FALSE;

/**TRANSLATABLE VARIABLES */
$conf['i18n_variables'] = array(
  'site_name',
  'site_slogan',
  'site_mission',
  'site_footer',
  'anonymous',
  'menu_primary_menu',
  'menu_secondary_menu',
  'contact_form_information',
  'user_mail_password_reset_body',
  'user_mail_password_reset_subject',
  'user_mail_register_admin_created_body',
  'user_mail_register_admin_created_subject',
  'user_mail_register_no_approval_required_body',
  'user_mail_register_no_approval_required_subject',
  'user_mail_register_pending_approval_body',
  'user_mail_register_pending_approval_subject',
  'user_mail_status_activated_body',
  'user_mail_status_activated_subject',
  'user_mail_status_blocked_body',
  'user_mail_status_blocked_subject',
  'user_mail_status_deleted_body',
  'user_mail_status_deleted_subject',
  'user_picture_guidelines',
  'user_registration_help',
);

$update_free_access = FALSE;

ini_set('arg_separator.output',     '&amp;');
ini_set('magic_quotes_runtime',     0);
ini_set('magic_quotes_sybase',      0);
ini_set('session.cache_expire',     200000);
ini_set('session.cache_limiter',    'none');
ini_set('session.cookie_lifetime',  0);
ini_set('session.gc_maxlifetime',   200000);
ini_set('session.save_handler',     'user');
ini_set('session.use_cookies',      1);
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid',    0);
ini_set('url_rewriter.tags',        '');

ini_set ("session.auto_start", 0);


texts:
I want do something after the eventAfterRate in php,
and I have use the rate rules http://drupal.org/project/voting_rules  ,the result turn out not after,and the same as implement the hook_rate_widget_insert.
so is there api for  After rate_save_vote?


texts: How can I load CSS files located outside the web root from within a custom module?

texts:
I need to store my css files at a location outside Drupal's path (e.g. /srv/assets/css/my_site/general.css). I attempt to achieve this using drupal_add_css but the browser loads them from:

http://www.my-site.com/srv/assets/css/my_site/general.css which results of course in 404 error.

Any idea how to load those external (file system) CSS files from within a module? note: I am using Linux.


texts: Glossary mode on View Block disappear once a letter is clicked

texts:
I know how to attach Glossary mode into View page, based on setting here. I have tried to attach this mode into one of my block, but it does not seem to work. Is there a solution that work for block with Glossary mode?

--- Update on March 28, 2015 ---

I fixed by adding a View page(then I disable this) and that Glossary mode just work fine on block, except it will disappear once a letter is clicked. I found a solution about this issue on Drupal 6. Does anyone know how to fix this on Drupal 7?


texts: Storage of the images in Drupal-Commons 6.25: serious troubles acompanied with CHMOD & CHOWN-issues

texts:
Where do the image files reside? I have problems with the files, and the permissions. On my site, which runs Drupal-Commons, I cannot upload any image, either to a user or a group.

I was not able to fix it. First of all, regarding the user, my server works with the SETGID-bit enabled, and with the user vhost:vhost.
The bad is that every time I touch the chmod, I lose the setgit-bit; I tried changing it to 2777, and then all gets lost. I lose the style too.

What can I do? Can I upload the images manually, and store them into /home/vhost/WWW/schulcenter.org/sites/default/files?


texts: Drupal.settings.mymodule is not an object

texts:
I have implemented a hook_menu() with a callback to check user's privileges and a page callback to create the html. When I am in page_callback(), I retrieve a JSON string from a db and I'd like to pass this string to a JS script that will do some visualization.

function page_callback( $id ){
    $myjson = mymodule_query($id);
    $vars = array('key' => $myjson);
    drupal_add_js(array('mymodule', $vars), 'setting');
    drupal_add_js(drupal_get_path('module', 'mymodule').'/js/myjs.js');
    return '

';
}

In the JS file, I have:

(function($){
    Drupal.behaviors.mymodule = {
        attach : function(context, settings) {
            if(Drupal.settings.mymodule.key !== ''){
                alert('Got it!');
            }
        }
    };
}(jQuery));

When I try to execute this code, I get:

TypeError: undefined is not an object (evaluating 'Drupal.settings.mymodule.key')

Is there any other way in D7 to pass a php variable at runtime to a JS script?

EDIT: trying to follow the advice using render arrays, what is the best way to translate my code? Here's what I have:

function page_callback( $id ){
    $output_data = array(
      '#theme' => 'graph_data', // not sure here...
      '#vars' => array('key' => mymodule_query($id)),
      '#attached' => array(
         'js' => array(
              drupal_get_path('module', 'mymodule') .'/js/myjs.js',
         ),
         'css' => array(
              drupal_get_path('module', 'mymodule') . '/css/graph_data.css',
         ),
      )
    );
    return $output_data;
}


texts: What advantages does Features offer in deploying changes

texts:
What advantages does using features to manage deploying changes (versus keeping code updated and data fresh)?

The Features way (near as I can discern):

Features takes configuration (which is ‘content’) re-envisions it as code and builds a module for it, and then pushes it up where it continues to live as an object that has to be maintained as code forever.

The next time the developers update their code, (where the best would include updating their dev database to a fresher copy of production), they get these configuration changes that they too have to manage in perpetuity.

The not really doing anything special way

The original developer updates the configuration on production, (after ironing out these changes in development), then we are done worrying about that configuration change, forever.

The next time the developers update their code, (where the best would include updating their dev database), the configuration changes are included.  No one ever has to worry about overrides and reverting ever.

Obvious Caveat:

If the original developer changes 103 individual settings, remembering and setting them all would be nightmarish.  In this case I would understand using a configuration packager, which is more or less how Features is used, to set the production system to match. But then what?  I don’t understand keeping that project alive after you have updated the settings on prod to match what you did in development.  Features as a fire and forget config missile, I get... as code... I don't get maintaining it after the fact.

===================================

I started out this post open to Features, after it was regaled by some incredibly trustworthy Drupal gurus.  I had a bad feeling about it, but hoped it would wane.  After writing this, again find myself frustratingly opposed to something everyone else seems to think is the best thing since sliced servers.

The features ideals I can’t wrap my brain around:

I have always approached Drupal with a philosophy less eloquently described by one aforementioned gurus as: “Content comes down, code goes up.”

In Drupal 7, configurations for the system and modules is stored in the database.  The dotted line I've drawn in my perception demarcates content from code is right on that line; code is stored in files managed in Git, content is entered into the UI and stored in the DB.

Using Features for Structure:
On my gut feeling about exports and features, another Guru said: “It’s going to end up in a file one way or another”.

I didn't argue at the time because I wasn't seeing his perspective and wasn't comfortable calling him on it (guru vs. marginally experienced flounder).

I've never thought about it because I wasn't using the paradigm he was thinking about (developer).  I had always just imported the structure, because my brain is always in a different paradigm (site builder) when I’m working with structure.

I haven’t ever done it the way he described.  It is actually clever, and I can see using that method in certain cases.  I realized later when my brain was back in developer mode that I have done something similar this, in a different sort of way; I use Form Builder to build rough forms quickly, then drop them into my code, I don’t export them, because Form Builder gives you access to the code for their construction as you build them out.

This makes me hesitant to say “Features is teh Ahhsumz”

So what am I missing?


texts: Get the value of a form element returned from an ajax callback function

texts:
I have a select element and submit button in my form :

$form = array();

$form['myid_template'] = array(
    '#type' => 'fieldset',
    '#title' => t('Select Template'),
    '#suffix' => '

',
);

$form['myid_template']['template_options'] = array(
    '#type' => 'select',
    '#options' => array(
         1 => t("Student"),
         2 => t("Employee"),
     ),
     '#default_value' => 1,
     '#title' => t('Select'),
     '#ajax' => array(
         'callback' => 'myid_select_template',
         'wrapper' => 'myid_dynamic_input_information',
     ),
);

 $form['submit'] = array(
     '#type' => 'submit',
     '#value' => 'Save',
     '#ajax' => array(
         'event' => 'click',
         'callback' => 'myid_user_page_form_ajax_submit',
     ),
 );

My select form element calls an ajax function myid_select_template that adds a field and updates the form.

function myid_select_template($form, $form_state){
      $form = array();
      $form['form']= array(
          '#type' => 'fieldset',
          '#title' => t("Employee's Information"),
      );

      $form['form']['template2_field1'] = array(
          '#title' => t('GSIS No.'),
          '#type' => 'textfield',
          '#description' => "Government Service Insurance System number.",
          '#attributes' => array(
              'id' => $template . '_field1' ,
          ),
      );
      return $form;
}

My problem is, after myid_select_template is called, whenever I click the submit button , I cant access $form['form']['template2_field1'] from myid_user_page_form_ajax_submit callback function.

function myid_user_page_form_ajax_submit($form, &$form_state) {
    dsm($form);
    dsm($form_state);
}

I did try to display my $form and $form_state variables but I cant find the value of $form['form']['template2_field1'] in it. What should I do? Does it have connection in rebuilding the form? Do I have to rebuild the form to update the $form_statevariable? If yes, how?


texts: How can I get a list of all active enabled contexts on drupal site with drush?

texts:
I can list all enabled modules by calling drush pml.

I can also used flags to only return certain kinds of modules, based on where they are enabled or not and so on:

Show a list of available extensions (modules and themes).

Options:
 --type                                    Filter by extension type. Choices: module, theme.
 --status                                  Filter by extension status. Choices: enabled, disable and/or 'not installed'. You can use multiple comma
                                           separated values. (i.e. --status="disabled,not installed").
 --package                                 Filter by project packages. You can use multiple comma separated values. (i.e. --package="Core -
                                           required,Other").
 --core                                    Filter out extensions that are not in drupal core.
 --no-core                                 Filter out extensions that are provided by drupal core.
 --pipe                                    Returns a space delimited list of the names of the resulting extensions.

How can I list all the contexts enabled on a site in a similar fashion, so I can rype something like drush context-list


texts: AJAX form submit by clicking on any element with the #ajax property

texts:
I have been searching for this a lot but all the tutorial on the net only show how to create an ajax form with #ajax on the submit button if you want to submit the whole form.

What I am trying to achieve is this: I've got a custom form with lots of checkboxes, all of which set values in an array stored in $_SESSION. When I attach #ajax to a checkbox the form gets replaced, but the $_SESSION array does not change as if the form as a whole has not been submitted.

How can I achieve that when I click on a checkbox the form submits as if I clicked on the submit button and the $_SESSION array is set correctly?

Thanks a lot in advance.


texts: How to set permissions of fields programmatically?

texts: Using field permissions module, How do I can set/edit permissions of fields to the roles? I took a look at its module but I couldn't find out how it stores its permissions in the database.


texts: Displaying taxonomy term list within another taxonomy term

texts:
I have a vocabulary that list schools that users can select on registration and other vocabularies for books and courses, used on nodes.

Under each school's term page I would like to display a list of terms from Book vocabulary and other vocabularies and clicking on the any of the terms will list nodes with the term.

CT>Ucon

Books

textbooks
fiction
animes

I have thought of using panel to display school terms and then place a block of the book terms in a region in the panel, but I'm not sure how to go about it especially the URL. I would like the url to look like uconn/books/texbooks.

Additional info: Craigslist has similar nested categories. You have city category then under each city you have sale, services, community sections. This is what I'm trying to achieve. I want each school to have their own sub-categories listed under them.


texts: Is it possible to hide the title of a block in a region to render it separately from the content?

texts:
I'm styling a custom region for the "Active Forum Topics Block" that's included with Drupal. can I hide certain elements in region--[name].tpl.php like as it is done in node.tpl.php?

This is part of my node.tpl.php:

    // We hide the elements now so that we can render them later.
    hide($content['comments']);
    hide($content['links']);
    hide($content['field_image']);
    hide($content['links']['#links']['node-readmore']);
    hide($content['links']['#links']['comment-add']);
    hide($content['field_tags']);

I would like to do this if it's possible in region--forum_topics.tpl.php (example name "forum_topics"):

    hide($content['???']);

I don't know what the proper way is, for region.tpl.php. If this is possible, what can I put between brackets to hide the title of the block? If there is a documentation page I can see for more than just the block title, can you please link it?


texts: I have some text in my page. and a read more link. When i click on the link, it should open the text in a pop up window. Is there any module to do this? i need to just open the text in pop up not some URL /Html Page.


texts: Bulk update for unchecked "Generate automatic URL alias"

texts:
I have a lot of programmatically generated nodes with the option "Generate automatic URL alias" unchecked, so i can't use the Bulk Update of the pathauto module.

How can i to bulk generate the pathauto alias for these nodes?

Edit: i use Drupal 7


texts: Add javascript to returned form after ajax validation

texts:
I've built a form with the form API, and it's submitting via ajax via this type of thing:

  $form['submit'] = array(
  '#type' => 'submit',
  '#value' => 'submit',
  '#ajax' => array(
      'callback' => 'handyman_form_callback',
      'method' => 'replace',
      'wrapper' => 'form-wrap',
      'effect' => 'fade'
  )
);

The problem is, if the form is returned due to validation errors the javascript applied to the form no longer works. I've read lots about the attachBehaviors function but I'm not sure where I could put this to make it work, and not sure if this is even the correct thing to do.

Any help?


texts:
We are using a public apache web server as a reverse proxy for to show a drupal instance (to the client). The website should come up in http://publicSite/path
The Reverse proxy contains basic apache configuration pointing a "subfolder" to the internal webserver. Something like:

ProxyPass /path http://internaldomain/
ProxyPassReverse /path http://internaldomain/

The problem is that Drupal 8 has no longer a $base_url and the site is broke (CSS, JS). Adding publicSite in the $settings['file_public_base_url'] does not help. CSS/JS and links to themes are still broken.

There is a settings section on a Reverse Proxy in the settings.php, but it does not address the issue on accessing the website from a /subfolder url.
Any hints to solve this issue!?


texts: How to allow user of certain role to create user only of selected roles?

texts:
I have few profiles. One profile per role. I've created few registration paths by Profile2 Registration Path module.

I have an issue with permissions, for example I want  allow user of role A, to create users of roles A or B, but because Profile2 Registration Path uses 'administer users' permission on it's registration paths, certain role can create users of all roles or none at all. Maybe I missed something, but I'm stuck.


texts: How do I synchronize sites/default/files wtith a AmazonS3 bucket?

texts:
I need to sync sites/defalut/files with a amazons3 bucket. I found the AmazonS3 module, which replaces the storage location, while I still want to use the files at sites/defalut/files.

I want to use AmazonS3 as a sort of backup, and not as a storage solution. The files will not be served from it.

How can I do this?

I also found the Storage API module.


texts: How to generate a List of Dates with Start/End sorted by Month in Drupal7?

texts:
I have installed Drupal7 and created a content type (why not call it 'event' for now) to which I added a date field (lets name it 'event-date'). Some event-dates have start- and end-dates.
Now I want to generate a list of these events sorted by Month, where every event is listed in one line, even the events with start- and end-dates should have one line for every day the event lasts - not only the start-till-end-row listing.
for example instead of

JANUARY
Mo, 04/02/2013 - 20:00 to Th, 06/02/2013 - 20:00  Event1

I need

JANUARY
Mo, 04/02/2013 Event1
Tu, 05/02/2013 Event1
Th, 06/02/2013 Event1

How could I realize that? thnx!


texts:
I'm currently troubleshooting an issue where anonymous users and certain roles see a different set of results from a view than administrators and roles with more permissions do. The view is supposed to have two node results, but for anonymous and others, there is only one.

I am trying to get the full SQL of the final query that's creating the anonymous pages. I'm using hook_views_query_alter(), and I can get the full query using dpq($view->query->query()); when I'm logged in as an administrator.

However, when I'm an anonymous user, or one of the other roles encountering the bug, I get SQL like this: ((taxonomy_index.status = :db_condition_placeholder_7) AND (node_field_data.type IN (:db_condition_placeholder_8))).

I tried getting the placeholder values from a technique I used in drupal 7, using the arguments() method, but apparently that doesn't exist in Drupal 8.

But moreover, I would like to avoid matching up the string db_condition_placeholder manually, because I could make a mistake, and misdiagnose what the source of the problem is. I want the full query string that drupal sends to the database, so that I can debug it directly with the MySQL server.

I tried other techniques listed here, such as ->addTag('debug'), which apparently did nothing, and kint($view->query->query());, which only returns output for administrator users.

How can I get the full query string from a view executed for anonymous users?


texts: I want to show recently viewed node in block, this can achieved using Statistics module or recently_read module. But I have disabled statistics module for some reason and recently_read module disables page caching as they mentioned in the project site. Is their any other way for creating the recently viewed block?


texts:
What URIs are accessed by drush up? Is it drupal.org? Are there any other URIs?
I have tried using drush up --debug, but I can't seem to find a list of URIs. I have also googled it using the key words drush access URL and drush access URI, among others.


texts: Views (Search API): Search taxonomy parent and display all children

texts:
Problem

I have a country taxonomy field. The top level is continents then below that countries:

Asia
--China
--Thailand
Europe
--France
--Germany

I'm using search API (with solr backend) to index.
Views to display the results.
Views exposed filters to search.

How can I set-up the search, so a search on a parent term (e.g. Asia) displays all it's children (China, Thailand etc.)?

So Far

I think the relevant solution if you're not using Search API is described in this page:

Use views to display taxonomy children terms from parent

I think you have to add a contextual filter which sets the rules for taxonomy, however this doesn't seem to be an option in Search API. There are also no contrib modules which solve this problem.

Has anyone tackled this before?


texts: views filter: problems with the query object

texts:
I am trying to get my filter query ready, but I don't understand how any of the query object works. my actual SELECT query looks like this:

SELECT nid
FROM `field_data_field_verein` verein
LEFT JOIN `ds_vereine` ON ds_vereine.tid=verein.tid
WHERE ds_vereine.plz IN
  (SELECT ds_plz_distance.plz_first
  FROM `ds_plz_distance`
  WHERE ds_plz_distance.distance < 20
  AND ds_plz_distance.plz_first=ds_vereine.plz)
OR ds_vereine.plz IN
  (SELECT ds_plz_distance.plz_second
  FROM `ds_plz_distance`
  WHERE ds_plz_distance.distance < 20
  AND ds_plz_distance.plz_second=ds_vereine.plz)
OR ds_vereine.plz IN
  (SELECT ds_plz_ort.plz
  FROM `ds_plz_ort` ort
  WHERE ds_plz_ort.kreis=306)

I honestly do not know how to use $this->query->add_where() function to incorporate this query. All it gives me is a fatal sql error.

you can see my views filter handler functions here: views filter: broken filter - but what's broken about it?

thanks!

Edit

Following Countzero's advice I took the plunge and delved deep into the views-api/code. Two problems I struggled very strongly with were a) joining the required tables the right way and b) implementing the subqueries. I'll shortly explain what I found worked for me.

a) I followed the api-docs and told views my used tables in hook_views_data. Don't. Instead join it in your filter. In short:

$join = new views_join();
$join->construct('table','left_table','left_field','field');
$this-query->ensure_table('table',$this->relationship,$join);

b) It is actually not a problem at all to nest conditions and thus subqueries. It was quite difficult to find out what you have to pass as an argument in the add_where function, so I tell you here for your convenience (;)):

$subquery=db_select('table','table_alias')
  ->fields('table_alias',array('field'))
  ->condition('table_alias.condition_field',20,'<')
  ->where('table_alias.condition_field=base_table.bt_field',array());
$this->query->add_where($group,'base_table.bt_field',$subquery,'in');

Note: The key lies in constructing the select query without executing it and passing it as a value directly.


texts: In which scenarios should i create a custom entity (content or config) rather than using content type?

texts: I have always this question in mind, what are the perfect scenarios to create custom entity rather than using existing Drupal's entities ?


texts: Newbie: Using css to style fields in a content type

texts:
I created a content type using html elements as fields and groups. The content type configuration page allows me to add classes (and id attributes) to the elements; however, they don't show up in the generated html when I view page source in a browser.

I gather from Add a CSS class to field in content type that I must modify php functions to actually include the classes in the output css; however, I'm a newbie and don't really understand the post.  It refers to a blog post which is no longer available.

I can't find the function ( theme_field ) in any of my template.php files.  Can someone help clarify this for me.  How can I get my own classes into drupal output.

Thanks.


texts: How to hide programmatically timezone and location on a custom user edit profile page in Drupal 7?

texts:
I need a custom user_profile_form in a page of my drupal site containing a subset of fields provided by the form. I created it and rendered it this way:

function mymodule_join_experiment_contr_strict_mode($exp_node, &$form, &$form_state) {
  module_load_include('inc', 'user', 'user.pages');
  global $user;
  $user = user_load($user->uid);
  $form = drupal_get_form('user_profile_form', $user, 'account', 'strict_mode');
  return $form;
}

Now in my custom function mymodule_form_user_profile_form_alter(&$form, &$form_state, $form_id) i'm doing

$form['picture']['#access']=FALSE;

in order to hide the field 'picture' and any other field i need to hide. In the form i have two collapsible named 'location' and 'timezone', provided, i think, by 'location' or 'gmap' module. (I didn't realized all this site so i don't really know everything about it.)
Now, even looking at $form i can't see the equivalent for timezone and location. I expected to find something that allowed me to do

$form['timezone']['#access']=FALSE;

but i cannot find timezone and location... What i am doing wrong?

EDIT: i'm trying to get what is the right way to do it in drupal, before to surrender and use a 'display:none' on css


texts: Media 'external video' requests iframe over http instead of https, leading to mixed content errors and blocked video

texts:
I have a drupal 9 site where I use the media library. I've created a media type with source "External video", allowing youtube videos. As far as I can see this uses oEmbed.
I've added a media reference field for this type in a contenttype and created content. However, when I try to view the page the video won't show and I have a mixed content warning in the console of the browser.
Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame
 'http://xxx/media/oembed/?url=https%3A//youtu.be/someIDHERE&max_width=890&max_height=560&hash=0nPSIkGE5CqEuiNAmZ1wdR1rXpwkg5r3GkoTyeZaR-g'.
This request has been blocked; the content must be served over HTTPS.

I've set all correct settings for reverse proxy in settings.php, and the base url in the settings reflects this by showing https, but somehow this particular part of Drupal insists on using http, rather than https.
How can I make sure it requests this video frame using https?


texts: Show view result of both flagged users and the flagging user

texts:
I have a views listing the user profile of the users I have flagged by adding a relationship flag, and user profile. Then adding a contextual filter uid for the current user. I want the view to also show the profile of the user himself but it's showing profile of only the flagged users and it's not showing the profile of that user himself.

I want the result to be a combination of the current user, and the flagged users. How to do this?


texts:
i have created on view page which have option to update the node values but as a default behavior of VBO i first need to check the checkbox form my table and then click on update button then it goes to another page where i can select which value to be added

After click on update button next page will come for selection of value

after this selection and next is clicked the value get updated...

here i need to change this whole process to first page only i need my select box (i.e. Workgroup & Project Type dropdown) should come to first page only where i have my list to select the value and update button on click of that the node values should update and i return back to the same page..


texts:
After a form submit, can I create multiple batches based on the maximum table size for the serialized batch string and how can this be done?

I am using a batch process to pass users to an external site using their API.

For each user I set $batch['operations'][] = array('process_funcion', array(LIST OF VARIABLES));

The batch processing works for upto 5000 users; anything over that I get the following error:

  Access denied
  You are not authorized to access this page.

I thought this had to do with max_packet size, but I am not to sure of that anymore.

The batch is being initiated after a form is being processed.

Do you have any ideas on how I can process 5000 users at a time, or why I am getting this error?

I think that the insert to the batch table is to big, so I am trying to split this into separate batches like this.

$contactCount = 1;
foreach ($contacts as $contact) {
  $batch['operations'][] = array('_contact_add_batch', array($module, $acc_id, $Group_ID, $verb,$contact));
  //Due to max_packet_size restrictions, need to set multiple batches
  if (($contactCount % 2000) == 0){
    batch_set($batch);
  }
  $contactCount++;
}
// For the last set of batches, in the event that there is not 2000, lets add them also.
if (!empty($batch['operations'])) {
  batch_set($batch);
}

I am still getting the Access Denied error.


texts:
I have a view of nodes with an AJAX on scroll set up. Everytime a person scrolls down the page new elements inside a view show up (e.g. nodes).

I'm trying to add a new class only to new nodes that show up after each AJAX call. So far I've only managed to add a class to all nodes inside a view using drupal.behaviors, even the ones that were originally visible in the DOM(before AJAX call).

What am I missing?

My current code:

 $(document).ready(function($) {
    $('.views-infinite-scroll-content-wrapper').find('.views-row').addClass('i-was-here-first');
});

  Drupal.behaviors.testing = {
    attach:function (context, settings) {
      $('.views-infinite-scroll-content-wrapper', context).find('.views-row').addClass('i-was-here-second');
    }
};


texts: Better Exposed Filters. How to put slider filter into a collapsible fieldset?

texts:
the module allows you to wrap in fieldset checkboxes, but you can't wrap the slider, why?
how to overcome it?


texts: How do I display a history of messages between two users using the Privatemsg module?

texts:
Anyone knows how to display a list of all messages that two users had shared using the Privatemsg module for Drupal 7? Sort of a history of the conversation between the two users in a block or in a template.tpl.php?

Any help please.


texts: View that lists nodes with link to downloadable file

texts:
I have a content type called "Learning Material" and it has two fields: title of type text and file of type file.

I have a block view that lists all Learning Material.  When I click on the link for a learning material, it takes me to a page with a link to download the file.  I want to have the download automatically happen when I click on the link in the block view.  Is this possible?


texts: CKeditor: Allow choosing CSS classes from a select menu in dialogs

texts:
The idea is to make it easier for content managers, restricting them to choose a CSS class between a preconfigured list.

This feature is already available using the WYSIWYG module (see screenshot https://groups.drupal.org/files/ckeditor-css-config.png) but not using the CKEditor module.

I'm not sure if there is already a contrib solution for this (based on http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Styles for example).

What would be the best approach?


texts:
I am rebuilding an API in Drupal. The structure of the JSON must remain the same.

I am using Views and Draggable Views so the user can order items on an overview page. I Enabled the view for exporting REST JSON.

The response JSON must have a structure like this

{
  items: [{...},{...}]
}

But currently views output is like this

{[{...},{...}]}

I already managed to get my desired output without views and a special export controller but unfortunately, I need draggable views in additions to views.
I also managed to create nested structures with Entity Normalizers inside an item but I want the whole output of the view is wrapped in "items".
Any help would be appreciated.


texts: drush core-config causes 'Permission denied'

texts:
When I use command as follow:

drush core-config

and then enter

1

a error displayed:

sh:/etc/php.ini: Permission denied

how to solve this problem?


texts: Core Search only yielding results on specific words

texts:
We've developed a lot of Drupal 7 websites, but never encountered this before (or just didn't notice). When searching the project in question (while having re-indexed the site untill the index is 100%) for a specific word like met it finds a basic page node which contains that word, perfect. Though when looking in the same node and trying the word emissiespectograaf we cannot find the same node nor any other. This goes for a lot of other words, long or short.

I'm just not getting it, it finds one word in a node but another word, which I know for sure that is in the same node, it's unable to find it. Even though the index has been built for 100%.


texts: How to add twig template suggestions per display mode with custom module?

texts:
I have a custom module where I am trying to use custom twig templates based on the user view mode. The templates files I am trying to add to my theme are:

user.html.twig
user--compact.html.twig
user--token.html.twig

These reside in a folder called MYMODULE/templates/.

This is my current module code:

module_name.module:

/**
 * Implements hook_theme().
 */
function MYMODULE_theme($existing, $type, $theme, $path) {

  return [
    'user' => [
      'template'  => 'user',
      'base hook' => 'user',
    ],
    'user__compact' => [
      'template'  => 'user--compact',
      'base hook' => 'user',
    ],
    'user__token' => [
      'template'  => 'user--token',
      'base hook' => 'user',
    ],
  ];

}


texts: Add custom forms in checkout process in commerce kickstart

texts: In Commerce Kickstart checkout process Checkout,Review order,Payment,Checkout complete are sections. I want to add one more section like Availability. How should I add?


texts: In a general sense, what is the purpose of the Drupal DB Semaphore Table

texts: I understand the purpose a semaphores in IPC programming but I'm not finding a good, or any, explanation as to the purpose of this table.


texts: How can I modify the values in variable table using phpmyadmin?

texts:
I modify the site name in variable table using phpmyadmin as below.

s:21:"example@example.com";  to  s:21:"example@example.info";

But then when I run cron I get the follwoing message.

  Warning: Cannot modify header information - headers already sent by (output started at /public_html/includes/bootstrap.inc:566) in /public_html/includes/bootstrap.inc on line 739

This is just a examle, but if I change something in variable table using phpmyadmin I always get the same error.

When I modify variable table do I need to modify also other tables at the same time ?


texts: Is it possible to restrict the site search module to specific nodes?

texts:
I am trying to figure out a way to provide a search for a specific set of nodes. Currently it seems that the site search is not configurable in this way. Is there any way to change this functionality, or other modules that provide a search for a defined group of pages/nodes?

Thanks!


texts: Displaying fields in entity_reference data

texts:
I'm using the entityreference module to provide my "Concert" content type with a "Program" field (machine name "field_program"), containing multiple "Song" nodes.  Each Song just has two fields: Title and Composer (machine names "title" and "field_composer").

What's the best way to control the display of a Program field within a Concert node?  I tried creating a "node--field_program.tpl.php" file, but that didn't seem to have an effect.  I also created a View that lists Song nodes in basically the way I'd want, but I don't know how to use that in the context of displaying a Concert node.


texts:
I have an event dates field that allows the user entering content to put in a start and and end date. By default it just shows them the start date. If they check a box it shows an end date and they can fill that out. So far so good.

However, I'm noticing that if they don't check the box and don't put in an end date it auto-sets the end date to be the same as the start date. This is not what I want. I want the result to be empty (mainly for Views so I can set it to not display if its empty).

Any idea how to fix this?


texts: How to render input inside of label for checkboxes?

texts:
I have a form field with a list of checkboxes, but the inputs are outside of the label. Theming requirements dictate that the input must be inside the label, as well as have a span with the form option name in the input tag.

I tried looking at form-element.html.twig and form-element-label.html.twig but don't see a way to combine the two.


texts: Views query alter add orderby function FIELD()

texts:
I can't figure out how to add following expression to the views query:

ORDER BY FIELD(field_dataid,3,2,1,4)

QueryPluginBase only gives the option to add:

$query->addOrderBy('node_field_data', 'nid', ASC);

But doesn't give the option to add an expression.

The Sql interface has the options to add an expression:

  $query->addExpression('FIELD(node_field_data.nid,3,2,1,4)', 'order_field');
  $query->orderBy('order_field', 'ASC');

But this doesn't work with the views query object.

So how can i add orderby expression to the views query object?


texts: db_query('SELECT nid FROM uc_products'); doesn't give any results! Why?

texts:
There's a really simple query related to the enabled and working Ubercart, where the task is to get all the nids from uc_products table, which simply doesn't give any results:

$query = 'SELECT nid FROM uc_products';
$result = db_query($query);
dsm('===================================================');
dsm($query);
while ($nid = db_result($result)) {
    dsm('$nid: '.$nid);
}

BUT when I run the very same query in the same database in phpMyAdmin, it works, and it gives me ALL the correct results (I have 8 products now).

BUT the following queries work correctly, and give me all the expected results (the first is the strangest, because vid field is of the same type, but only has another name):

$query = 'SELECT vid FROM uc_products';
$result = db_query($query);
dsm('===================================================');
dsm($query);
while ($vid = db_result($result)) {
    dsm('$vid: '.$vid);
}

$query = 'SELECT * FROM uc_products';
$result = db_query($query);
dsm('===================================================');
dsm($query);
while ($row = db_fetch_object($result)) {
    dsm('$row->nid: '.$row->nid);
}

$query = 'SELECT nid FROM node';
$result = db_query($query);
dsm('===================================================');
dsm($query);
while ($nid = db_result($result)) {
    dsm('$nid: '.$nid);
}

Here's a screenshot of the test results:

As you can see, the first two queries don't return any results, while the others work correctly.
This is a really strange problem. I didn't modify the core modules, so I don't understand the situation. It doesn't matter whether I run it on localhost or my ongoing public server, the result is the same. This means that uc_order_condition_has_products_form() in Conditional Actions menu doesn't work correctly either. I've never ever met such problems in Drupal.

Does anyone have a clue where I should start debugging?


texts: Drupal 7 clearing validation error messages

texts: When an image upload fails validation an error message is thrown on the form, when I then upload an image that passes validation, the previous error message is not cleared from the form. How is this accomplished? Thanks.


texts: Webform show custom composite result at their own line in submissions download

texts:
I have a webform with a custom composite field
THE custom composite has one text field that can be repeated an unlimited amount of times

here is an image of the form:

What I want is to show each student name in a separate line when I download the results.
Is it possible to do it using a module?
if not I will be glad to hear if there are hooks that can manipulate the downloaded data


texts: Change node language from Language neutral to English in bulk using VBO

texts:
I have enabled entity translation and multi-language feature to an existing Drupal site. Currently all nodes in the site are set as Language Neutral, so the translation tab wont appear. If I edit a node and manually change the language to English the translation tab will appear and I can add the translated content for other languages.

I've tried the VBO - Modify entity values operator method mentioned at How can I set the language of nodes in bulk to existing content when making a site multilingual? but after changing the language from language neutral to English via VBO, the body content is not displaying when I edit the node later. The body content will appear if I change the value back to language neutral. It looks like the language of the field body is not change with the view bulk operations.

Is there any way I can can do a bulk operation and change the language of the nodes in bulk so that the nodes are translatable?

Thanks


texts:
I want to change the breakpoint of the Bootstrap Responsive Menu, from 768px to 900px. There is a simple way to do this by modifying @grid-breakpoint in variables.less; I have installed the less module, but yet changes there are not having any effect.

The code for the media query is being called in bootstrap.min.css via CDN. Can someone help? How do you recompile the CSS after making changes to the .less file?

On Bootstrap's site you can configure what you want and download; in Drupal this isn't the case, nor is there any config in the admin UI, to make these simple changes.


texts: Is drupal able to handle technical data sheets?

texts:
I already posted a similar question on webapps.stackexchange.com and was redirected here, since I mentioned Drupal. Here is the slightly updated question:

I am a php developer and didn't have the chance to work with a CMS for ages, and I couldn't find any decent solution for my problems throughout my internet searches.

For a new project I am working on, I need to provide an application which can allow a few users to create and handle numerous technical datasheets (around 1-2k). The application should be able to handle a few different kind of sheets, whose structure and contents are known and static: few lines of text, some geographical data, numeric coefficients and pictures. It should also be possible to attach files to one sheet (let's say a .zip, a .doc, or whatever).

Users should be able to:

Create and edit sheets.
Search through them
Export them to various formats (pdf, doc, xls, etc.)

Administrators should be able to:

Create and manage users.
Create new types of datasheet.

One important feature is the non-concurrent editing (i.e. a sheet should be locked if someone is editing it).

At first glance, I was willing to create all that from scratch, with my little hands and a decent php framework. But then I started to think (it happens...), and was wondering if a CMS wouldn't to the trick, since this is what I'm searching for: a (specific) content management system.

I had some little experience with drupal, which allowed to create custom nodes. Wouldn't that answer my problems? A node would then be a specific type of datasheet. The different possible actions of users and administrators (create, update, search, export, etc.) being handled by drupal core functionalities. Am I right?

If so, is there any specific module I should look into?

Thanks in advance for your help!


texts: Change CSS of grid view (Not just for a field) in Drupal 7

texts:
I designed a grid of 3 columns in Drupal 7 using view. Below is the default outcome-

It doesn't look beautiful. Hence I want to change the css for each row and column, something like following-

I already have awards and award-list class defined inside style file. But I don't know how to configure the view, so that it uses these class instead of default classes.

Notice carefully the first image, in which I am able to add the css class awards (in the first line div). Also I am able to add css to each td element. This is perfectly fine. The problem is that td has some more parameters defined such as background, color, text-align, border etc, which I don't need for this view. Also there are few more unwanted attributes defined for table class view-view-grid cols-3. These elements are background and border, which I don't want for this view.

I found out a workaround, in which I redefine all these attributes inside style.css and I changed the border from 1px to 0px etc. See below the css, which I appended in style.css-

.awards table{
  background: #BAF5D9;
  border: 0px;
}

.awards td{
  background: #BAF5D9;
  color: #333;
  text-align: center;
  padding: 0px;
  border: 0px;
}

Here #BAF5D9 is background color of the theme. You can notice that it not a proper way to redefine. as the css is getting bigger.

I want to configure this view, in such a way, so that these attributes don't be generated.

Please have a look. I really appreciate your help.


texts:
I have a "video" content type, and I want from users watching my videos to answer some questions related to each single video.

Can you advice me, how can I create a quiz for each single video content ?
Is there a module (I tried the quiz module but it's very complicated) to do that, or any other way will be apprecited.

thanks in advance.


texts:
I want to save a user's email and username when a button is clicked.
I assume I have to do this via PHP but I can find the user column at localhost/phpmyadmin. Where is the users' information being stored and which is the MySQL query to achieve that?


texts: Changed DNS and some sections shows Fatal error: Call to undefined function node_load()

texts:
I was working in the site http://www.bicevolution.com.ar/ (drupal 7) , Asked to the owner to redirect de DNS for www that were wrong. When they changed that, lot of sections of the site broke and started showing Fatal error: Call to undefined function node_load() (like here http://www.bicevolution.com.ar/productos-para-colorear-0?id=4212 )

Can anyone help me to fix it?

Thanks!


texts: Manually deleting images (from db and file_usage table)

texts:
I was given 'temporary' images for a number of bio pages, and now have better quality images to replace them with.  Removing or replacing the old images in the Admin UI is failing (without giving me any error messages or indications of anything wrong: the old image is just there no matter what I do).  If I connect to the server by SSH and rm CEO.jpeg from bash, then the database is out of sync with the file system, and when I upload the new version of CEO.jpeg, I get an error because that is already in the database.

If I just edit the file_usage table and set count to 0, will that have any nasty side effects?  (I will also, of course, manually delete the file from the file system.)   Do I have to manually track down each node and edit it too?  Or can I just go to those nodes in the Admin UI after manual removal and add the new versions of the images?

(I've checked answers to this question and this question but the situation in those is very different.)


texts: How do I use an Entity Reference List view display with a webform entity select/radio field?

texts:
I'm using Drupal 8, and have a webform for users to designate a proxy at meetings. The webform has a field for meeting date, and I want to restrict that to scheduled meeting dates.

I already have a content type for meeting announcements, so I added a view with format Entity reference list, with one field for Meeting date. In the preview, I get the result I want: a list of datetimes for future meetings. I then added an entity select field in my webform, and chose the entity that I created. But the form shows the title of the node (e.g, "Announcement: Meeting on June 2, 2018"). How can I get just the date (e.g., "June 2, 2018") in the webform?


texts: how to call a webservices on hook_form_FORM_ID_alter but not when the form is submitted and validation raise no error?

texts:
I have to call a webservice than dynamically modify the form. I used hook_form_FORM_ID_alter to do that. The problem is hook_form_FORM_ID_alter is also called on submit event when the form is not going to be displayed again to the user.

How can I avoid calling the webservices two times? The information gathered with the webservice are not important for the validation...

This is also linked to this question hook_form_FORM_ID_alter called twice after submit


texts: Problem between Organic Groups and Articles/Pages?

texts:
I am currently working within Drupal 7 and I have all of the Views and Organic Groups modules enabled. Currently when I create a new article or page on my site it appears fine on the front page of the website. Yet when I click to view/edit the article/page I am unable to see the body of the article/page even though I can see it on the front page.

When I disable the module Organic Groups Field Access I am able to see the body of the article/page at the front page, view and edit screens.

Is there some way to keep the module Organic Groups Field Access and still be able to see the body?


texts: emailing users in user reference field with rules

texts:
I am working on a site for an academic conference. Right now, we have two content types (1) proposal and (2) peer review. In the proposal content type, an author can add multiple presenters to a user reference field. When the node is saved, I have a rule that loops through the user reference field and sends an email notification to all the presenters that the proposal has been submitted. Works great!

Now the question. I want to send an email to that same group of users when someone else posts a peer review. I have figured out how to notify the "author" of the proposal but I want to notify all the users listed in the node reference field.

Right now my rule is set up as follows:
Event: after saving new content
Conditions: content is of type > peer review
Actions: Fetch entity by property:
-Value: node
-Value: node reference
-Data selector: node
Variable label: Fetched proposal
Variable name: fetched_proposal

Then I have a loop:
Data selector: fetched-proposal
Current list item
Variable label: Current proposal item
Variable name: proposal_list_item

Then I have an action to send the mail. Since I've looped over the proposal connected to the peer review, I have available a token for the presenter field which contains the node reference. I've used that token in the "To" value field.

I think this should work but I don't get emails when testing.

When I check my log messages I see this error: The loop Loop () fails the integrity check and cannot be executed. Error: Data selector fetched-proposal: for parameter list is invalid.

Can anyone help me figure this out?


texts: Use hook_hook_info() to implement hook_form_FORM_ID_alter()s in a separate file

texts:
I have a lot of mymodule_form_FORM_ID_alter()s in my module and I want to move them to a separate file (mymodule.form.inc), I found hook_hook_info() but I couldn't figure out how to use it for that specific case.

I tried adding:

$hooks['form_alter'] = array(
  'group' => 'form'
);

to mymodule_hook_info() but it didn't run the form alterers that I moved to the separate file. Any ideas how to get it to work?


texts: No class for images when working with a specific theme (no .field--name-field-)

texts:
I have installed a new theme and when I go to DOM I can't see classes for the image fields; These are available for styling the page's image fields.

For example, if I write in the css file: .field--name-field-bestimageever img {display: none;} the image keep appearing.

This never happened to me with any other theme and I would thank an experienced themer for giving an explanation on how to add this, from which many other people could enjoy.


texts: Comparing current user email with a field in a content view: is it possible?

texts: I have a content view, and want to filter it on field_email_field == current_user.email. I know you can filter on current user, and I know you can get user's email if the view was based on the user table. But I want to add the current user's email as a field in the content view, so I can use a Global: Fields comparison filter. Is this possible? Or another way to accomplish this?


texts: How can I insert a variable into query condition?

texts:
I am writing a query, and the question is how can I insert an array variable into condition statement. So instead of having (1060,968,1106) I would like to place there an array.

$fields; // array with some predefined ids
$query = $this->connection->select('node', 'node');
$query->innerJoin('node__field_field', 'nfc', "nfc.entity_id=node.nid AND
                (nfc.field_field_target_id IN (1060,968,1106))");

I tried

$query->innerJoin('node__field_field', 'nfc', "nfc.entity_id=node.nid AND
                (nfc.field_field_target_id IN ".$fields." )");

But it doesn't work, could you please help me?


texts:
I have a content type Cars and a content type WheelManufacturer.
Of course a WheelManufactorer node is referenced by a Car node.

I'm trying to create a View (in D8) that will fetch some fields from the Car nodes and some fields from the corresponding WheelManufacturer node.

I'm trying to do that by using relationships in Views... but I have a problem: I can add relationships to, ie Term Reference or Image fields, but not to Entity Reference ones... those fields just don't appear in the list.

Any ideas why?


texts: user relationship status as a visibility rule per panel pane

texts:
how make a visibility rule based on UR status I've made a function to get the status between the visitor and the visited profiles

I ask if the module provide it or could i make it appear in visibility rules for panels module if it provide any hooks for that


texts: #value or #default_value missing from field in $form array

texts:
I made a custom content type with a couple of fields. If i go to node/add/custom-content-type
I have a dsm of $form in my .module file which shows the array in a krumo just fine. In the krumo the array shows the custom fields made in field UI, and each field has an array of 6 elements. Here's where the key #value and #default_value are missing.

Instead, the 6 keys are:

#type (String, 9 characters ) container
#attributes (Array, 1 element)
#weight (String, 1 characters ) 1
#tree (Boolean) TRUE
#language (String, 3 characters ) und
und (Array, 13 elements)

So obviously the question is how do I get those keys/attributes of that field in that array?


texts: Form doesn't update via hook in edit mode, instead of it page reloading

texts:
This is not happening all time (possibly for big amount of existing field, I'm not sure, with less amount of fields form is saving as it should) when I'm adding new Field collection entity or update existing field.
Using common role for this on save via button, which assign func with code to compare and save data using hook_form_FORM_ID_alter(), it just reload page without changes (ajax post request contains new fields values, but response on it return only previous version of page in html).
Using the admin role I'm instantly getting ajax warning with status 200

Chrome says parsererror
Firefox says OK, path: system/ajax, no text, in journal i have "Invalid form POST data", but my POST data definitely valid.

Watchdog logging show me that func for saving data isn't triggering, and after page reload it just reassign func to button via hook.
Installation:

Drupal 7.67
jQuery 1.9 (tried from 1.4 to 1.12 - no impact)
php 5.6.40
post_max_size=512M
memory_limit=512M
max_input_time=600

Tried adding additional caching via boost, decrease weight of module which contains saving hook - no impact. Please help.


texts:
I'm building a multi-language site using the internationalization set of modules.
The problem is that I've done any queries to extract for example nodes or taxonomy terms with selection of language in the code(back-end) and what language reference or defauld language value I will use to compare or execute queries? Every user that is connected on the site I think they must have each a variable that indicates the language that the user have choosen and if there isn't, uses the browser language.
I've tried with the global variable $language but this is for all the web site and it's user independent.
I hope you understand my question! Thanks..!


texts: Exposed Form: Send only selected filters

texts:
I have a view with several exposed filtears. The filters are of different types: checkboxes, taxonomy autocomplete and some jquery slider (I use Better Exposed Filters module).

The view shows all nodes of type A. Node type A has 15 field, each of which has a respective exposed filter within the view. Not all fields are mandatory which is why some nodes don't have value for all fields.

My problem is this (just an example to demonstrate):

Field A1 is called 'Location' (taxonomy) -- this is a mandatory field
Field A2 is called 'Retail purchasing power' (jquery slider with
min/max values) -- this field is not mandatory

Now, a user selects in the exposed filter for 'Location' let's say 'Florida'. The view will show all nodes with Florida that also have a value for 'Retail purchasing power', but not the nodes without a value for this field.

I can see that this is the expected behaviour but in my view I have a lot of filters and there are many nodes that don't have values for some fields. Some users only search for the 'location' and don't care too much about the other filters.Tthey don't see all location because they are filterd out.

Does somebody know a way to only send the filter values that have actively been selected by the user? The min/max values form the jquery sliders should only be considered when they are used.


texts:
I am creating/updating terms and nodes dynamically using code. It shows a lot of status message as usual. But I need to hide those message only for this task. That means if any user creates/updates terms or nodes it will show the status message.

How can I do that? Please note that the task will run by cron, so a lot of status massage will be stacked for display. Obviously nobody wants to be the poor person to see the huge list of status messages.


texts:
I am running into some trouble with drush I can't pm-enable the modules I just downloaded with it.
I did some research but none of the solution worked for me, most cases involved switching "localhost" to "127.0.0.1" in settings.php but my database is located on a docker container.
I am running drush from the root folder.

Here the output I get when running drush en module1, module2

    root@c4765ef094a2:/var/www/html# drush en pathauto, token,
    simple_gmap, addtoany, scheduler, devel, devel_generate
    Command pm-enable needs a higher bootstrap level to run - you will
    need to invoke drush from a more functional   [error]
    Drupal environment to run this command.
    The drush command 'en pathauto, token, simple_gmap, addtoany,
    scheduler, devel, devel_generate' could not be     [error]
    executed.
    Drush was not able to start (bootstrap) the Drupal database.
    [error]
    Hint: This may occur when Drush is trying to:
     * bootstrap a site that has not been installed or does not have a
    configured database. In this case you can
    select another site with a working database setup by specifying the
    URI to use with the --uri parameter on the
    command line. See `drush topic docs-aliases` for details.
     * connect the database through a socket. The socket file may be
    wrong or the php-cli may have no access to it in
    a jailed shell. See http://drupal.org/node/1428638 for details.

    Drush was attempting to connect to:
     Drupal version         :  8.4.0
     Site URI               :  http://default
     Database driver        :  mysql
     Database hostname      :  mariadb
     Database port          :  3306
     Database username      :  root
     Database name          :  drupal
     PHP executable         :  /usr/local/bin/php
     PHP configuration      :
     PHP OS                 :  Linux
     Drush script           :
     /var/www/html/vendor/drush/drush/drush.php
     Drush version          :  8.1.15
     Drush temp directory   :  /tmp
     Drush configuration    :
     Drush alias files      :
     Drupal root            :  /var/www/html
     Drupal Settings File   :  sites/default/settings.php
     Site path              :  sites/default
     Sync config path       :  sites/default/files/config_oL5MBo-
     2_ALSPTKnAwZb1o3WVs19lndEmQpb4zfSv42kL9A8F0bp4g_de
                       mvUvf96DBkH3qyYww/sync

Here's the output of drush sql-connect

mysql --user=root --password=root --database=drupal --host=mariadb --
port=3306

I have been stuck on this for 2 hours so any help would be greatly appreciated


texts:
I've created a View that displays all of my 'Product Category' taxonomies. I'd also like to get the path alias for each taxonomy listed. Usually to do this, I'll add a hidden 'Path' field, so I have access to it in my Twig template.

There doesn't seem to be that 'Path' field though, the closest I can find is 'Link to Taxonomy term' field. This isn't what I'm after though as this field seems to be preformatted, when all I want is an absolute URL. I've tried playing around with the rewrite rules of this field, but none of the changes seem to take affect.

Is there a way for me to convert the Term ID I have access to into my system path or path alias of my taxonomy pages? Is there a different way? Thanks in advance.


texts: How to deactivate the automatic emails sent to administrator?

texts:
Is there any existing module to edit automatic emails sent to admin by Drupal 7?
Something like Mail Editor to edit the mail templates but not only for those sent to users.

I need to deactivate the automatic email sent to administrator when an user have created an account. I have created a Rule to have details on this new account with tokens and now I do not need the automatic core email anymore.

Thanks for any help. I can not find any solution to this, except this custom module and I would prefer a newbie solution.


texts:
http://themeforest.net/item/converge-the-best-premium-drupal-theme/full_screen_preview/405072

I am trying to make a d7 version of this slider.  I have enabled KWICKS VIEWS but I cannot seem to get a 3d effect, like it has here.  Does anyone know what kind of css this uses?  what i create and list class and enable it in VIEWS?

I used firebug to inspect but didnt see anything obvious.  THANK YOU

--newbie


texts: Views with nodes and taxonomy: Cannot group by node nid

texts:
I have nodes with field_my_taxonomy_reference

My View is displaying nodes, but I have added such field in fields list:

(my relationship with taxonomy field) Taxonomy term: name

Now, I have duplicates in results. If some node has two taxonomy terms atatched, this node is displayed twice in results. I cannot replace "Taxonomy term" with "Content: field_my_taxonomy_reference", because I need to use Taxonomy term name in Combined field filter.

I tried to use grouping through Format -> parameters but it didn't help. If I grouped by node title, it resulted to following structure in results:

Node title 1:

-- node title 1, node image, tax. term 1

-- node title 1, node image, tax. term 2

Node title 2:

-- node title 2, node image, tax. term 1

-- node title 2, node image,  tax. term 2

I would need to achieve such output:

Node title 1:

--node image

--tax. term 1, tax. term 2

Node title 2:

--node image

--tax. term 1, tax. term 2

I have tried all combinations of checked/unchecked checkboxes "Remove tags from rendered output" and "Use rendered output to group rows"

I tried to use distinct in Query settings, but it didn't help, too. When I trun on aggregation, I get no results in View.


texts: How do I convert URL parameters to lowercase?

texts:
We have a routing.yml file in Drupal 8 which contains the following lines.
testmodule.res:
  path: '/subject/{node}'
  defaults:
_controller: '\Drupal\testmodule\Controller\resController::res'
_title: ''
  requirements:
_permission: 'access content'

Right now. the resulting URL is http://www.example.com/subject/MATHS, where MATHS should be in lowercase.
How can we convert the parameter in the URL to lowercase for this URL and globally?


texts: How to hide the grid lines from Yaxis and draw only one line from specific Yaxis points?

texts:
I am creating a view using the Charts module. I am using the (interactive) Google Charts API as the charting engine.

Is it possible to hide other gridlines and only display one grid line from a specific y axis point?

Just like in this image:


texts:
I need the modified URL to call a view with contextual filter, in Drupal 8.
The URL must include the value of a field, that the user's clicking on.

This works.

Link to Testview

How can I overwrite Link to Testview with the field value?

{{field_example__value}} works as well.


texts:
I'm using Drupal 8 and have question about Inline Entity Form module.

Is it possible to introduce pagination in inline entity form module somehow?

Ideally, I'm looking for already available solution, but I'm fine if I will have to extend the module for this. But I'm not sure how it can be done.

Any pointers and help would be much appreciated.


texts: What is the best way to make sure Array in PHP are closed correctly

texts: I wonder how to determine when to close an array. I edited a aliases.drush.php and added a database array but now, while I have multiple array I got a syntax error. Is there a easy rule to remember how to close an array without getting syntax errors when a file has about 300 lines?


texts: Popups API - Drupal 6.x-2.0-beta0 - Popup is automatically closing

texts:
I am trying to add the site contact form in popup using Popups API - Drupal 6.x-2.0-beta0  module. In popups_test.module popups/test page I am able to add the link contact like following

function _popups_test_popups() {
  popups_add_popups();
 $output .= '<li>'. l("Contact Us", 'contact',
               array( 'attributes' => array('id' => 'test-popup','class'=>'popups')));
return $output;
}

Everything is working fine.

The same thing I am trying to add in a block like following

<?php
popups_add_popups();
print l("Contact Us.", 'contact', array('attributes'=>array('class' => 'popups')));
?>

Using this the popup is opeing and facing following issue,
1. when I submit the contact form without enter any information the popup is disappearing.  Anyone came across the same issue? Any help will be appreciatable


texts: Custom template for content type, How to print a link field as a hyperlinked image

texts:
I am making a site for a music festival. I have one content type for attending artists, which includes the following fields of the fields type Link: soundcloud, youtube etc.

I would like to print these fields with an image (small icons) instead of the written link.

How can I do that?

( The path I am looking at for the moment: copy node.tpl.php, rename to node--artist.tpl.php, add some code, put in sites/all/themes/default_theme. )


texts: When does the core search module become worth using?

texts: I mean, is there any approximate number of nodes or just website pages (or any other measures of website size) when the out of the box Drupal search module is still worth using? I understand that much depends on webserver, but there should be some general guidelines. E.g., should I use the core search module if I have a Drupal website with 5K nodes?


texts: Adding a link with nid in Global: results summary in Views

texts:
I have a Views block listing a certain amount of nodes, and I've added a header field: Global: Result summary.

I am on the page: http://myexample.com/node/145 for example and with the header field, I want to link to: http://myexample.com/node/145/events. I have put the following code in the field:

(@total)

But this omits the nid and goes directly to:
http://myexample.com/node/events.

Does anyone know how to pass a URL argument for that field? I would ideally want to use arg(1).


texts: Drupal 7 Views Field Options Alter max_length on First $views->result only and not on any other results

texts:
I have a Blog view that displays blog content types and in my view's field settings for my 'body' field I have the rewrite set to trim the body to a specific length (600 words).  This is working well on the display page for the blog.  However, I would like one customization that I can't seem to figure out a work-around for.  I would like the first blog post to display more teaser text than the rest of the blog teasers, but I can't figure out how to manipulate my view object so that the first result has a longer trimmed max length then the rest of the results.  When I dsm my view object I can see results array the first object result is $view->result[0] but can't determine any relationship between the result and the altered output.  I can alter the max_length value for the body field in:

$view->field['body']->options['alter']['max_length']

But this alter's all of the result values and I would only like to alter the first result.

I thought about making another display and limiting it to the most recent blog (the first result) but then I cannot use my exposed filters to filter through the blog posts as the first post will always display at the top of the view.  Any ideas on how I can make this happen?


texts:
From a views field--body template, how do I access the nid of the node being displayed? So if I have 3 unique rows, I want 3 unique nids. Thanks.

$row->nid


texts: Copy content of one node into different content type

texts:
Does anybody know how to copy a content of one node from one content type into different content type?

Content type A -> Content type B

I would like to copy the contents from the fields of content type A similar to content type B and set it as default for content type B, but I would let users to edit the field. I can't do node clone because content type B has more fields than content type A and also each content has a different URL aliases.

I tried entity reference prepopulate but it doesn't meet my needs. Also tried cross clone but I'm loosing my brain because I can't get it to work by rules, no instruction.

Are there any available module I can use? if you have any other suggestions please be nice to a beginner. :)

Thank you very much!!


texts: How to programmatically determine whether a node is a og group type node?

texts:
Drupal 7, OG

How to programmatically determine whether a node is an og group type node?


texts:
I am exploring a reason to upgrade from Views 2x to 3x.

What major benefits Views 3x provides?
Are there any major API changes?


texts: How to embed a views page and views block in a page?

texts:
I want to show two views in a single page. I have created a view page and I have one view block. So how can I attach these two views. I followed this below url, but i didn't get the attchment option in my view editing page.
How to embed two views into a block


texts: Addressing objects and arrays nested in an object?

texts:
I'm working a .tpl file for my view that is named views-view-fields--viewname--block.tpl.php. With the Devel module, I did a dsm($field); One of the field objects that are returned in the Krumo goes as follows:

fieldObject
    --handler(object)
    ----last_tokens(array)
    ------[title](string, 15characters)

I figured I should address this as

    <?php foreach ($fields as $id => $field): ?>
  <?php dsm($field); ?>
    <?php if ($field->class == 'field-evenement-performer'){
        print $field->handler->last_tokens['title'];    }

?>

but this returns Notice: Undefined index: title in include() (line 34 of /....../sites/all/themes/ibrain092012/templates/views-view-fields--presentatie-kraakhuis--block.tpl.php

How can this be while title does have a value in the Krumo?


texts: Merger Clusters of Different Layers in Open Layer Module Drupal 7

texts:
I am using Open Layer module in Drupal 7, right now i have multiple different layers and each layer shows cluster of pins if they are within range of some distance . What i want to do is to do this for all layers , for example if layer one has cluster of 2 pins and layer 2 has cluster of 2 pins , it should show cluster of 4 PINS .
Thanks


texts:
I know I might be asking a really dumb and likely complex matter, but it's the only remotely easy option I have at the moment.

Due to what is set up on two systems by my predecessor, wordpress and drupal both appear as CMS's that I have to manage, the one problem area apparently always having been the ability to keep users accounts in order so that if a user created an account on one site, the admin would have to go through and manually connect that account to the other site.

So my question is, after looking through everything and apparently finding very little to resolve this issue, I am coming to ask whether or not there is an option for me to connect the two (for the time being, I don't expect it to take more than a few months) in just how pull, from a table, a username and password? And just as a heads up, I am converting the wordpress to drupal so this problem will be solved in the near future, I just need this as a temporary solution...

I'd greatly appreciate any help.


texts: Behavior being fired on backend causes AJAX error

texts:
I am using jQuery Update to bump up the jQuery version on the front end, and keep the default 1.4 on the backend.

On a custom filter form on the home page, i use jQuery on, and wrap it in a behavior so it still works after an ajax event on that page.

The problem is that for some reason, when editing the page, and adding a new field collection row when Ajax is fired, the jQuery is being called, and an error happens because jQuery on did not exist in 1.4.

  VM787:31 Uncaught TypeError: $(...).on is not a function

Steps to fix...

I am using drupal_add_js but I check that if (!path_is_admin(current_path())) {//jQuery} to make sure it isnt called on the admin pages
I am certain the JS is not on the admin pages, but after ajax, it is called because its in a behavior.

Is there a way to say which behaviors should run on the admin side, and which shouldnt?


texts: How can I add pagination to the comments of advanced forum in drupal 7?

texts: I use Drupal 7 but don't see any pagination on the comment pages, how can I add a pager there please?


texts: What is the difference between page callback and access callback?

texts: Can anyone please explain with example for difference between page callback and access callback in drupal?


texts: drupal_set_message on node edit page shows twice with theme hook

texts:
I want to display a value of a field which the user has no access to in a dsm when the user edits the page. The dsm is showing up after saving the node, and while that's fine (I'd even consider it a feature) it's showing the before-edit value of the node.

I believe I've run into this problem but there doesn't seem to be an easy fix. Here's a look at the template.php function.

function themename_form_vakature_node_form_alter(&$form){
    if(isset($form['#node']->field_vacature_scheduled_for_unp)){
        if($form['#node']->field_vacature_scheduled_for_unp['und'][0]['value']){
            $expirydate = date("F j Y",$form['#node']->field_unpublish_date['und'][0]['value']);

            if($form['#node']->field_unpublish_date['und'][0]['value'] < time()){
                drupal_set_message(t("This vacature has expired."),'status',FALSE);
            }
            else{
                drupal_set_message(t("This vacature will expire at: ").$expirydate,'status',FALSE);
            }
        }
    }
}

Basically, the message displayed on the edit page is repeated after a save. I need it to either not repeat or show the correct updated information.


texts: Remove Home from menu at module installation

texts: I can remove the "Home" tab from the main menu going to /admin/structure/menu/manage/main, but I would like to automate it so that it is done at module installation. I checked that the configuration is saved in core.menu.static_menu_link_overrides.yml, but I cannot put it in config/install since it defines pages created by core. As a matter of fact, I should set enabled=false in the already existing page standard__front_page; how can I do that at module installation?


texts: How to create another html.tpl.php file for logged in users?

texts:
I'm using Drupal 7 and I want to create another (different) html.tpl.php file for logged in users only.

So, I need to check if user is logged in and set other html.tpl.php file if a user is logged.

Is this possible and how to do that?


texts: What are the most appropriate users and permission levels for Drupal sites on shared hosting?

texts:
Although the Drupal site goes into great detail about permissions and security, there are only vague/unclear references to shared hosting. From a Drupal point of view, what is the most secure set-up (ownership and permission levels) for a site on shared hosting?

As an example of the kind of info I'm looking for, WordPress suggests the following shared hosting settings:

All files should be owned by the actual user's account, not the user account used for the httpd process.
Group ownership is irrelevant, unless there's specific group requirements for the web-server process permissions checking. This is not usually the case.
All directories should be 755 or 750.
All files should be 644 or 640. Exception: wp-config.php should be 600 to prevent other users on the server from reading it.
No directories should ever be given 777, even upload directories. Since the php process is running as the owner of the files, it gets the owners permissions and can write to even a 755 directory.


texts:
In Bootstrap there is a nice horizontal form option. But in Drupal + Bootstrap base theme I couldn't find any ways to use this horizontal forms and layout form elements as it described, eg. col-2 for labels and col-10 for inputs.

The only way I found is Strapped theme (https://www.drupal.org/project/strapped)  but it is in dev stage and I don't need one more base theme.

Bootstrap is so popular along with horizontal forms and I don't want to believe there is no way to solve this problem.

Or everybody uses hook_form_alter() and render horizontal form somehow in code?

Thanks in advance.


texts: How do I pass multiple block configurations to a behavior?

texts:
I am trying to create a Drupal 8 module that implements a Curator IO widget, so I created a block plugin with its own custom configuration.

public function blockForm($form, FormStateInterface $form_state) {
  $form['curator_io_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Curator IO Settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );

  $form['curator_io_settings']['feed_id'] = [
    '#type' => 'textfield',
    '#title' => $this->t('Enter your unique Feed Id'),
    '#default_value' => $this->configuration['feed_id'],
    '#maxlength' => 256,
    '#size' => 64,
    '#description' => t('Set your unique feed id found at curator io'),
  ];

  return $form;
}

I attached my library from the build method and passed a variable so I can work with it in jQuery.

public function build() {
  $build = [
    '#theme' => 'curatorio_io',
    '#attached' => [
      'library' => [
        'curatorio/curatorio_assets',
      ],
      'drupalSettings' => [
        'curatorio' => [
          'feed_id' => $this->configuration['feed_id'],
        ]
      ]
    ],
  ];

  return $build;
}

I am getting this variable value in JavaScript using the following code.

(function ($, Drupal, drupalSettings) {
  'use strict';
  Drupal.behaviors.curatorio = {
    attach: function (context, settings) {
      console.log(drupalSettings.curatorio);
    }
  }
};

It is working fine for one instance of the block.

When I add 2 or more instances of this block, only the first block works. I can understand that no matter how many instance I create for this block, the JavaScript will always get included once, so how do I pass multiple values for feed_id to the JavaScript behavior?


texts: How can I make my site stop adding  tags in textareas?

texts:
For a current project I have a content type’s textarea set to Full HTML. But where I’ve added a <span> tag, Drupal will go ahead and enclose it within a <p> tag which is definitely not what I want!

It’s also adding an empty <p> tag at the bottom of said container.

How and where can that be turned off? Where is the mechanism or module that is doing that?


texts: Is there a way to export a list of all pages and files?

texts:
I received an email from a customer today requesting a list of all pages and files on their website. Since they are content administrators, I am about to reply with simple instructions for navigating the "Content" area since all the information they are looking for is there.

Is there a module or a tool of sorts that could help generate a list automatically of all the nodes within a site?


texts: Why (or how) order number increases in Drupal Commerce

texts:
Does anyone know how the Order number increases in Drupal Commerce?

Obviously when someone puts in a new order the order number will be AT LEAST one larger than the previous order number, but other than that why would the order number increase?

For example while testing the site my first order # is 1 (duh), but then 19 days later when I tested it the order # was 19, without any other tests occurring in the interim. The following day I did a test transaction and the order # became 31.

It keeps going up every time I test it but it doesn't just increment by one every time. So I'm just curious why it might be behaving this way. Anyone know?


texts: How can I serve individual static text files with the same name from the webroot for each multisite instance?

texts:
I use Drupal 8 and I want serve statics files in each multiple sites with Nginx.

I've a site at web/sites/site_1/ and a site at web/sites/site_2/.

I want serve ads.txt or robots.txt for each sites with different content.

I can add directory in site_1/statics/ with files and serve this files at root with Nginx but I don't know how I can to do this.

Is it possible to do this with Nginx? Or is there some other way?


texts:
This has been happening since first started using drupal a year ago and I see others having same problem with no real answer beyond cache.

If you reload it will log you back in but that is no good for users, they will just be confused and frustrated by it and it would seem stupid to put a warning "please keep refreshing your page if you are logged out".

I remember at one stage being told you need to decide between www or no www to stop this from happening but that never really worked, only sometimes.

There must be a logical explanation and definitive way to stop it, surely?


texts: Form in modal dialog: Template suggestions have weird random suffix

texts:
My custom module has the following form route in mymodule.routing.yml:
library_assets.add_asset_to_slideshow_modal:
  path: 'library/add-to-slideshow-modal/{library_asset_nid}'
  defaults:
    _form:  '\Drupal\library_assets\Form\AddAssetToSlideshow'
    _title: 'Add to Slideshow'
  requirements:
    _permission: 'access content'

And I have a link (in another form) which opens this form in a modal dialog:
$asset_display_title = $this->node->field_la_display_title->value;
$modal_form_url = Url::fromRoute('library_assets.add_asset_to_slideshow_modal', [
    'library_asset_nid' => $this->node->id(),
]);

$form['actions']['add_asset_to_slideshow'] = [
    '#type' => 'link',
    '#title' => $this->t('Add to Slideshow'),
    '#url' => $modal_form_url,
    '#attributes' => [
        'class' => [
            'use-ajax',
            'btn',
            'btn-blue',
            'w-100',
            'd-block',
        ],
        'data-dialog-type' => 'modal',
        'data-dialog-options' => json_encode(['title' => $asset_display_title, 'width' => 600]),
    ],
];

All of this is working – the form modal appears when I click on the "Add to Slideshow Link"; it validates correctly; the form submit handler works properly, etc.
But I'm having problems theming the form. When I inspect the contents of the modal to see the template suggestions, I see this:
<!-- FILE NAME SUGGESTIONS:
   * form--add-asset-to-slideshow--pv65ooQgrPE.html.twig
   x form.html.twig
-->

The pv65ooQgrPE part is different every time - it seems to be randomly generated (maybe a hash of some kind?).
I obviously can't create a template file if the filename is essentially random every time.
I tried omitting the suffix, and creating a template named form--add-asset-to-slideshow.html.twig – but that doesn't work.
What's going on here? Is this an intentional feature of Drupal? (If so, where is the documentation? I've been unable to find it.)
Most importantly, though: what's the proper way to theme my form, in this situation?
Thanks!


texts: How to remove/hide 'to time' in time field

texts: I need to show only one time, no need of start and end time. Or I need to show only start time. Please anyone help me on this.


texts: Redirect links to nodes of past events to the up-to-date version

texts:
On a event-centered site we have a lot of recurring events, but there's no pattern like every first monday etc. So the editors just clone the event with node-clone and with pathauto we generate a date-token that is appended to the url.

After the date is gone, these events are deprecated and get unpublished (by Rules). But still people find links to these events via search engines and the like.

How can we automatically redirect links of past events to a up-to-date one?

Right now the url looks like this:
www.mydomain.com/events/eventname-300518 (which would be today the 30th of May)

I could add a "basic" event without the date token if that would help. So if a event gets unpublished a redirect to the basic node could take place.

Can you point me in the right direction?


texts: Access to image uploaded in article content type is denied

texts:
when I attach an image to my article content type it doesn't show image. I mean when I creat an article content type and I upload an image to its using Image filed of article content type and publishe my article, the image not shown and when I right click to image and clicl "open in new tab" it goes to "Access Denied" page and says you don't have access to this image. this is true for my galley images too.
pleas help me :)
thanks