texts: Rules- How can I copy the formatted text in one field to another?

texts:
I need to move the values of a field (long text and summary) to another field (long text and  summary).  I am trying to do this with Rules and VBO.

I have fetched nodes A and B, and I want to set the value of the field in B to the value of the field in A.

The challenge is that I can't use the Set a data value action to simply set B to A.  I can use Rules to create a text variable and get the value from A that way, but I still can't set that text variable as the value (Rules requires a formatted text variable).  However, if I try to create a formatted text variable, I can't set the value of the Long text and summary field as the value.

I have the two nodes available in Rules and they both have fields of type Long text and summary.  I just want to set the value of B to the value of A.  How can I do this?


texts: TB-Mega menu close open by click problem

texts:
I have a problem about TB-MegaMenu navigation bar.

I use this script for get an open/close by click system :

tb-megamenu how to click to open/close sub menu in mobile

It works well but when i show a submenu no links works, for example:

Menu 1

submenu 1 (==> http://www.google.com)
submenu 2 (==> http://www.yahoo.com)

I show the submenu by clicking on Menu 1 and when i click on submenu 1 or 2 , i get no redirection in google or yahoo and it's same for mobile version.

Thanks for your help ;)


texts:
I'm using uc_recurring module in Drupal 6.
Added these options to the Recurring orders:

0 day|Every this one...

1 week|Every week

2 week|Every other week

3 week|Every third week

4 week|Every four week

Added recurring fee for fortnight from Product Features.

"add a fee for $2.00 charged first after 0 days and every 2 weeks after that unlimited times".

1) It's working in the cart page.(Recurring order options are showing up), and at the end it's not counting 2$. 2$ is not playing any role, how does it work?

2) On the whole how are recurring orders and recurring fee connected?


texts: How can I add previous and next controls to the views slide show?

texts: I have the photo slider on home page using views-slideshow. Now I need to add previous and next controls to that slider. How can I?


texts:
I am trying to clear the cache or view status reports in D7 i get the below error.

PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {cache_bootstrap} WHERE (cid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => system_list ) in cache_clear_all() (line 167 of /var/web/includes/cache.inc).

How do i fix the serialization error?

Thank you..


texts:
I am trying to replicate the user interface Media library provides in 8.8.

I've created a view with 2 displays:

View 1:

Menu tab where Parent is "Content"

/admin/content/media-image

View 2:

/admin/content/media-image-shared

No menu in the Views UI.

I've then defined:

custom_media.image_space:
  title: 'Images'
  route_name: view.media.page
  parent_id: view.media.page
  weight: 20

custom_media.image_shared:
  title: 'Shared images'
  route_name: view.media.shared
  parent_id: view.media.page
  weight: 20

The main tab next to Content / Media / Files / Images is present. However, the subtabs on my view Images are not displayed.

What am I missing?


texts: Migrate a filefield to another filefield?

texts:
I'm using Drupal 7. I have a field called field_a which is a file-field and want to create another file-field called field_b. What I want to do is to migrate all the files from field_a to field_b, then I also want to erase the records from field_a without erasing field_a. Note that field_a and field_b are in the same content type.

Is it possible? Is there a way to do this with VBO?


texts: How to get form_state values in _webform_render_component

texts:
I am making a custom component for the webform module.
One of my elements triggers an ajax call to update the possible values of another field.
In _webform_render_elem_courses($component, $value=null, $filter=true):

$semester=isset($value[0]) ? $value[0] : null;
$form=array(
    '#type'=>'fieldset',
    '#weight'=>$component['weight'],
);

$form['semester']=array(
    '#title'=>t($component['extra']['title_semester']),
    '#type'=>'select',
    '#options'=>_get_semesters(),
    '#default_value'=>$semester,
    '#empty_value'=>null,
    '#required'=>true,
    '#ajax'=>array(
        'callback'=>'semester_callback',
        'wrapper'=>'courses',
    ),
);

$form['courses']=array(
    '#prefix'=>'
',
    '#suffix'=>'
',
    '#type'=>'checkboxes',
    '#options'=>_get_courses($semester),
    '#default_value'=>isset($value[1]) ? $value[1] : array(),
    '#required'=>true,
);
return $form;

In semester_callback($form,$form_state)

$element=$form_state['triggering_element'];
$parentCount=count($element['#parents']);
$component=$form;
for($i=0; $i<$parentCount-1; $i++){
    $component=$component[$element['#parents'][$i]];
}
return $component['courses'];

The problem that I am having is that $value is not populated with anything when the ajax is triggered, so there is no way for me to update the 'courses' element based on the 'semester' element. Is there a way to fix or get around this?


texts: Using a file extension (.htm) in Views contextual filter path

texts:
When I add a file extension after the contextual filter in my view's path it no longer works. The path with wildcard is: "section/%.htm"; can this be done or do I have to write some custom PHP to trim the URL of the file extension?

Please note that this is a legacy site which is rolling out section changes in phases, so there can be absolutely no URL changes while we convert the site to Drupal.


texts: Combination of AJAX Views and infinite pager

texts:
In Drupal 7, I load an AJAX View (in response to user clicking a link) with the following code (source: How to load and display a view with Ajax in Drupal 7?)

 jQuery.ajax({
    url: Drupal.settings.basePath + "/views/ajax",
    type: "post",
    data: {
    view_name: "books",
    view_display_id: "page", //your display id
    view_args: identifier, // your views arguments
  },
    dataType: "json",
    success: function (response) {
    if (response[1] !== undefined) {
      jQuery("#bloque-" + identifier).html(response[1].data);
    }
   }
 });

However, I cannot combine AJAX Views with Infinite scroll module, and even a basic pagination does not work, as it does not override the pager link code.


texts:
I would like to know I can add descriptions to quicktabs. Ideally, every tab would have it's own description that gets displayed.

Thanks


texts: What is the recommendation for mapping state?

texts:
The configuration in D8 is nicely mapped in config schema file so any developer knows what configuration changes can be made. But what about state? Is there a recommended way to map state? Or is it the same situation as with variables in D7?

Would it be a good idea to store default values for state as part of the config schema under some specific key, like "state"? Althoguh that would mean dependency on config(factory) in different places within the code.


texts: How can I allow anonymous visitors to submit content?

texts:
I am working on a website that displays a list of historical events.  Most of the events have been added by a small group of users that manage the site.  However, I would also like to add the ability for anonymous visitors to suggest events to be added to the site.

I could make the node/add form available to anonymous visitors however this isn't ideal for several reasons:

the standard submission form is quite complex and I would like to simplify this for anonymous visitors e.g. some fields aren't relevant I want to hide these.
anonymous visitors should be able to submit partial information about the events and for an editor to add more details later.
anonymous submissions need to be moderated before being published.
I would like to guard against spam submissions.

How would you suggest I do this?

Is it possible to have two forms to add a new event, a more complex one for site users and a simpler one for anonymous visitors?


texts: Notice: Undefined property: stdClass::$blank in drupal_alter() (line 1080 of /home/esundance/public_html/bracken-umc.org/includes/module.inc)

texts:
I'm new to this and am not familiar with coding, so I need some major help. I am transferring this site from MonsterWeb server to a GoDaddy server.

While it was still on MonsterWeb servers:
I downloaded all of the website files.
I exported the SQL database.

I followed GoDaddy's instruction and:
Created the database.
I imported the SQL database.
I created the domain and document root in the File Manager.
I uploaded the website files to the root directory.
I installed the Drupal Application and made sure it was pointed to the correct database and root directory.

When I went to the admin page of the site, I received multiple errors, see .

I don't know what to do from here, and I don't know what code to change, etc.


texts: try to hide button with certain class in js file

texts:
I've got flags in a paragraph field, I try to hide other flags of the paragraph if one is clicked.
Here is the html:

<time datetime="2021-01-21T10:16:12Z" class="datetime">jeu 21/01/2021 - 11:16</time>

Disponible:OK

Indécis

Indisponible

In a js file here is my code :
var suggestions = document.getElementsByClassName("paragraph--type--doodle");

HTMLCollection(2) [div.paragraph.paragraph--type--doodle.paragraph--view-mode--default,
div.paragraph.paragraph--type--doodle.paragraph--view-mode--default]0:
div.paragraph.paragraph--type--doodle.paragraph--view-mode--default1:
div.paragraph.paragraph--type--doodle.paragraph--view-mode--default length:
2

there are several paragraphs, and each paragraph has 3 flag class inside.
For each paragraph, if one flag has the class = action-unflag, I need to hide others flag,
so I need to parse each paragraph, If one ".action-flag" class is find, then all the ".flags" class except the one width ".action-flag" class has to be hidden.
My problem, if I try this code, the flags.length is null, but I don't understand why ?
var suggestions = document.getElementsByClassName("paragraph--type--doodle");
        for(var i = 0; i < suggestions.length; i++) {
            var paragraph = suggestions[i];
            var flags= paragraph.getElementsByClassName("flag");
            console.log(flags.length);

            for(var j = 0; j < flags.length; j++) {
                var flag = flags[j];
                if (flag.getElementsByClassName("action-unflag")) {
                console.log("hide all the flag class excepted the action-unflag class");
                }
        }

    }


texts:
I am looking for a module that will enable me to upload and preview pdf files, word docs etc on the site. Something along the lines of http://drupal.org/files/images/screenshot_2.jpg. I would like it to be indexable and searchable on the site.

Any recommendations for the module that will allow me to achieve this would be greatly appreciated.


texts: Taxonomy Terms based on already created content

texts:
Ok I have a client that builds homes in subdivision.  I have created a subdivision and homes content type.  What I want to be able to do is attach homes to subdivisions.

What i want to be able to do is when a subdivision is created, it will automatically be available as either a taxonomy term, or as part of a drop down available when the client is creating a new home.

Is there a way that I can achieve this using the taxonomy module?

Thanks in advanced.


texts:
I have a block with a few CCK fields. In this block I have a link to an action that changes the value of the fields in that block.

The code is the following:

db_query("UPDATE {content_type_event} SET field_event_places_amount_value = field_event_places_amount_value - 1 WHERE nid=%d", $nid);
cache_clear_all();

After reloading, the old value still appear. I have to manually clear the cache to see the current value.


texts:
A Drupal website that my company is maintaining has a REST endpoint, using Drupal Services (likely not that relevant). One of the systems that I'm writing has to write changes in the system to that website over REST. To do this, we first have to 'login' to the system, for which we get a session token and id, and then have to get a CSRF token from this same website. To get this token, we have to make a request to the website, giving the token and id we got earlier. After this, we can use the token and id, combined with the CSRF token, to make edit requests.

But why does having to request this CSRF token first make this system any more secure?


texts:
How to redirect my content type form after submitting in module.

Code:

function message_proposal_form_alter( & $form, & $form_state, $form_id) {
  if ($form['#id'] == "article-node-form") {
    $form['submit'][] = 'my_callback_function';

  }
}

And

function my_callback_function($form, $form_state) {
  unset($_GET['destination']);
  $form_state['redirect'] = 'node/add/article';
}


texts: Site wont let me into administator areas

texts:
Whenever I want to go to an admin only area (e.g. Modules), I get this error:

Fatal error: require_once(): Failed opening required
'/Applications/XAMPP/xamppfiles/htdocs/Ecommerce_website/sites/all/modules/openatrium-7.x-2.33/modules/system/system.admin.inc'
(include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in
/Applications/XAMPP/xamppfiles/htdocs/Ecommerce_website/includes/menu.inc
on line 517

Any ideas?
(Tip: I have also tried putting openatrium back into the folder and it still gave me an error)


texts: How to add extra/custom field in group-audience widget in content type in drupal commons

texts:
Here i am working in group-audience widget in drupal commons.Here i need one idea for adding extra/custom field in group-audience widget in content type.

Given image have two option value but i need to add extra option value in that group audience contents in every content type.Here i tried to change in that

  manage field -> edit group audience -> add new field

. But it will not shown in frontend content added form.And also i tried this way..

  Configuration->Organic Groups-> OG Field Settings

but i cant found the solution for this.I need to show/hide while change that group-audience radio button in content type.Kindly guide to create custom field through hook_function or any other methods.

NOTE:

Post under groups list
Post under trusted contact list
post under event List


texts: Calculate the sum for 3 CCK fields with Rules in Drupal 7

texts:
I have 4 stock fields (Stock 1, Stock 2, Stock 3 and TOTAL STOCK) and I want to set up a rule to calculate ["+"] the sum of Stock 1, Stock 2 and Stock 3 fields, and automatically appear in TOTAL STOCK field.

example -> http://ucreateawebsite.com/DRUPAL/dalexgrup/pt

What event, conditions and actions Should I use?

Thank you.


texts: How to hide the "trimmed version" from the preview page?

texts:
When I "preview" a node add/edit form it shows a "trimmed version" and a "full version". I don't want to show the trimmed version.

The fix suggested for D6 doesn't work for D7. Any ideas?


texts: ajax on select throws exception "The specified #ajax callback is empty or not callable"

texts:
I have a form with 2 selects and a submit button. Changing the value of the first select element should trigger an ajax call to update the values of the second. However, I keep getting this error:

Symfony\Component\HttpKernel\Exception\HttpException: The specified #ajax callback is empty or not callable. in Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse() (line 67

Code is at http://pastebin.com/r4Y3q8ic

From a bit of debug it seems that Core thinks that the submit button triggered the ajax call, not the select.

I've tried various ways of specifying the callback, but they all cause the same error.


texts: Schedule a mail on the 1st day of the following month

texts:
I currently have a rule set up using scheduler which - when a user logs in, a rule component is scheduled to send a mail '+1 week' from this time.  This works fine.

However, I need to alter this so when the user logs in - the component mail is scheduled for the 1st of the following month.

Essentially, for example: if a user logs in today 16-06-14 - the component is scheduled to be executed on the 01-07-14.

Any ideas? Not sure how to set the offset. Would this be better via cron instead?


texts: Why is Drupal Core not updating via composer?

texts:
We realized that our Drupal core version is outdated by two versions. We are currently running 8.5.3, but 8.5.5 has been released. Rather than updating directly two versions, we wanted to upgrade from 8.5.3 to 8.5.4 and then eventually from 8.5.4 to 8.5.5.

We tried the following but it didn't get updated.

composer update drupal/core:8.5.4 --with-dependencies

Message after running composer command

  Nothing to install or update

I ran this command in the directory outside of docroot in C:\users\name\Sites\mysite\ which has the following folders

.git
config
docroot
drush
hooks
vendor

I also ran composer why-not drupal/core:8.5.4 and had the following message returned.

  There is no installed package depending on "drupal/core" in versions
  not matching 8.5.4


texts: Storing variables in sessions not working

texts:
Here is my Custom code I am placing in views custom php field, Strange enough the variables are not storing in sessions except the last session variable, this is strange.

drupal_session_start();
$oid = $_GET['oid'];
$extip = $_GET['xip'];
$myip = $_SERVER['REMOTE_ADDR'];
$_SESSION['oid'] = $_GET['oid'];
$_SESSION['extip'] = $_GET['xip'];
$_SESSION['myip'] = $myip;

print 'oid = '.$oid.' extip = ' . $extip . ' my ip = ' . $myip . ' new order id = ' . $_SESSION['oid'] . ' new external ip = ' . $_SESSION['extip'] . 'new IP of mine  = ' . $_SESSION['myip'];
dpm(ip_address());

Here is the output of the code:

PHP: oid = 000666 extip = 127.0.0.1 my ip = 197.220.160.38 new id =  new external ip =  new IP = 197.220.160.38


texts: How do I display username in a custom block?

texts:
Am new to Drupal so this is a very fundemental question.

How do I display the current username ? In a custom Block? I beleive is the $user->name session variable.

Do I create a Custom Block Type?  If so how do I reference the username?

Do I edit files on the file system?  If so which files?

Do I create new files? If so where?

In other web frameworks the templating engine allows server script tags... ex.. like

<%= username %>

Ive tried putting

$user->name  and {{app.user}}

into the custom block editor but nope, I've learned it's a WYSISYG with no way to render

All I want to do is display a user name in a block I can add a label too.

Any help appriciated.


texts: Accessing Login page shows You are not authorized to access this page

texts:
Till about an hour ago my Drupal 7 site was working fine. But now when I access the login page (/user) I get an You are not authorized to access this page

So I checked the node_access table and I see a record for anonymous users - 0 0 all 1 0 0

I checked the sessions table and it didn't seem to be corrupted. But nevertheless cleared the records. But I am still unable to access the login page

The last time we applied a module update was 10 days back so I don't think its got to do anything with the module code written by us.

I am at my wits end! Have anyone of you faced a similar issue?

EDIT 21st Oct 2014 : A link that explains the exploit - is here


texts:
I'm using Groups, Communities and Co (7.x-1.0-beta2) and I'd like to rename the paths that are used. As currently it uses the format:

#node#/gcc
#node#/gcc/members
#node#/gcc/role
#node#/gcc/permissions

and I'd prefer it to be:

#node#/group
#node#/group/members
#node#/group/role
#node#/group/permissions

Can this be done without going into the module code and renaming the variables directly?


texts: Is there a module that imports epub book as a node into drupal? Or a way to do something like this by converting epub into something else before?


texts: Omega Theme, change content zone when sidebar had no content

texts:
I'm using Omega as Base theme. In the content zone I have 2 regions:

'Content region' set as 9 columns
'Right column region' set as 3 columns

Is it possible to have a "flexible region"? I want to change the column count when the right column region is empty.


texts: Display two products as two radio buttons with a single Add to Cart Form

texts:
I am having trouble deciding how to tackle this problem.  I have two products (indeed, one could be made as an attribute of another, which may help) which are basically two ticket options, only one of which can be purchased by a customer.  Therefore I would like to display them as two radio buttons with a single add to cart button (which I would then configure with Rules to send them straight to checkout).

Right now I have this:

Again, I would like to basically have two buttons, only one of which can be selected, with a single Add to Cart form.

Any ideas?


texts: Show certain content to roles based on taxonomy terms

texts:
I am trying to personalize the viewing experience for users on a site.  I'm trying to figure out how to create a view that will show content tagged with taxonomy term 'a_term' to users with the role 'a_role'.  I want to tag all of my content with these different tags so that users with 'b_role' will see content tagged with 'b_term', 'c_role' -> 'c_term', etc...

Note: these are example names for roles/terms - there will be no naming convention like this.


texts: Migration doesn't work when executed with cron

texts:
I've set up a migration between 2 Drupal sites hosted on the same server (Drupal 8 -> Drupal 9). I'm using migration support recently added to drush to run these commands. I've created a helper bash script, which contains:
#!/bin/bash
sites=(<mysite>)
for site in "${sites[@]}"; do
  drush -r /var/www/drupal -l $site mim <migration_id> --update --execute-dependencies >> /home/<myuser>/migration.log
done

This works fine, when I execute this script manually. However, it doesn't work (content isn't migrated), when it's executed by cron, defined like this:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/<myuser>/<myscript>.sh >> /home/<myuser>/migration.log

There's no output in the log and no errors in /var/log/syslog, where can I only see output like this every 5 minutes:
Feb 16 15:35:01 <hostname> CRON[22314]: (<myuser>) CMD (/home/<myuser>/<myscript>.sh >> /home/<myuser>/migration.log)

What can I do to debug this issue and resolve it?


texts: How can I get the URL to the public files directory?

texts:
I can get the path to the public files directory by using Filesystem::realpath:

$path = $filesystem->realpath('public://');

But how can I get the URL of public://?


texts: How can i display a environment indicator notice on my dev and staging when browsing the site?

texts:
I know there is a environment_indicator module that displays a bar on the bottom of the website showing if your on staging or dev. http://drupal.org/project/environment_indicator

I want to know if there is a way to do this without having to install a module, by doing it via the settings.php file where I can make it output some html to indicate im on staging or dev.


texts: How to create a link with l() function that jumps to specific part of page?

texts:
Hoping to create a link that jumps to a specific part of another page. For example in a block I have this:

<?php print l(t('About Me'), 'node/55#FIRST', array('absolute' => TRUE));?>

But in the browser it outputs the "#" as "%23":

http://www.site.or/node/55%23FIRST

Anyway to do this?


texts: I am trying to make a web applicaton, and I use drupal back end. When I make my request to be identified I have not received token bearer. this normal? Someone can help me ?


texts: I just set up Redis on a site that has been having some performance problems, and it seems to be running well so far. Does anybody know if it would be recommended to also run the Internal Page Cache and/or Internal Dynamic Page Cache module(s) in addition to Redis, or is this redundant? There isn't much documentation around yet regarding Redis and D8.


texts: "Configure Block" region highlight missing in Drupal 7

texts:
The usual region highlight (a dashed-line border around the region) with a little gear icon that opens up a drop down saying "Configure Block" is missing on my custom Drupal 7 site. Which or What admin option is responsible for this?

I am logged in an an administrator.
I have actual regions.
Those regions have data.
"Demonstrate Block Regions" shows where the regions are correctly.

How do I bring this highlighting back?

Contextual Links module is enabled.

This is my block.tpl-

<div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>

<?php print render($title_prefix); ?>

<?php print render($title_suffix); ?>

<div<?php print $content_attributes; ?>>
<?php print $content; ?>


texts: Programmatically get a list of all fields?

texts: How to retrieve a list of fields, similar to what is available at admin/reports/fields, but so that I can have them in an array that I can stuff in a select dropdown.


texts: "Notice: Undefined index: und in include()"

texts:
Since this morning, I get this message on my website.

It says the error is on line 7 in my template file, but when I look at the line 7 the code on it is <?php if (!$page): ?>.

My template file looks like the following.

<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>">

    <?php if (!$page): ?>
      <h2<?php print $title_attributes; ?>>
      <?php if (($type == "article") && ($node->field_add_taxonomy_tag_articles[$node->language][0]['tid'] == 26)): ?>
        <a href="/discoveries#node-<?php print $node->nid; ?>"><?php print $title; ?>

      <?php else:?>
        <a href="<?php print $node_url; ?>"><?php print $title; ?>

      <?php endif; ?>
    <?php endif; ?>
    <?php print $user_picture; ?>
    <?php if ($display_submitted): ?>
      <?php print $date; ?> Ñ <?php print $name; ?>
    <?php endif; ?>

      <?php
        hide($content['comments']);
        hide($content['links']);
        print render($content);
      ?>
      <?php if (!empty($content['links'])): ?>

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

      <?php endif; ?>

    <?php if (!empty($content['links']['terms'])): ?>

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

    <?php endif;?>

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


texts: How to display select query results using ajax in a form in drupal7

texts: Please give me some solution for this. I want to display the Database select query results in a form using ajax in drupal 7.


texts: Change the format of 'Authored on' date in views filter

texts: In Drupal 8, I want to remove the timestamp on 'Authored on' date in views filter. Any Idea how to do this?


texts: How to show a user's age at the time of creating a node in a View?

texts:
My users have a Date of birth field (I am using the Date module). Every node page contains a View with some information about the node. I would like to add the author's age at the time of publication to it. How can I do that, assuming that Date of birth is available as a Views field?

I first tried to use Time Ago, but unfortunately it is not possible to select a time range. Next, I computed the difference between the time of publication and the date of birth in Unix seconds with a mathematical expression, but I am not sure how to convert this value to a year.


texts: Views: changing the language for taxonomy terms

texts:
Is there a way to display taxonomy terms in a language given by a Views argument, i.e. to override the user's language preference? The field formatter "Plain text (localized)" doesn't do the trick.

Example:

Tab one: English

Africa

Story 1
Story 2

Middle East
Europe

Tab two: Français

Afrique

Histoire 1

Moyen-Orient

Histoire 2

Europe

The stories are a single content type, but completely different pieces of content (not translations). I'm using quicktabs to render this.

Edit: the taxonomy terms are already translated via the i18n module, the question is about getting Views to display the translation I want.


texts: How can I get the content type for which a certain comment belongs?

texts:
I have a comment type that's associated to various content types.

I have the comment entity but I want to get which content type(s) it belongs to.

How can I do that? Given that I can in the first place.


texts: What are some benchmarks with Mysql vs MariaDB while on Drupal 7?

texts: I was wondering how much faster is MariaDB vs Mysql in a Drupal 7 setup.


texts: Why a module has a package for a 8.x-3.0-beta1+54-dev version?

texts:
I'm currently in the process of composerizing a quite old project where I ran into some strange module versions, which seem to have been packaged by drupal, ie.
# Information added by Drupal.org packaging script on 2019-03-28
version: '8.x-3.0-beta1+54-dev'
core: '8.x'
project: 'field_group'
datestamp: 1553812385

or
# Information added by Drupal.org packaging script on 2017-03-13
version: '8.x-1.1+1-dev'
core: '8.x'
project: 'login_emailusername'
datestamp: 1489402385

In the case of login_emailusername, it turned out that the code of the project is identical to 8.x-1.1 plus 1 follow-up commit from dev, and so could be brought into the project via composer as:
"drupal/login_emailusername": "1.x-dev#f152ee7"

However, I wonder how these modules were "packaged" in these versions, because they don't seem to exist. Maybe someone has an idea? Might this be complete custom syntax or where they maybe imported via drush:make?


texts: Display database query results in custom module

texts:
I have a custom block and I'm able to update its content using #pre_render if I'm using basic text.

However I'm unable to print database query results using the same way. Below is my code.

function _maintenance_prerender(array $build) {
$build['content']['#markup'] = myDatabaseQuery();
return $build;
}

function myDatabaseQuery() {
  $query = \Drupal::database()->select('menu_link_content_data', 'm');
  $query->condition('m.title', 'Visit');
  $results = $query->execute();
}

Is there a special way to print database query results on a custom block?


texts: How to filter with all outputs when using Rewrite results option in Views

texts:
In my view using the "Rewrite Result" option, I combined two fields "first name" and "Surname" to display as one field with label "Full name".

I then added an exposed filter to allow users search through the Full names.

My challenge is that it only filters using the surname and not both. How do I get users to be able to filter using both first name and surname.

Thanks.


texts:
I have two content types: students and chemistry labs.
Students content type has a cck field that lists student type (field_student_type) with Chemistry.Biology, Math, and etc. And Chemistry labs content type has a cck field (field_chemsitry_students) that node references to "students" content type as a list widget. Since it's a chemistry content type, the list needs to pull only chemistry students. With the current setup, it's pulling every student. I can't set the filter in views as it's a drop down list (widget). Views won't let me put operators to be ield_student_type = "Chemistry Student". How would I filter this out? Any suggestions? php filter? The question is more about field to field reference using node reference.


texts: Add menu itens in Commerce Kickstart administrative toolbar

texts: I have worked with default Commerce Kickstart 2 toolbar menu, and I really liked. But now I installed a new module, Commerce Feeds, and I can not access it because there aren't menu entries in toolbar. Is there a way to add menu entries like the one I need in Commerce Kickstart 2 toolbar menu, or I have to back to Drupal 7 administrative toolbar?


texts: How to update a Drupal 6 website to latest release with drush?

texts:
I want to update my Drupal 6 website (version 6.36) to the latest realease (6.38).

When i'm using the shell-command "drush update drupal", i'm getting following result:

Drupal                     6.35      6.35      Installed version not supported

How can i do an update to the latest release with drush?


texts: Kint function not working for me at twig template

texts:
I have enabled devel module and also enabled devel kint . From configuration section (development/devel) , I select kint as Variables Dumper. I also enable twig debug mode. But {{ kint() }} not working for me. Displaying error i.e

  TypeError: Argument 1 passed to
  Twig\Node\Expression\ArrayExpression::addElement() must be an instance
  of Twig\Node\Expression\AbstractExpression, instance of
  Twig\Node\CheckToStringNode given, called in
  C:\wamp64\www\meme_v3\vendor\twig\twig\src\Node\Expression\CallExpression.php
  on line 193 in Twig\Node\Expression\ArrayExpression->addElement()
  (line 59 of vendor\twig\twig\src\Node\Expression\ArrayExpression.php).


texts: "Invalid argument main.js" Gmap error in IE

texts:
I have GMap Module and GMap Location version  6.x-1.1; in Internet Explorer (any version), on the GMap page I see this error:

  Message: Invalid argument.
  Line: 401  //in IE8, and 942 in IE6
  Code: 0
  URI: http://maps.gstatic.com/intl/fa_ALL/mapfiles/310c/maps2.api/main.js

I found a question on Stack Overflow, but the answer doesn't apply in my case, as the lat attribute is true.

What is problem?


texts: How to create entities on another site using the Web Services Client module

texts:
I have installed the Web Services Client module, together with the Drupal Services module and Rules, in order to create, edit and delete entities on a remote Drupal site.

The remote Drupal site has a REST service that allows all CRUD operations on entities (products) using the Services module.

I aim to create update delete remote entities using the Web Services Client module, but have a hard time understanding how the "Service Description" (admin/config/services/wsclient) should be created to accomplish that.

What are the steps to create such Service Description using REST services, and the corresponding Rules?


texts: Place CSS/JS aggregated files in a hierarchical directory structure

texts:
I use css and js aggregation for increase the speed of a drupal 7 website. Now, when I log in with user A, four news files (one css and one js) are added in the files website directory like that :

In linux, the profmances becomes bad when a folder contains too many files. So i'm looking for save these files in a hierarchical structure of directories, example :

directory_css_day0/mounth0/year0

-> contains somes css

directory_css_day1/mounth0/year0

-> contains somes css

...

directory_css_dayN/mounthN/yearN

-> contains somes css

How can I do that with Drupal mechanisms ?

Not the subjet of my previous topic

This previous post speaks about the number of files. Here, I'm looking for a way for manage the filesystem. I thought it was better to create another topic


texts: How can I theme a form element with hook_preprocess_form_element()?

texts:
I have an exposed form in a D8 view which includes several fields, output through form-element.html.twig (amongst others). I added a function:

function MYTHEME_preprocess_form_element(&$variables) {
...
}

This contains an 'element' key and I could add a class in there, BUT I see no way of identifying which form this is part of. The 'element' has a child '#parents' but this is simply the name of the field.

The whole point of this is to add some Bootstrap responsive classes to these different form items for layout. I tried template_preprocess_form and while I see the fields listed as elements, I don't see a way to add classes to the form element label.

What is best practice for theming D8 exposed forms?

Update: I used XDebug with PhpStorm to debug both MYTHEME_preprocess_form_element and MYTHEME_preprocess_form and explored the entire tree of $variables but could see nothing hinting at parent form ID or similar.


texts: Using hook to alter panel plugin block form

texts:
I'm attempting to add items to every block form including the core ones from my custom module. I figured I could use the mymodule_form_formid_alter hook. And I'm assuming that block_form is the form id for the block form.

My module is called ablecore. And inside my ablecore.module file I have.

function ablecore_form_block_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id){
    $form['ablecore_style'] = [
        'background' => [
            '#type' => 'details',
            '#title' => $this->t('Background'),
            '#open' => FALSE,
            'color' => [
                '#type' => 'select',
                '#options' => [
                    '' => $this->t('Default'),
                    'bg-orange' => $this->t('Orange'),
                    'bg-grey' => $this->t('Grey'),
                ],
            ],
        ],
    ];
}

However none of these form items appear on any of the block forms. Is there something I'm doing wrong?


texts: How can I delete a field translation in node?

texts:
I am using a complicated melange of paragraphs with asymmetric translation, and in a few my nodes there is a stubborn translation that somehow is stuck.
Its a node that used to be translated, but then i deleted the translation.
I edited the original language paragraph field. but when i try to translate the node, the created content of that paragraph field is the old content.
I can delete all the related paragraphs that are relating to that field in that node in that language, and when i try again to create a translation, my paragraph field is just empty instead of showing the duplication of the original language.
So, i understand that i need to somehow delete the field's translation or mark the field as untranslated so that next time a fresh translation is created
is there a way to do this?


texts: Within a View, How do i paginate the content found inside a single Multiple file field, i.e. inside one node

texts:
Hopefully someone can help.

I am using a file field and allowing unlimited files within a single content type field called "Video", handled by Media Module. I have created a view per "gallery" of multiple files inside the node, it's already set-up contextually using the nid. Paginating the media files list from this one node result isn't easy to do with what is out there. I have tried infinite scroll but it didn't work out, i have also tried CCK Pager with no luck and the limit settings available are just that limits which don't paginate. Any ideas?

Just to be clear i am not trying to paginate a view of nodes, its a view of files found within a single node.

I am using Drupal 7.63


texts: Adding content type to the class of each views row

texts: I have a view that has a filter to only pull results from 2 content types.  I would like each views entry to have a class that shows the content type of the node.  How can I do it?


texts: Differences between value and safe_value

texts: What are the differences between ['value'] and ['safe_value']?


texts: I want to be able to have the ability to translate to comments only , is there any type of module I could use for this


texts: MySQL server has gone away - production site

texts:
Possible Duplicate:
  Solving “MySQL server has gone away”, mysql error 2006

My website is moved from localhost to virtual hosting and after 1 week I receive an error 2006 2006 MySQL server has gone away. Now I can create/edit content but not content types and cannot clear the cache, I see white screen in this case. My hoster said that the max_allowed_packed size is only 1M and I cannot change it.

Is there a way to fix this error?

I deleted content types I don't use now and the problem has gone away... And now I can also clear the cache and edit other content types. What it was I cannot understand, it's beyond me


texts:
I'm using Drupal 7 and Clean theme. And when created a node, show date top on node. No problem. But i want remove only hour and min. tab.

How can i solve this?


texts: How to import custom content type in XML?

texts:
I have installed the newest Drupal 7.12 and need to import custom content type data exported from custom CMS but ... don't know what is the correct XML structure.

1) I have added <MY_CUSTOM_CONTENT_TYPE> into Structure
- added about 20 fields

2) prepare Import feed

Attach to content type: Use standalone form
Fetcher: file upload
Parser: Sitemap parser - Parse Sitemap XML format feeds.
Processor: Node processor
Node processor settings: Text format: plain text; Content type: <MY_CUSTOM_CONTENT_TYPE>

3) I have exported XML file with content (probably with the wrong XML structure)

<?xml version="1.0" encoding="UTF-8"?>
<articles>
<article type="MY_CUSTOM_CONTENT_TYPE">
     <title>1234</title>
     <custom_1>1234</custom_1>
     <custom_2>abcd</custom_2>
     ...
     <custom_20>...20...</custom_20>
</article>
</articles>

3) after loading XML file getting "There are no new nodes."

I can prepare XML structure when exporting content, but want to know how to do it.


texts:
I just set up an new Drupal 8 website. I was used to use CSS injector on Drupal 7, but since the module is not ready yet, and I thought I'd better start with subthemes, I tried to create a new Boostrap subtheme. I used the CDN method, activated it in my admin panel, but when I try to override CSS by creating CSS styles in css/style.css, nothing work. In Drupal 7 with CSS injector, my main difficulty was to find the proper class.
So I tried a lot of different possibilities, copied/paste CSS from original files in Bootstrap. Nothing works.

Have anybody already tried to create a sub-theme with Bootstrap? Did overriding CSS work?

I looked at the CSS file link, it's loading lumen theme nicely. I tried to change h2 color in this file:  themes/bootstrap/css/3.3.5/overrides-lumen.min.css and it works...Clearly, seems that style.css is not used...


texts: how do I determine the field type within a field formatter?

texts:
I have a field formatter that I would like to use on either a string or file field type. I have everything working as two separate field formatters, but with so much shared code, I'd like to make it just one. I've been digging in the API and the core sources, but nothing is jumping out at me.

/**
 * Plugin implementation of the 'jmol' formatter.
 *
 * @FieldFormatter(
 *   id = "jmol",
 *   label = @Translation("Create a Jmol object"),
 *   field_types = {
 *     "string",
 *     "file"
 *   }
 * )
 */
class SmilesFormatter extends FormatterBase {
public function viewElements(FieldItemListInterface $items, $langcode) {
  foreach ($items as $delta => $item) {
    // Can't figure this next line out
    $type = ($item->type);  // I assume it's something easy
    if ($type == 'string') {
      STUFF
    }
    else if ($type == 'file'){
      STUFF
    }
    COMMON STUFF
  }
}
}


texts:
I've added two custom fields to my user form - field_license and field_download_date. In my preprocess_page function, I'm doing this:

if(isset($vars['user'])) {
   $user_data = user_load($vars['user']->uid);
   error_log("userdata");
   error_log(print_r($user_data, 1));
}

I'm not trying to get the current user info, but a specific user. When I look at the error log, though, $user_data is printing out the info of the user I'm logged in as, not the user that's displaying on the page based on the URL (mysite.com/user/2). How do I get the data for the user based on the url?


texts: How can I reload the page after a Panels IPE save?

texts:
I've seen it posted about a few times on drupal.org but no implementation.. Panels IPE breaks a few things like javascript and custom views footers until the page is reloaded.

I'd like to have this reload happen automatically as site users are allowed to use IPE.


texts: How to add options to a select list of a content type?

texts:
I built a module that creates a form and let the user to add a variable called unit into database. Now this unit should be the options of select list of a content type. the form id of the content type is phone_book_node_form, but the problem is I can't add options to the select list. this is the firebug output of the form (content type)

the name of the select list field is field_phone_yegan. I tried this function in template.php

function MYTHEME_form_alter(&$form, &$form_state, $form_id){
    switch ($form_id){
        case 'phone_book_node_form':
            $form['field_phone_yegan'] = array(
                '#options' => array('yes'=>t('yes'),'no'=>t('no'))
            );
            break;
    }
}

nut nothing was added to the select list. I also tested

$form['edit-field-phone-yegan-und'] = array(
                '#options' => array('yes'=>t('yes'),'no'=>t('no'))
            );

$form['field_phone_yegan[und]'] = array(
                '#options' => array('yes'=>t('yes'),'no'=>t('no'))
            );

but it didn't work. How do I can add options to this content type select list?


texts: Add fix amount to all orders as packaging price

texts:
I want to add  a fix amount to all orders as packaging price in commerce,I think first I need custom line item and named it as packaging price, then add that to orders with rules or in custom module, but this is just a idea.
 Anybody know how can I add a fix amount to all orders as packaging price (I also have discount in our commerce system and used it) ?


texts: Would using hash_pbkdf2() be more secure than the actual code used from Drupal 7?

texts:
Drupal 7 allows a module to implement a different way to create a password hash. It is sufficient the module changes the content of the Drupal variable password_inc, and implement the required functions in the include file it provides.

If a module would use hash_pbkdf2(), would the hash would be more secure than the one generated from Drupal 7?

The actual code used to generate a password hash is the following. (The code is part of _password_crypt().)

  // Convert the base 2 logarithm into an integer.
  $count = 1 << $count_log2;

  // We rely on the hash() function being available in PHP 5.2+.
  $hash = hash($algo, $salt . $password, TRUE);
  do {
    $hash = hash($algo, $hash . $password, TRUE);
  } while (--$count);


texts: referenced entity not showing up in the node view page or in any view I create

texts:
I have a custom module which defines a custom entity. On a content type, I have an 'Entity reference' field that let's me select a custom entity. The value is saved in the database (I looked directly to the database) but is missing when the node is viewed.

if I dump the $node in hook_node_update($node) I can see the referenced value is there. But on hook_node_view($nodes, $types) the value is gone.

The funny part is that in a view, if I create a relation based on this field, I can see the entity's fields, but not the entity reference field value :))

Other types of entities are displayed correctly though, the problem is only with my custom entity

Any help would be very appreciated :)
Thanks


texts:
I wish to override one of the default css files provided from the theme I am inheriting from. According to Creating a sub-theme page I need to do the following:

  Overriding inherited style sheets: Specify a style sheet with the same
  filename in the sub-theme. For instance, to override style.css
  inherited from a parent theme, add the following line to your
  sub-theme's .info file:

  stylesheets[all][]   = style.css

  You will also need to create the style.css stylesheet file; if you
  simply wish to disable the imported styles, you can create an empty
  file.

My parent theme (Tao) has a reset.css file. In mytheme I have added the following to mytheme.info

stylesheets[all][]   = reset.css

I have then create a blank file called reset.css and it is in the root of my theme. I have run drush cc all but the parent css file is still being read.

What am I doing wrong?


texts: How can I create a product with a single variation for a store?

texts:
I am having trouble with creating products for a commerce project with multiple sellers (each with their own store).  The products these sellers are selling is a baseball card.

When a user adds a new product to sell, in the form submission I create the form as:

// create price...
$price = new Price($vals['price']['number'], $vals['price']['currency_code']);

// init variation
$variation_vals = [
  'type' => 'card_type_baseball',
  'status' => 1,
  'sku' => 'baseball-1',
  'price' => $price,
  'field_card_image' => [$vals['image_fid']]
];
$variant = ProductVariation::create($variation_vals);
$variant->save();

// init product
$product_vals = [
  'uid' => $this->getUID(),
  'title' => $vals['name'],
  'type' => 'card',
  'stores' => [$this->store],
  'variations' => [$variant],
];
$product = Product::create($product_vals);
$product->save();

It works, however, when I view the product after creation, I have many copies of image and field values for some reason.

I think I'm missing a concept.

When a user wants to sell their product, and they upload the product image, set the price, and enter the title for that card (through the form I provide via the Form API) I want to create the product that I can display in a view for the front page, or under their store on their store pages (which I can display via Views).

Every card has the same properties: an image, title, and a price. Examples,

1 - Barry Bonds, $20.00 (with img)
2 - Mark McGuire, $15.00 (with img)

Am I missing something in relation to creating products?


texts: Entityform is spanning the full width of the browser. Well beyond page margins

texts:
http://chesapeakeregional.com/volunteer#overlay-context=volunteers

I did not create the form, nor the site, nor do I have any knowledge of Drupal. But somehow I got assigned to make this form fit within the normal width of the site and I'm clueless. If I'm not being clear, I basically just want to wrap the form with a div about 1140px wide and center it horizontally in the browser.

Please help!


texts: Create a list and count of users per role

texts:
Using Drupal 7 I would like to display:

A) a list of recent users per role (Limit to 10).

and

B) a total count of users per role.

I have looked for a module to do this but can't find anything. I also tried a few things in views but had no luck. This is what I tried in views:

  enable aggregation for you view, and then set the group by for you field (Content:nid for example) to Count.

Didn't give me the results I was looking for.

If there is a module that can do this that would be perfect otherwise i'm hoping to use views... lastly I guess it could be posible with PHP.


texts: How do I save uploaded file permanently in file_manged table?

texts:
How do I save a uploaded file with status equal to 1 in the file_managed table, in Drupal 8?

Whenever I upload a file, it is stored in the file_managed table with status value 0.
I have used File::load( $form_state->getValue('image')) to load the file. What do I need to do next?

In Drupal 7, I would use $file->status = FILE_STATUS_PERMANENT. What is the equivalent code for Drupal 8?

class AddBannerForm extends FormBase {

public function getFormId()
{
  return 'add_banner_form';
}

public function buildForm(array $form, FormStateInterface $form_state)
{

  $form['image'] = array(
    '#type'          => 'managed_file',
    '#title'         => t('Choose Image File'),
    '#upload_location' => 'public://images/',
    '#default_value' => '',
    '#description'   => t('Specify an image(s) to display.'),
    '#states'        => array(
      'visible'      => array(
        ':input[name="image_type"]' => array('value' => t('Upload New Image(s)')),
      ),
    ),
  );

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

  return $form;
}

public function validateForm(array &$form, FormStateInterface $form_state)
{
    File::load( $form_state->getValue('image') );
}

public function submitForm(array &$form, FormStateInterface $form_state)
{

}
}


texts: how to check in ajax form callback if form for failed validation

texts:
I have a form and on and implemented a ajax submit callback which calls this function:

function popover_ajax_callback($form, &$form_state) {
    // watchdog("ajax_callback", "testing ajax callback", array(), WATCHDOG_ALERT);
    return '
' . $form_state['values']['first']['field_firstname'] . '
';
}

How do I check if the form failed or passed validation within this function?


texts: Remove default configuration on uninstalling module

texts:
During install we create content types, field storages and vocabularies. When uninstalling none of these things are uninstalled.

I know that we can set all the configuration to have the module as dependency, but that is tedious to do; is there a better way to let Drupal uninstall all the configuration on the module in the config/install folder?


texts: Which modules should be listed as dependency of my module?

texts:
If my module calls a function of another module, that other module should be listed as a dependency of my module.

Now my module only provides some field handlers for the Views module. On the one hand, my module is useless without the Views module. On the other hand, my module does not call any functions or methods provided by the Views module.

Should I add Views to the list of dependencies for that module? If yes, would that change if my module provides other functionality unrelated to views (like custom pages)?

Note that I used Views only as an example. The question applies to all optional modules, that define hooks.


texts:
I have been working on this issue for a couple weeks now, and I can't find a solution for the life of me. The fact that I have found no decent documentation (on Drupal's website, or anywhere else) is no help either. And the questions already on here are outdated (Services 2.x).

I'm trying to create a REST service for a Drupal Commerce backed site. For now all the service must do is allow for basic CRUD operations on the Order resource, and be secured with OAuth, OAuth 2.0 isn't necessary. It must also be called with a script on a server, so login re-directs are impossible (everything is done with 2-legged authentication).

The current stack is:

PHP 5.3.15
Drupal 7.15
Commerce Kickstart profile (7.x-2.0-rc1)
Services 7.x-3.2
OAuth 7.x-3.0+18-dev
OAuth Authentication 7.x-3.2
REST Server 7.x-3.2
Commerce Services 7.x-1.x-dev (This is the module I have added my custom Order code to)

I can kind of get the Retrieve/Index functions to work for Orders if I use an OAuth PHP library and just call the token request every time (I'm not even sure what's going on there, except that it authenticates...). If I try to POST to Orders and create an order though, I get 406 with the script, and 401 when I try a direct POST request from the REST Console in Google Chrome, even when OAuth is disabled.

This has made debugging a nightmare since I have no idea what's going on inside my create function. I tried stripping it of its order creation logic and just echo back the request payload. Still get the 406/401 errors.

I assume I get the 401 errors because orders require a user authentication (even if OAuth is turned off for the service).

I don't understand why I'm getting the 406 errors though. I accept application/json, which is what my REST server is set to return.

Orders were not being created even before I commented out the order creation logic. (Which I use elsewhere in the site effectively.)

Appreciation in advance.
-T


texts: Using db_select to only get the latest nodes with a certain field value

texts:
I have extending a query function for a D2D migration.  The nodes have a field on them for a certain type of ID.  In the old D6 site the the field did not have to be unique, but in the new D7 site the field does have to be unique.

I want to use db_select so that I only get the newest nodes in the content_type_nodetype table if there are multiple nodes with the same value for that id field.

Sample table data:

content_type_nodetype
____________________________
| nid | field_someid_value |
|==========================|
| 1   | 12345              |
| 2   | 12346              |
| 3   | 12347              |
| 4   | 12345              |

node
____________________________
| nid | created            |
|==========================|
| 1   | 1292780734         |
| 2   | 1292780735         |
| 3   | 1292780736         |
| 4   | 1292780737         |

Given that data, the query I want should only return nid 2,3, and 4 as the value for field_someid_value for nodes 1 and 4 are the same, but the created timestamp in the node table for nid 4 is later than the timestamp for 1.


texts: Getting the nodequeue id from the nodequeue name?

texts:
I want to get the nodequeue qid from the nodequeue  name.

Suppose I have a node queue with the name of "Slider". I want a function so that I pass it the name of the nodequeue and It returns the qid or sqid of that nodequeue.

Is it possible?


texts: Moved one site to another site files are refering old site

texts:
I moved whole Drupal setup from ex.(1.1.1.1 to www.example.com). After the move there are some issues. Some Drupal default files are not found error.(ex. close.png ,background.png) because the images references are for the old url:  http://1.1.1.1/modules/overlay/images/background.png.

How can I fix that?


texts: Discount for specific user group in Drupal Commerce

texts:
I need to create 3 user groups and all of these groups must to have discount on all products in percent.

Example:

Group1 have discount of 10% on all products,
Group2 have discount of 13% on all products,
Group2 have discount of 16% on all products

Any idea how to do that?


texts:
I have a website in Drupal version 7.28. I have page where i want to search members by using Search option created from VIEW. It goes like this after submission:

https://domain.com/search-members?search_api_views_fulltext=anything

This page and functionalty was working fine few days back but not now. Page is blank without any error. There is result in database.

I can understand above info might not be sufficient to help but my only question is:

What can cause a blank page without an error? Possible problems?

Here is the updated ERROR MSG:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aeeee01_drpl21.search_api_db_user_index_field_business_phone' doesn't exist: SELECT COUNT() AS expression FROM (SELECT 1 AS expression FROM (SELECT t. FROM {search_api_db_user_index_field_business_phone} t WHERE (word = :db_condition_placeholder_0) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_city} t WHERE (word = :db_condition_placeholder_1) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_country} t WHERE (word = :db_condition_placeholder_2) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_department} t WHERE (word = :db_condition_placeholder_3) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_first_name_} t WHERE (word = :db_condition_placeholder_4) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_job_institution} t WHERE (word = :db_condition_placeholder_5) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_job_title} t WHERE (word = :db_condition_placeholder_6) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_last_name} t WHERE (word = :db_condition_placeholder_7) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_member_advisor} t WHERE (word = :db_condition_placeholder_8) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_specialization} t WHERE (word = :db_condition_placeholder_9) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_state} t WHERE (word = :db_condition_placeholder_10) UNION ALL SELECT t.* FROM {search_api_db_user_index_field_zip_code} t WHERE (word = :db_condition_placeholder_11) UNION ALL SELECT t.* FROM {search_api_db_user_index_name} t WHERE (word = :db_condition_placeholder_12) ) t GROUP BY t.item_id) subquery; Array ( [:db_condition_placeholder_0] => mlang [:db_condition_placeholder_1] => mlang [:db_condition_placeholder_2] => mlang [:db_condition_placeholder_3] => mlang [:db_condition_placeholder_4] => mlang [:db_condition_placeholder_5] => mlang [:db_condition_placeholder_6] => mlang [:db_condition_placeholder_7] => mlang [:db_condition_placeholder_8] => mlang [:db_condition_placeholder_9] => mlang [:db_condition_placeholder_10] => mlang [:db_condition_placeholder_11] => mlang [:db_condition_placeholder_12] => mlang ) in SearchApiDbService->search() (line 928 of /home1/aeeee01/public_html/sites/all/modules/search_api_db/service.inc).


texts:
I have a custom module which includes a ControllerBase. The controller has a content() function that returns a JsonResponse(). The code for this function returns a complete list of a certain entity type.

I've tried using REST for this, but the entity structure is decently complicated and contains several field collections. By default, REST will just include the ID of a field collection as part of its presentation of this entity, so I've written a FieldFormatter plugin that replaces the field collection ID with a JSON object of its contents. Unfortunately, that requires significant overhead when returning an entire list of the entity type via REST, and takes 40 seconds to load. However, OAuth2 works fine with it.

Alternatively, my existing custom connector takes approximately two to three seconds to load, as it is a single sanitized SQL statement that outputs its results as a JSON. However, I only have Basic Auth working with this, attempting OAuth2 returns a 403 error. I am using the simple_oauth module.

I'm wondering if there is a way to:

A) improve the response time on the REST endpoint to be as good as the custom controller

or
B) use OAuth2 with the custom controller. I've been looking for instructions on this but every OAuth2 resource I've come across so far assumes I'm using a REST endpoint.

edit to update: The REST endpoint is caching, which seems good as it's now loading much faster after the initial fetch, but (as is expected behaviour) the cache is flushed along with all other caches which is something we need to do fairly often, meaning the next person to access the endpoint will see an unusually slow response time. This isn't ideal, and I'd like to still investigate the custom controller I made, however adding _auth: ['oauth2'] to the YAML file is not fixing the 403 error.

2nd edit to update: This is my YAML for the custom controller, which is also not working:

connector.modulename:
  path: '/connector/modulename'
  defaults:
    _controller: \Drupal\connector\Controller\ModuleNameConnectorController::content
  requirements:
    _permission: 'view modulename entity'
  options:
    _auth: ['simple_oauth']

It does not work with _auth: ['simple_oauth'] or _auth: ['oauth2'] (403 error), but does work with _auth: ['basic_auth']. I'm using Postman to connect with a fresh (~30 sec, expiry 5 min) token. The same oauth2 token works for the REST connector. The error message I'm getting in my admin logs states:

League\OAuth2\Server\Exception\OAuthServerException: The resource owner or authorization server denied the request. in League\OAuth2\Server\Exception\OAuthServerException::accessDenied() (line 173 of C:\directory_to_my_site\vendor\league\oauth2-server\src\Exception\OAuthServerException.php).

and also issues a PHP warning stating that access was denied to Guest (not verified).


texts: Uninstalling modules doesn't remove them from modules list

texts: If I install a module, and then uninstall it, for some reason the modules are not removed from my module list (or from my modules folder)- even after repeatedly clearing the cache.  Why would this be happening?


texts: Change workbench status from draft or needs review to publish programatically in Drupal 8

texts:
I want to update a node status from draft or needs review to publish programatically in Drupal 8. Can anyone suggest which is the function used by WBM module to update the node status.

Thanks


texts:
I have watched and read quite a few guides/tutorials on this subject and they each leave me with a blank block.

I am trying to create a related content module.  My content is tagged with multiple terms.

I go and create a block view and go to contextual filters.  I add the content: has taxonomy term ID.  Then I add the "Taxonomy term ID from URL", slect the correct vocabulary, filter to items that share any term, click reduce duplicates and click apply.

Then I create the content:nid contestual filter and the block wont appear.

I have pathauto installed and I have a feeling it might be an issue with that.  I cannot use the term id in my content paths.

I have been at this for a while.  Any help on what I am doing wrong is greatly appreciated.


texts: Why I'm getting MySQL error that server has gone away?

texts:
I'm running:
Drupal 7.34,
PHP 5.4.16,
MySQL 15.1 Distrib 5.5.41-MariaDB, for Linux

I am getting a WSOD on just the module page after a move of server, everything else seems to be running ok.

I've added:

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

to index.php and see the below errors:

  Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /public_html/includes/database/database.inc:2171 Stack trace:

  #0 /public_html/includes/database/database.inc(2171): PDOStatement->execute(Array)

  #1 /public_html/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array)

  #2 /public_html/includes/database/database.inc(2350): DatabaseConnection->query('SELECT expire, ...', Array, Array)

  #3 /public_html/includes/lock.inc(167): db_query('SELECT expire, ...', Array)

  #4 /public_html/includes/lock.inc(146): lock_may_be_available('theme_registry:...')

  #5 /public_html/includes/theme.inc(449): lock_acquire('theme_registry:...')

  #6 /public_html/includes/bootstrap.inc(455): ThemeRegistry->set(Array) #7 [internal function]:

  DrupalCacheArray->__destruct()
    #8 {main} thrown in /public_html/includes/database/database.inc on line 2171

  Fatal error: Access to undeclared static property: Database::$activeKey in /public_html/includes/database/database.inc on line 1466


texts:
I want to add this line above my title

<meta name="viewport" content="initial-scale=1.0, width=device-width,  minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />

How can I ?


texts: how to make multiple ajax callbacks from a drop-down field?

texts:
I have a select field in my custom module (Drupal 7), which needs to refresh the values of 2 different field types when a value is selected, firstly a checkbox field, which currently is refreshed correctly when am changing the dropdown value, and a text field, which is not changing, as it keeps the value from the first dropdown option by default.

Samples of my codes:

$form['webform_name'] = array(
'#type' => 'select',
...
#ajax' => array(
  'event' => 'change',
  'callback' => 'ajax_checkbox_callback',
  'method' => 'replace',
  'wrapper' => array('checkboxField','txtField'),
)

$form['checkboxField'] = array(
'#type' => 'checkboxes',
...
'#prefix' => '
',
'#suffix' => '
',

$form['txtField']=array(
'#type' => 'textfield',
...
'#prefix' => '
',
'#suffix' => '
',

function ajax_checkbox_callback($form, &$form_state) {
    return array(
    '#type' => 'ajax',
    '#commands' => array(
    ajax_command_replace("#checkboxField", render($form['checkboxField'])),
    ajax_command_replace("#txtField", render($form['txtField']))
    )
  );
}

How can I make the txtField field to clear and load the corresponding value every time I change my drop-down values?


texts: Views archive page showing year and months of article content type

texts:
I am trying to build a view page that shows archives (content type is article) only by dates:

year (e.g.2016)
february (post count)
june (post count)
etc ..

year (e.g. 2017)
march (post count)
june (post count)

To top it off, months being linked to the respective posts.

i tried with contextual filters using content: created year and content: created month but I only end up with the year.

Using Drupal 8.3.3.

I am not sure if my set up is missing something because when using fields and/or contextual filters I do not have a date option ...

Any kind soul who can help me out?


texts: Toggle text field depending on checkbox value in drupal 6

texts:
I need to toggle a textbox depending upon the checkbox value.

Basically i need to take email entries for updates.

Here is the form elements I used.

$form['chkupdates'] = array(
        '#type' => 'checkbox',
        '#title' => t('Sign up to receive email updates about Green Apple'),
        '#options' => array(
        '1' => t('Yes'),
        '0' => t('No')
        ),
        '#default_value' => FALSE,
        '#attributes' => Array('class'=>'sub-form-element',
        'id'=>'chkbox'),
);

$form['chkmail'] = array(
'#type' => 'textfield',
'#title' => t(''),
'#attributes' => Array('class'=>'field','id'=>'chktext'),
);

Please guide.I am rendering elements in tpl files so jQuery is acceptable.
Thanks


texts: Multiple login attempts from different IP Addresses

texts: My website has been getting about 25 login attempts per hour for the past few days for usernames admin, administrator and our website name. The attacker seems to be using differing IP addresses and when I checked the last 3 hours worth, only two were are actually repeated. It's not much of a security issue since those are not the usernames we use for admins but it's kind of annoying that it's filling up our logs. What modules/options are available?


texts: What should be the path to the file while using #attached in a custom_module_block_view()?

texts:
I have created a custom module and was trying to add javascript file to a block using #attached method which was described here. I am confused with the Path/to/file as I have tried to give a full path which is "/var/www/html/sites/all/modules/custom_module/js/file.js". and shorter path "js/file.js"

but it doesn't load.

It just say file_get_contents("/var/www/html/sites/all/modules/custom_module/js/file.js"): unable to load, no such file or folder present /var/www/html/common.inc .....

Why I am getting the file_get_contents error when I am not using this method?


texts: how to create manual reports and graphical represntation as content type

texts: Hello guys any Module which can provide tools so that we can manually input data and output them as graphical representation. I have tried Data visualization module but its complex to add JSON data.


texts: Passing arguments from Panel to View without url or using contextual filter from panel to field of taxomony term within view

texts:
Using Drupal 7, Panels 7.x-3.3, & Views 7.x-3.5.

I'm unsure the best way to approach what I'm trying to accomplish.

I have taxonomy vocabularies classifying people in my department.  One example would be fellowships.  Within fellowships there are terms 'Surgical Pathology', 'Transfusion Medicine', etc and within those terms there are terms such as 'Director', 'Faculty', Coordinator, etc with which people are associated.  Each fellowship page will be a panel with various content and a view listing the people within that taxonomy.

We have numerous fellowships and would like to create a view that could be used for all via contextual filters or argument from the panel.  The issue I'm running into is that I'm not going to use the full taxonomy term name in the url.  For example 'Surgical Pathology' might be mysite/education/fellowships/surgical or 'Transfusion Medicine' might be mysite/education/fellowships/transmed.  I can't use the full term name or term id as my hands are tied with keeping those urls.

I'm not sure if its possible to send an argument that is set in the panel (not from url) using 'Input on pane config' or 'From panel argument' in views but I haven't been able to figure it out or find any tutorials on how to.

The other method I tried was to add a field to the taxonomy called Manuel_Context which I put in 'transmed' or whatever the url argument actually is.  So I have the Contextual Filter set in the view to '(Parent) Taxonomy term: Manuel_Context'.  When I use the preview, the view works how I would like however I haven't been able to figure out the panel settings to get this to work.  When I'm in the panel Settings>Arguments I can only select for the 'Context Assigned' Taxonomy Term: ID.  I don't know how to get the panel to look for the field Manuel_Context of the Taxonomy Term.

Any suggestions on how to approach this would be greatly appreciated.  Thank you


texts: How do I add a clearing DIV to the bottom of a region?

texts:
In the eternal mission to care about Internet Explorer, I have a template region which needs a clearing <div<, since I think that ":after" and "overflow:hidden" tricks don't work so well in IE. (I'm currently not able to test this as I'm on a Mac without a virtual machine.)

Is there any region preprocess trick, or anything equally clean, in order of adding a clearing <div>? I'd prefer not to use Javascript, or add an entire block for this purpose, if it is possible.


texts:
I'm trying to display all content labeled under my taxonomy terms with ids 1 and 3. Both terms work fine so that If I point my browser to
www.mysite/?q=taxonomy/term/1 or www.mysite/?q=taxonomy/term/3

But trying to use drupals built-in AND/OR feature using the urls below gives me a "Page not Found" error.

www.mysite/?q=taxonomy/term/1+3
www.mysite/?q=taxonomy/term/1,3

Any ideas?
thanks


texts: entity_get_form_display setComponent throws "plugin does not exist" regardless of type

texts:
I'm trying to programmatically add a field to a custom bundle, and have it appear on the custom entity type. I'm using a BaseForm extended class, and have acquired an entityManager elsewhere using dependency injection.

Below is the submitForm() code I modelled, on how FieldStorageAddForm::configureEntityFormDisplay() etc. works:

$field_storage_values = [
  'field_name' => 'field_phone',
  'entity_type' => 'contact',
  'type' => 'string',
  'translatable' => false,
];
$field_values = [
  'field_name' => 'field_phone',
  'entity_type' => 'contact',
  'bundle' => 'organization',
  'label' => 'Phone',
  'translatable' => false,
];
$this->entityManager->getStorage('field_storage_config')
    ->create($field_storage_values)->save();
$this->entityManager->getStorage('field_config')
    ->create($field_values)->save();

entity_get_form_display('contact', 'organization', 'default')
  ->setComponent('field_phone', ['type' => 'string_textfield'])
  ->save();
entity_get_display('contact', 'organization', 'default')
  ->setComponent('field_phone', ['type' => 'string_textfield'])
  ->save();

This works fine for adding the field storage, and for associating the field instance with the bundle.

However, when it gets to the entity_get_form_display()->setComponent()->save(), the following exception is thrown:

Uncaught PHP Exception Drupal\\Component\\Plugin\\Exception\\PluginNotFoundException: "The "string_string_textfield" plugin does not exist."
at /var/www/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php line 60

What's strange is that the same exception, quoting 'string', is seen for both 'type' => 'string_textfield' and 'type' => 'text_text_with_summary' (which doesn't even contain the word 'string'!) On the other hand, a nonsense value (e.g. 'string_string_textfield' or 'stringz_textfield') yields the exception with the nonsense value in full, no parsing. So there's some kind of detection/lookup going on, but it still can't find the relevant plugin.

What am I missing? What should the value of 'type' be? I'm aware of e.g. https://drupal.stackexchange.com/questions/177913/the-string-plugin-does-not-exist but as you can see the value suggested there doesn't seem to work in this situation.


texts: How can I get the submission ID in a custom submit handler?

texts:
I have added a submission handler in a .module file to execute some custom code when a webform is submitted.
function mh_newsletter_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'webform_submission_newsletter_node_26_add_form') {
    $form['#validate'][] = 'mh_newsletter_form_validate';
    $form['actions']['submit']['#submit'][] = 'mh_newsletter_form_submit';
  }
}

function mh_newsletter_form_submit($form, &$form_state) {
  // Custom code
}

I'm unable to access the webform submission ID. How can I get that value?


texts: How do you order meta tags added by drupal_add_html_head()?

texts:
I'm adding Open Graph support to a Drupal site and I have a bunch of drupal_add_html_head() calls, like:

  $og_title = array(
    '#tag' => 'meta',
    '#attributes' => array(
      'property' => 'og:title',
      'content' => $node->title,
    ),
  );
  drupal_add_html_head($og_title, 'zujava_og_title');

 $og_url = array(
    '#tag' => 'meta',
    '#attributes' => array(
      'property' => 'og:url',
      'content' => url('node/' . $node->nid, array('absolute' => TRUE)),
    ),
  );
  drupal_add_html_head($og_url, 'zujava_og_url');

In total, I have 10 of these. They don't seem to output in the same order they are called (all in a single function).

Is there some kind of weighting I can use to set the order?


texts: how to show more information in user's profile

texts:
by default user's profile in drupal show very little information about users. I can extend that by adding more fields to profiles.
but I want user's profile in such a way that it would be showing all his/her information and some more information like users last 10 posted content, top 10 rated content and most commented content etc.

how can I extend this type of profile view in drupal?
please suggest me, thanks in advance :):)


texts: Duplicate terms in that have mutiple parent category

texts: I am listing some taxonomy terms in view page group by category. Some of the terms have relationship to multiple taxonomy category. I want to display same items more than once in different category on same page. Please help me on this. Thanks


texts: conditionally hide a field based on another field's value (without using templates)

texts:
I have a content type which has a required field containing some personal information like an email address. This field is not on the user entity - it is on an arbitrary content type.

What I need to do is conditionally hide or show this value based on whether the user consents for this information to be shown publicly.

I know that this can be done by creating a second boolean field ("show information" or similar) on the content type, and then overriding the theme template. The problem is that I am using a number of different view modes (via displaysuite) and do not want to have to override them all individually. I've tried calling hide() in hook_node_view with no success. I also can't just hide the value with jquery/css, since this field contains personal information and I can't output it at all if the user doesn't consent.

Is there a way to do this using display suite or a custom module? Is there a common solution to this that I'm overlooking?


texts: Where are Commerce 2 hooks (or Events) in Commerce 2

texts:
I am working on replacing our payment system from D7/DC1 to D8/DC2 and the original code makes use of hooks. I have replaced some of them with events but I cannot find any information on the DC2 versions of:
mymodule_form_commerce_checkout_form_checkout_alter()
mymodule_form_commerce_checkout_form_review_alter()
mymodule_form_commerce_checkout_complete()
mymodule_form_commerce_cart_add_to_cart_form_alter()

Are they still the same or much like the former cart (add, update, remove) hooks, these are also events but I can't locate documentation on them. Anyone know the equivalent events or where to find the docs on these (or their replacements)
/* Small Update */
I found OrderEvents and I think I need ORDER_PAID to replace mymodule_form_commerce_checkout_complete()
Does this look correct?
I added OrderEvents::ORDER_PAID => 'orderPaid' to my getSubscribedEvents(){} array and have:
public function orderPaid(OrderEvent $event){
    $order = $event->getEntity();
    //Some internal logic here
    $order->save();
  }

//Updated
Tried a hook form alter and ran through my checkout process and nothing is showing in the logs
function srs_hook_form_alter(&$form, $form_state, $form_id){
  \Drupal::logger('hook_form_alter fires')->info('
' . print_r($form_id, TRUE) . '
');

}


texts:
Is this possible to create a calendar (using the Calendar module) with this functionality via Views:
 - Calendar is displaying month
 - days contain number (number of nodes in this day)
 - when I click the day, node teasers are loaded below calendar (ajax maybe?)

Do you think that with Event Calendar module I can achieve this?

Thanks.


texts:
In order to import data from a CSV file, I would like to use Feeds. I followed an example from the Drupal Cookbook, and it uses the Basic Page content type.

Because the data I would like to import has unique data, could you please confirm if I will need to create a new content type with its own fields so I can map map the source to target? I would just like to make sure what I am attempting to do is correct to avoid corrupting the database...


texts: How to selectively disable CKEditor on specific pages?

texts:
On a site I am developing, I have installed and enabled CKEditor version 7.x-1.13.

On two of the pages, I need to completely disable the editor from being active when accessing the admin to edit the page.

I am not sure how I can do that. The only thing I have been able to do is either enable or disable the editor globally.

Can someone point out to me how I can get this done?


texts: Add a select list to the content of the view

texts:
Could we add a select list in a view content?

I have below view and I want to add a select list that has (Approve and Reject items) for each row under 'Status' column. Also, there will be a 'Save' button to save the changes in database.

Can we do this in view or there is another way? Please help..


texts: Exposing webform submissions for Views, but not giving anonymous users permission to view all submissions

texts:
I have a webform set up in Drupal 8 and am trying to create a View that displays certain fields from form submissions. The webform and the view seem to be set up fine and are working.

The problem comes in when I want the view to be visible for anonymous users. I seem to be stuck with two options, neither of which are ideal:

Option 1: Anonymous users can see the page created in Views, but there are no fields on it.
Option 2: Anonymous users can see the page with the fields, but I have to grant the "View any webform submissions" permission, which then gives them access to view (and download) on the webform page itself.

Can anyone help me with an option 3, where the fields are visible in this View, but without granting the "View any webform submissions" permission to anonymous users?


texts: I have to store some hidden values in each views rows (To store Latitude and Longitude of Gmap Locations). How to add a input hidden field in Views Field. I tried bartik_preprocess_views_view_fields(&$variables) but it is not invoked.


texts: Remove duplicate records from view result with pager

texts:
My project is setup in Drupal 7 and i am using search API for display my custom search result. Actually i want to show search result based on two content types content so i have configure the search api for those content type and select the fields which i want for search and then indexing the content.

For display the search result i am using drupal View of Index node type.
But the problem is that in my search result i am getting duplicate result because of some contents have same titles but having different body text.

I want to remove search result which have duplicate title. (Custom field created by myself)

I have tried some custom solution by View hook but its not working properly its give pager issue

function custom_views_pre_render(&$view) {
  if ($view->name == 'search_books') {
   $view_ISBN = array();
    foreach ($view->result AS $key => $res_view) {
        $ISBN = $res_view->entity->field_isbn[und][0]['value'];
       if (!in_array($ISBN,$view_ISBN)) {
                    $view_ISBN[] = $ISBN;
             unset($view->result[$key]);
            }
    }

    $view->query->pager->total_items = count($view->result);
    $view->query->pager->update_page_info();

 }
}

This remove the duplicate result but it gives wrong pager result.

I have also tried the Query alter hook but its not working for me.

function custom_query_alter($query) {

  if (isset($query->alterMetaData)) {
    if (isset($query->alterMetaData['view'])) {
      if($query->alterMetaData['view']->name == 'search_books') {
        $fields =& $query->getGroupBy();
        // Tried various fields to check which was the field creating the problem.

        $query->groupBy('field_isbn');
        $query->distinct = TRUE;

      }
    }
  }
}

I have also tried to install "views_distinct" module and distinct the field from view but its also gives me pager issue.

Any Idea how to solve this issue?


texts: Custom javascript runs before block loaded

texts:
I have two jQuery calls to modify two divs on a page. One works, the other attempts to work, but the block is lazy loaded, likely using BigPipe. This helpful doc page is what I'm referring because it explicitly says this is the way to run javascript after the DOM has loaded and all elements are available.
I've given up incorporating it into my custom module and now have broken out the block script to the theme. This is the mytheme.libraries.yml
global-styling:
  version: 1.x
  css:
    theme:
      css/custom.css: {}
global-scripts:
  version: 1.x
  js:
    support/mine.js: {}
  dependencies:
    - core/jquery
    - core/drupal
    - core/drupalSettings
    - core/jquery.once

Here is the mine.js
(function ($, Drupal, drupalSettings) {
  Drupal.behaviors.siteColor = {
    attach: function (context, settings) {
      let varcolor = {"one": '#694D75', "two": '#AD1A1A', 'white': '#fffff0'};
      var backgroundColor = varcolor[drupalSettings.sitelib];
      $(document).once('siteColor').ajaxComplete(function (context, backgroundColor) {
        jQuery(context).find('#sidebar .title-box').css('.background-color', backgroundColor);
      })}
    }
})(jQuery, Drupal, drupalSettings);

This is not a block generated by a custom module, it's just a block created by the customer in /admin/structure/block
What am I not seeing? How to ensure this runs when the DOM has loaded all the way?
Examining @Clive comment and searching for examples using ajaxComplete() I tried this but finding no love.
I don't think this is a call for the Drupal ajax Commands series as I have the drupalSettings variable from PHP. I just need this to run when the DOM has loaded.
I'm not getting the ajaxComplete() action right. Breakpoint outside the ajaxComplete() wrapper the payload script works in console. Stepping  inside the wrapper, the script is skipped and the block is unaffected after the age loads. However, if I remove the wrapper of .once(), .ajaxComplete() I would expect the payload script to run, but the block is untouched. My revised (again) script is above.


texts: Is there any integration of the Entity registration module with modal forms?

texts:
I'm using the Entity Registration module for events registration. I want to open the registration forms in the ctools modal.

I checked the Modal forms module. But on the module page, I can see that it can only work with login/reset password/user regisration/webform/contact/comment forms.

So there is any possibility to use these both modules? Or should I look for something else?


texts:
Drupal by defaults gives us three roles

Administrator
Authenticated users
Anonymous user

Can i add a new roles in it? Like:

suscriber
trusted customer


texts: What is the proper RewriteBase setting for my staged server?

texts:
I'm having issues with Clean-URLs not working on my staged server, possibly stemming from the fact that the installation is pulled down from a Git repo, for staging.

I suppose the .htaccess file is configured properly for my local installation, but not for the staged one which has a different file path. (http://drupal.org/node/1018346)

I have my drupal installation on my staged server (which is having the clean URLs problem) in this location:

/home/user/drupal_dev/www

And in my web server's /var directory, I set a symlink pointing to that www directory in my home. That way I don't have to worry about copying files into a root directory that requires sudo.

Can you offer suggestions on what my .htaccess file should look like, in regards to RewriteBase?


texts:
I'm using Metatag and Printer, email and PDF versions modules, and I want to have the canonical link on the print version of the nodes too, but for some reason they're only showing on the regular version.

I'm not sure if the Print module is removing it. Even if I manually add the canonical link, it shows duplicated on the regular version but not in the print version.

Any idea about what's going on?


texts:
I have got a list of security violations for my website from security team. It says

  Cookie without HttpOnly flag set

  Autocomplete Password Enabled

So, what is this basically? Can I overcome this in my Drupal 7 site?


texts:
We have a content type (Page) and a vocabulary (Sections). The content type has a reference field to the vocabulary, and the vocabulary has a reference to a menu. Also, we are interested in being able to build node layouts, based roughly on the following one.

The issue with the above structure is that the header is node-specific, and the actual content (green) is node-specific, but they are disconnected.

The menu is not node-specific, it's just node-dependent, but actually it's the section's menu, and should be displayed automatically if the node belongs to the section that have assigned menu.

This disconnection of the content creates an issue when it comes to the Layout Builder module. Why? Because, through  the content is being constructed from sections, namely their layouts, the sections act like a multi-value field and they are rendered linearly to create the final result.

They cannot be grouped or nested, which could potentially solve an issue because, if we could nest sections, we could just create a section with header, a section with menu and content, and in content nested multiple sections with multiple layouts.
We we have to do this linearly, though, and here we have an issue, because we can create section for header, section for menu and content, but then we cannot create multiple layouts for content, because that require nesting.

There are few solutions of this problem that come to my mind right now.

Render the header and menu outside of the layout builder, so to just put it in the page.html.twig or node.html.twig, which would assume extracting data required for header and rendering it properly outside of the layout builder. It doesn't feel right, as the best would be to manage all content of node in the layout builder, without doing such exceptions. As mentioned, layout builder seems to handle only linear content, so it seems to be impossible to treat header and other content separately, as different regions, to which multiple sections could be added. Regions seem to exist only in sections, not outside of them.
Use something like https://www.drupal.org/project/mini_layouts to allow for layout nesting. That introduces dependency on a module in alpha version, but seems like the best bet for now. Content that is not a header, could be then put in mini layouts.
Alter rendering/editing of layouts to allow me to have effectively at least a single level of nesting. The best would be if every section would have a "region" it belongs to - which could be maybe possible if I would be able to create an "overlayout", which would be a layout of layouts effectively.

As you can see, I'm aware of multiple hackish ways of solving this, but I'm looking for something that would be the least hackish of all. Maybe there is a popular third-party module that I'm missing, which could help in a more elegant way than other ideas.

Could I achieve effectively an additional level of nesting by creatively using section's configuration? Could I make section so configurable to the point of defining its "sub-layouts"? That actually seems like a very clean way of achieving what I need to achieve, without adding any dependencies.  Is there anything better?


texts: How i can add new fancybox-style (theme) for display uploaded image in WYSIWYG / CKEditor with Media module?

texts:
When I upload new image with Media Browser (WYSIWYG + CKEditor + Media), I see themes: original, small, large... How i can add my own template to this list for fancybox?

Maybe already have a module for this theme?


texts:
I made a test.html file to test web fonts bought on Fonts.com.

@import url("http://fast.fonts.com/cssapi/3bcaa9a7-xxxx...xxxx.css");

This worked without any problem. But when I add this to my global.css file in my Drupal Template, it doesn't work. Other things from global.css are all ok... So the file gets loaded.

Any other simple way to do this without the use of a module?


texts: Are there plugins available for an "improved" Find Content admin interface?

texts:
One of our clients has a lot of content over a number of languages and has expressed that they don't really like the Filter/Sort options available on the Find Content page.

Are there any plugins available that present this information in a different manner...maybe something like Windows Explorer?


texts: Problems linking Image to product display node

texts:
I'm trying to implement something like what's referenced here Image redirection problem, but I closer to the mark with this method http://www.drupalcommerce.org/node/556. The problem I'm having is that this sends me to a 404 page somehow the path is corrupted to this "localhost/drupal//drupal/node/437"

This was done by adding the field Content:Path to my view and excluding it from the display, placed it first in the field order, and then changed the image field by rewriting the result, exporting as link, and using the [path] token as the link itself.

I also tried the same thing with Content: Nid, first field but excluded from display, ditto with the image field but I used the [nid] token. This got me a cleaner path  "localhost/drupal/437" but it's still going to a 404 page.

So in the first instance it's writing too much of the path into the link and in the second instance it's not inserting enough of it.


texts: Fixed number of digits from Token module random number

texts:
I want to use the Token module random number generator, but it says use [random:number] to generate "A random number from 0 to 2147483647".

How can I change this and get fixed number of digits? For example, I need a 4 digits in each generated number (1000 to 9999). Or only 3 digits in each number (from 001 to 100).


texts: Admin to Create User type Foo that can then Create User type Bar

texts:
I'm looking to build the following user structure in Drupal 8

Admin: They can create users of type Foo and Bar.

Foo: They can only create user type Bar.

Bar: They can only create content of a particular content type.

Is this achievable with any current module release? Here are some that I found that could help contribute to a solution:

I've seen profiles, but it has not got an official release yet.. and the feature set doesn't take care of my problem.

Rules, again not a full release but it can trigger events depending on a saved node/ submitted form etc..

Administer users by roles, sounds perfect, not tried and tested.. but noticed again the no official release.

Organic Groups. I don't need to entwine users and nodes (associating content with groups). Which is what I gathered when installing this module

The other option would be to create some custom code that is fired on the submission of a form to add a user via official drupal code... the only problem with this is making sure the code is correct and updated as new release of drupal is released for example. Would this be a good / stable approach?

Can anyone help point me in the direction of a solid solution?

Thanks in advance.


texts: How can I alter an "Add to cart" button at the submission time?

texts:
I am using the Drupal Commerce module, and I need to fire some operation at the time the users click on the Add to cart button, but I am unable to find any hook for this.

I am using this code but it is not working.

/**
 * Implements hook_form_alter().
 */
function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'commerce_cart_add_to_cart_form') {
    $form['#submit'][] = 'custom_submit';
  }
}

function custom_submit($form,$form_state) {
  die("Tesing");
  drupal_set_message(t("Don't panic!"), 'warning');
}


texts: How add javascrip file to a node? (module)

texts:
I have create a module who add a new node named SquareOffs. I make that in my squareoffs.info file.
I would like to add to that node a javascript file, squareoffs.js, but I don't know to do that.

I have seen the drupal_add_js() documentation but I don't know understand how it works, how can I add the js file to this node??

Thank you very much for  your answers or your sugestions!!


texts: How to send an email once a new member is invited using the Group module?

texts:
I am using the Group module on a Drupal 7 project. I would like the system to send an email notification once a new member is invited.

I'm assuming I could use the Rules module to perform this task, but so far my new rule configurations for this task is not working.

Has anyone experienced this issue and resolved it? If so please share your steps on how you achieved this.


texts: Verification code when adding new telephone number

texts:
i used Sms Framework send sms to user if someone comment on their nodes system run ok, no problem.
And also i create new cck field for users phone, when user goes their account they able to add
or update  this field.
My question is how should i control if this telephone number belongs to user. How can i verificate this.


texts: Drupal subsite status report not showing correct profile

texts:
I have installed a Drupal site with lightning profile and exported all the configuration in to /config/default folder using drush config-export command.

After that I have created a subsite and the subsite is installed with a custom profile which depends on lightning profile.

But after installation in subsite status report it is showing that Installed profile is 'lightning' instead of my custom profile.

Am I missing anything? Is there any additional parameters to be added in custom profile?