texts: Email notification or several reminders at different time points

texts:
I have content where in I have to send the email notification or several reminders at different time points:
Ex: After saving content, email should send after 1month.
then after 6 months for the same content.
then once every 5 years.
I have tried with node expiry module but it displays content expiry, and when we run the cron at that time only its able to send the mail,user cant run the cron every time sometime he may forget though.

Also I tried with rules schedule but I am not getting exactly what I want like i cant send the email according to time interval, also how to send mail without running the cron. can any one know how to resolve this issue.please help me.


texts: Passing variables to a theme from a custom module

texts:
I have a custom module which initiates the theme hook - passing the $node object as an argument:

theme('my_widget', array($node));

function my_module_theme() {
  return array(
    'my_widget' => array(
      'template' => 'my_widget',
      'variables' => array('node' => array($node)),
    ),
  );
}

However, in the 'my-widget' template file, I need to pick up the $node variable. But doing a dpm() on $node returns Null.. - think I may be setting the variable incorrectly, but not sure what's going on. Cheers


texts: Hide Certain Values from an Apache Solr Facet

texts:
I have some Apache Solr facet blocks i'd like to filter certain values from. For example if a facet contains the values:

Filter by letter:
 - a (6)
 - b (4)
 - c (2)

I want to hide the facet "c" so visitors won't be able to use it as a filter. Is it possible? i'm ok with editing/creating modules and also it would be okay a solution that uses CSS to hide the row from view (which was my first thought but then i realized there isn't a unique identifier for facet values)


texts: How to make the translations for verification email template in drupal 7?

texts:
I used User verification module for sending verification email to users and it worked perfectly. After that, I wanted to add the multilingual function for the website (use http://drupal.org/project/i18n) but I couldn't find any places to make or edit the translations for verification email template.

How can i make the translations for verification email template?


texts:
function form_example_form($form, &$form_state) {
      $form_state ['store_value'] =1;
      $form['submit_button'] = array(
        '#type' => 'submit',
        '#value' => t('Click Here!'),
      );

  return $form;
}

How to do this in drupal 8


texts: Field type "date" is not in the list of available field types

texts:
I'm trying to create a new content type with a field that would contain a date. However, the drop-down list for field type doesn't have "date". What's wrong?

p.s. drupal 7.17


texts: hook_theme default arguments not recognised in template

texts:
When using hook_theme I create an array of variables with default values:

/**
 * Implementation of hook_theme
 */
function my_module_theme() {

  return array(

    'my_theme' => array(
      'arguments' => array(
        'var1' => 'default value',
      ),
      'template' => 'my-theme',
    ),

  );
}

And the template file my-theme.tpl.php:

<?php print $var1; ?>

But inside the corresponding template the $var1 variable is only recognised if I explicitly send it with the theme() implementation:

print theme('my_theme', array('var1' => 'New var'); // No errors

print theme('my_theme'); // Notice: Undefined variable: var1 in include()

My understanding of the default arguments are just that - they should be the default if they are not explicitly defined. What am I missing?


texts:
Well Im trying to use some conditional fields while creating some type of nodes. for example

I have a content type called "organization" this content type has

name, logo, and some other stuff

also has a select box field where the user selects the type of organization, depending of what the user selects I need to show other fields that depends of the type of the organization.

There is a module for this?

Thank you


texts:
I'm trying to setup a REST server to allow login from external apps.
I managed to get the sequence working using the Poster plugin in Firefox but can't seem to replicate using a small Perl script.
I manage to get the X-CSRF-Token but fail to connect, getting a 403 response.

This is the sample Perl code.

my $ua = LWP::UserAgent->new(env_proxy => 0,
keep_alive => 0,
timeout => 60);
$ua->agent('Mozilla/5.0');

my $req = new HTTP::Request('GET', 'example.com/services/session/token');
my $response = $ua->request($req);
unless ($response->is_success) {
    die $response->status_line;
}
my $token = $response->content;

my $header= HTTP::Headers->new;
$header->header('Content-Type' => 'application/x-www-form-urlencoded', 'X-CSRF-Token' => $token);

$req = new HTTP::Request('POST', 'example.com/smartphone_service/system/connect.xml', $header);
$response = $ua->request($req);

I installed the Services module and REST server locally, and that test worked. Service config is the same as the prod. What could be wrong?


texts: Blocks missing from homepage after logout

texts:
Possible Duplicate:
  Content not showing when logged out!

I don't understand why this is happening. When logged in everything is fine but when logged out some blocks like slideshow and some views go missing. What's annoying is that I have two jCarousel slideshows on my page and only one of them disappears after logout.

I've checked the user permissions and I don't find any anomalies there. Can anyone please suggest why this could be happening?


texts: What is the rule on licensing and third party code?

texts:
When you create a module that uses third party code, is there any instance in which it is "okay" to include it in the module as opposed to have the user download it themselves?

For instance, if you make a module that integrates a CKEditor plugin - I would think that you can't or rather, shouldn't put it into your module on drupal.org.

I see this here: https://www.drupal.org/node/422996

My gut tells me it is likely not good practice to bundle it up into your module.


texts: Help text of content types with fckeditor

texts:
I would like to have the help text of content types to accept full html. Is that possible?

I am using Drupal 7 and fckeditor.


texts:
I'm trying to install memcached and having no luck getting the site to run in local development using OS X 10.9 Mavericks. The homepage loads, but that's it. Everywhere else, I get this error:

  Fatal error: Maximum execution time of 180 seconds exceeded in /Users/me/Sites/mysite/modules/field/modules/field_sql_storage/field_sql_storage.module on line 352

I get the error at the same point, no matter what the max_execution_time is set to.

I'd love to get this working, but I'd be content just to uninstall the whole mess. I can't seem to get the site working again even after I attempted that.

Some additional bits of information:

memcached and libmemcached are installed via homebrew.
The memcached daemon is running.
The memcache and memcache_admin modules are enabled
memcache_admin is still giving me statistics at the bottom of the page.
The Drupal admin seems to work just fine.
The machine is a 2013 Retina MacBook Pro with a 2.4GHz i7 and 16 GB of ram.
Here's the memcached info from phpinfo()

Only a very small bit of the page loads whent his timeout happens. Just a menu and a few small things from the top of the page. The memcached statistics load in the menu that's highlighted. There's about 20,000 rows worth of statistics.


texts: How to identify all modules hosted on drupal.org that depend on a given module?

texts:
Assume any contributed module X (e.g Quiz) on drupal.org (=D.O), or any of its sub-modules Y (e.g Quiz Stats). Any such (sub-)module may depend on one or more other contributed (sub-)modules Z (e.g Charts, disclosure: I'm a co-maintainer), as indicated in the (sub-)module's info file (e.g in the last line of the info file of the Quiz Stats module).

My question: How can I identify all modules X and submodules Y, which depend on module Z?

The question about "Is there a drupal.org API for retrieving the list of available modules?" is somehow related (not a duplicate IMO), but none of the answers there seem to help to find the answer to my question, or am I missing something in those answers?

Note: this question is really about modules "on drupal.org", so I may not even have Drupal installed anywhere ... Think of this question in the context of, for example, a d8rules campaign, where somebody wants to try to find other modules depending on Rules to reach out to the module (co-)maintainers of those other modules (for whatever reason related to such campaign).


texts: How do you go without hierarchical taxonomy filters, when the site heavily relies on content browsing(multiple filters and sorting)?

texts:
I'm building classifieds site with drupal and got stuck on one major issue: I have 1 taxonomy vocabulary with parents, children, grandchildren and great-grandchildren, and can't find a way to build browser which would not restrict user's choices.

Over few days I found many drupal users stuck in the same place waiting for hierarchical taxonomy filters in views. this simple hierarchical select  almost solves it, however in views it does not show child nodes when parent term is selected.

So what are the ways to go around this issue in drupal? Anyone built a site with hierarchical taxonomy vocabularies?


texts: Redirect user to login page when they have to access to a view?

texts: I have a view which is only accessible to authenticated users. However, there are links to it on the site. Can I make it so that an unauthenticated user gets redirected to the login page, instead of the 403 they're seeing now?


texts:
So, I have to work on a D8 site I don't have a user account for. So, when I brought the code and database over to my local environment, I thought this would be an easy fix for drush.

My local dev environment is an Ubuntu server running on WSL, with php 7.2, and Drush version 8  I used the Drush ucrt and urol in the terminal, and both returned successes. I also had to temporarily deactivate the basic_auth service as the login pages weren't accessible after the move. Finally, when I tested the new user and password, it didn't work. I cleared the caches, re-set the password again, and then finally had the account blocked from too many failed attempts.

What's going on here? why didn't this work? and what do I do to make it work? I'd rather not add the user in Mysql, as I haven't seen a good tutorial for this.


texts: Calling /user page with username instead of uid results in database exception due to failed string to int conversion

texts:
When I use a username as an url parameter like: 'www.example.com/user/adam' instead of 'www.example.com/user/27' I get a database exception:

  Error message
  PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the nvarchar value 'adam' to data type int.: SELECT base.[uid] AS [uid], base.[name] AS [name], base.[pass] AS [pass], base.[mail] AS [mail], base.[theme] AS [theme], base.[signature] AS [signature], base.[signature_format] AS [signature_format], base.[created] AS [created], base.[access] AS [access], base.[login] AS [login], base.[status] AS [status], base.[timezone] AS [timezone], base.[language] AS [language], base.[picture] AS [picture], base.[init] AS [init], base.[data] AS [data] FROM {users} base WHERE ( ([base].[uid] IN (:db_condition_placeholder_0)) ); Array ( [:db_condition_placeholder_0] => adam) in DrupalDefaultEntityController->load() (line 196 of C:\inetpub\wwwroot\includes\entity.inc).

I use pathauto which uses the following pattern for user account page aliases:
users/[user:name] and that works fine. I just stumbled upon this error when testing the site before deployment. I'd rather not have this error visible to users which might try to navigate to /user instead of /users.

Since it only seems to be legal to use actual uid's when calling the /user/ subpage (aside from the login and logout pages etc.), what can I do to prevent drupal from trying to parse a username as an int and producing this error? Is there some redirect I can perform?


texts:
In Drupal 6 a view can be embedded into a node as follows:

$viewName = 'LatestNews';
print views_embed_view($viewName);

This does not work for drupal 7.  What is the function to embed views in drupal 7?


texts: Trying to get a field from a fetched entity in rules

texts:
I'm trying to use PHP evaluation in rules, and I'm having some trouble getting the data.

This is the beginning of the variable $entity_fetched:

Test 103
stdClass Object
(
[vid] => 611
[uid] => 1
[title] => Test 103
[log] =>
[status] => 1
[comment] => 1
[promote] => 1
[sticky] => 0
[nid] => 611
[type] => calendar_event
[language] => und
[created] => 1380898459
[changed] => 1380898459
[tnid] => 0
[translate] => 0
[revision_timestamp] => 1380898459
[revision_uid] => 1
[body] => Array
(
)
[field_date_time] => Array
(
[und] => Array
(
[0] => Array
(
[value] => 1380898800
[value2] => 1380898800
[timezone] => America/Detroit
[timezone_db] => UTC
[date_type] => datestamp

I'm trying to get the value under field_date_time, but trying to get it as an array gives me an error that I am trying to get arrays from a stdClass object.

<?php print_r($entity_fetched['field_date_time']['und']['0']['value']); ?>

So then I try to do this:

<?php print_r($entity_fetched->field_date_time->und->0->value); ?>

and it gives me an error:

Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or T_VARIABLE

What am I doing wrong here? How do I get this information?


texts:
I am able to save a sample webform in Simpletest if I only use title and body:

  $edit = array();
  $edit['title'] = 'Sample webform';
  $edit["body[$langcode][0][value]"] = $this->randomName();
  $this->drupalPost('node/add/webform', $edit, t('Save'));

But when it comes to add the additional fields,

$edit['customfield_xxx'] = '0053416';

the test fails:

Failed to set field customfield_xxx to 0053416

Is any nesting necessary to make it work?

UPDATE
It seems like after submitting the form as describe above I need to access the components page:
$this->drupalGet('node/1/webform/components');
where I build an array with all components. However I have been able to fill in the specific component form with 1 single field.


texts: How i can use the feed module for uploading the images in the image field of the content type?

texts: How can I use the feed module for uploading images into the image field of a content type,  using a .csv file and storing the images inside a directory on server?


texts: What do I look for if my page cache is not serving content or being invalidated?

texts: I have page cache turned on but my I keep getting a cache miss. Something in custom code most likely or theme layer is invalidating the cache? What am I looking for?


texts: Is there a way with drush or console to delete all active config with a certain prefix?

texts:
I'm currently trying to migrate a site with drush migrate-upgrade --configure-only ... and copying the export migrate_plus.migration_*.yml into a custom module for tweaking. Now I want to enable that module but I get PreExistingConfigException.php and ... provided by MYMODULE already exist in active configuration.

I'd like to delete all config but it looks like the latest drush has removed drush config-delete and drupal config:delete is gone too. How do I achieve this?


texts: How do I transfer nodes categorized with one taxonomy term to another?

texts:
Im on d7. I have a lot of nodes on my site that are all categorized with one of eight terms of my "category" vocabulary. I have been doing a theme redesign that calls for me to make a new taxonomy vocabulary that these node will be categorized in called "sections". I need a way to make all current nodes with "categories/term-1" to also have "sections/term-1", "categories/term-2" to have "sections/term-2", and so on. I was thinking I could do this with rules, but that would be a per node basis and I need this to update ALL current nodes. Any suggestions?
Thanks.


texts: Which settings to use in hook_field_formatter_view?

texts:
Looking at the page of hook_field_formatter_view, the explanation for $display is:

  The display settings to use, as found in the 'display' entry of instance definitions. The array notably contains the following keys and values;

But I just found out that the $display variable does not hold accurate information.

This is what's inside my $instance (correct settings)

This is what's inside my $display (default values for settings)

I could overwrite $display from the $instance settings, but I can't figure out in which variable the current view mode is stored, so that I can grab the settings for the correct view mode.

As a little background info, this is a custom field with a custom formatter. Has anyone had similar issues with a custom field/formatter?


texts: Which hooks can I use in profile development?

texts: Which hooks are available in profile distribution development? Which other hooks can I use except hook_install_tasks()?


texts: How to properly add JavaScript to drupal

texts:
I'm trying to create a module that will make use of Google Maps to display the current places indicated in the search results via markers. The problem that I'm having is that I'm getting the following error when I add the Google maps script:

Uncaught ReferenceError: jQuery is not defined

The map wouldn't work if I don't include my own version of jQuery, but the error stays there whether or not I include jQuery.

function gmapsnrew_block_view($delta = ''){
    $block['subject'] = 'Google Map Test';
    $block['content'] = '

';
    return $block;
}

drupal_add_css(drupal_get_path('module', 'gmapsnrew') . '/css/gmapsnrew.css');

drupal_add_js('http://maps.googleapis.com/maps/api/js?key=google_key&sensor=false&libraries=places');

drupal_add_js(drupal_get_path('module', 'gmapsnrew') . '/js/load-map.js');

And the load-map.js looks something like this:

(function ($) {
  Drupal.behaviors.gmapsnrew = {

    attach: function(context, settings){

      console.log(context);
      var base_lat = 51.322377;
      var base_lng = -0.1358427;

      var latlng = new google.maps.LatLng(base_lat, base_lng);
      var options = {
          zoom: 10,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          mapTypeControl: false
      };
      var map = new google.maps.Map(document.getElementById("map-canvas"), options);
    }
  }

})(jQuery);

Any ideas what I'm doing wrong here? Thanks in advance.


texts: Is there a standard place 3rd party module pages report what PHP version they're tested on?

texts:
Is this info reported anywhere?

for e.g.
https://www.drupal.org/project/optimizely

or

https://git.drupalcode.org/project/optimizely


texts: display suite code - set token value of color field module as php variable an convert to rgb

texts:
$hex = "[node:field-ref-participants-category:field_color]";
print $hex;
list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
echo "rgba($r,$g,$b,.9)";

Why does $hex printed correctly, but doenst work in the sscanf-function? when I set $hex = "#000000" manually instead of the token replacement is converts correctly...

is there another way to set the $hex-variable. the color comes from a reference term with a colorfield in it.


texts: Menu active trail not working with facets

texts:
I'm using Facets and Facets API Pretty Path (https://www.drupal.org/project/facetapi_pretty_paths), together with Menu Trail By Path (https://www.drupal.org/project/menu_trail_by_path). Thanks to Pretty Path I have normal paths without query strings. when I click on a menu item it goes to the correct page but the active trail isn't set in the main menu.

Only when I clear the cache the active trail is set correctly.

At first I blamed the query strings but even without query string the active trail isn't working like it should.

At this point I'm not sure how to continue, I've debugged the Menu trail by Path module and everything works as it should. Perhaps a double caching issue? Any thoughts?


texts: Making both Site name & Site slogan to be one single link in mini-panels

texts:
I use the Mini Panels module and have created an header with both Page elements "Site name" & "Site slogan".

The Site name (H1) is a clickable link that leads to the home page, but the site slogan (H2) is just a text that links nowhere.

Can I make both of them a single link to the homepage (but still keep them different elements with different CSS, etc)?


texts: Render media url in node--page.html.twig

texts:
I have an Entity reference field field_video. It's a core Media field with a Reference type of Remote video.

Because I use this field_video in my Hero section I need some additional markup here.

From the admin node/add/page, the editor can insert a Youtube remote video (url).

When I debug the page I see the following variables (see screenshot).

How do I render the media url in node--page.html.twig? Then I am able to build the correct HTML markup and styling around it.


texts: Html tags get stripped in full html when "Correct faulty and chopped off HTML" is on

texts:
All my html tags get stripped when I input html in "FULL HTML" mode. I have tried the simplest correct html I could think of:

Visit W3Schools.com!

still the html gets stripped resulting in plain text. This happens wether I add the html in an article, a basic page or a custom panel pane content.

The problem gets solved if I uncheck the "Correct faulty and chopped off HTML" filter In Configuration->Content authoring->Text formats->full html. In that case the html tags are not stripped and the content displays correctly. But I would like to keep this "Correct faulty and chopped off HTML" filter on. What am I missing?

I am using drupal 7.26

Thanks baba


texts: How can I have conditional content within page body that is dependent upon the domain?

texts:
We are planning to use Domain Access to manage 5 different domains that will share content.  The majority of our pages will be shared across all 5 domains and will look identical on each domain. Domain Access makes it trivial to handle this use case. However, on some of the pages, 95% of the content will be identical and 5% of the content will be dependent upon the domain that is serving the page.

One possible solution is to create a unique page for each domain and publish it to the appropriate domain.  Although this works, it is difficult to maintain because we would need to maintain changes to the identical content across 5 unique pages.

Another option would be to embed PHP in the page, such as

shared content for all 5 sites here.

<?php if ($_SERVER['HTTP_HOST'] === 'domain1.example.com') { ?>

domain1 specific content here

<?php } else if ($_SERVER['HTTP_HOST'] === 'domain2.example.com') { ?>

domain2 specific content here

<?php } ?>

Again, this would work, but has several disadvantages.  I am looking for a way to share the identical content across the domains and yet have site specific content within a page in a way that makes it feasible to maintain and easy for content editors (non-technical users) to edit. Does anyone have any suggestions?


texts:
Drupal 7 adds the form-text class to my input fields, which messes with the layout from my custom Bootstrap-derived theme.  How can I strip these out?
I tried with hook_form_alter(), but the form-text class isn't there for removal, so it must be applied somehow after the hook is invoked.


texts:
I'm trying to add an sort condition to an EFQ on an reference entity table, I think a code example explains this better.

$query = \Drupal::entityTypeManager()->getStorage('node')->getQuery();
$ids = $query->condition('type', 'some_type')
  ->condition('some_more', 'conditions')
  ->sort('a_term_field', 'ASC')
  ->execute();

Now what happens is that the nodes will be sorted by the term id (since that is what is stored in the field table) but I would like to sort on the term label instead. Is something like that possible with EFQs?


texts: I'm using Drupal Commerce on my site, and I'm trying to add a drop down menu that allows my users to select a product size (S, M, L), and I want the price calculated based on their selection. E.g. each quantity is a different price (S = 25, M = 50...etc). This seems like it should be simple, but it's not something that looks do-able with commerce core? What is the best way to implement this?


texts: How to create a full project on drupal.org?

texts:
I have created a custom module in Drupal 7. And now I want to contribute this module via drupal.org. For this I have created my account on drupal.org and created a sandbox project.

Now I am not getting how to make it full project.


texts: how to add a class to the widget pager of views slideshow

texts:
I want to add a class to the widget pager of views slideshow. I found the function in the file /theme/views_slideshow.theme.inc wich theme the wrapper of the widget

function theme_views_slideshow_pager_widget_render($vars) {
  // Add javascript settings for the pager type.
  $js_vars = array(
    'viewsSlideshowPager' => array(
      $vars['vss_id'] => array(
        $vars['location'] => array(
          'type' => preg_replace('/_(.?)/e', "strtoupper('$1')", $vars['settings']['type']),
        ),
      ),
    ),
  );

  drupal_add_js($js_vars, 'setting');

  // Create some attributes
  $attributes['class'] = 'widget_pager widget_pager_' . $vars['location'];
  $attributes['id'] = 'widget_pager_' . $vars['location'] . '_' . $vars['vss_id'];
  return theme($vars['settings']['type'], array('vss_id' => $vars['vss_id'], 'view' => $vars['view'], 'settings' => $vars['settings'], 'location' => $vars['location'], 'attributes' => $attributes));
}

I just want to modify the line to add my own class (as grid-6 for example)

$attributes['class'] = 'widget_pager widget_pager_' . $vars['location'];

I try to use this function in my file template.php without success.

the classes of the wigdet pager in my html code are :

views-slideshow-pager-fields widget_pager widget_pager_bottom views_slideshow_pager_field views-slideshow-pager-field-processed

So i imagine that an other function add the classes. But wich ?

How can i do this ? May i write a module or simply use a preprocess function in my template.php

Thanks


texts: How Do I pass the Option description in Checkboxes to a webform result

texts:
I have a 3-option checkbox built as follows in Drupal 8.

How do I pass the value of the option title selected by the user into the webform submission result?

For example in the below, if a user chooses 21, the result should show 21 in the submission result.

[] 21
[] 22
[] 36

Each check box is a node field fld1, fld2, fld3. I have got these displaying correctly but the result shows up as [fld1] for option 21

Additional details

Here is the raw source generated by the webform module. This is Drupal 8 btw.

choose_a_value:
  '#type': checkboxes
  '#title': 'Choose a value'
  '#options':
    '[webform_submission:node:field_fld1:value]': '[webform_submission:node:field_fld1:value]'
    '[webform_submission:node:field_fld2:value]': '[webform_submission:node:field_fld2:value]'
    '[webform_submission:node:field_fld3:value]': '[webform_submission:node:field_fld3:value]'
   '#required': true
  '#required_error': 'Please choose a value'


texts: A different set of terms for each group?

texts:
I am considering to use de group-module to organize nodes by department. Each department has different taxonomy terms to classify their nodes. The goal is to have them describe their howto's and workflows, classified by task. (Drupal 8)

The setup:
Group Type = department
Groups of type department: Sales, Buying, Finance
Node type: Article with fields (title, body, etc) and a taxonomy-reference named "tasks"

example: Sales has tasks like "prepare quote", while Finance has tasks like "prepare sales invoice" - each have their own set of tasks they want to refer to.
Both would use the content type "Article".

Question: How would I organize the vocabulary "tasks" to show the relevant terms to the user of a department when they are editing or creating a new Article ?


texts: General error: 1366 Incorrect integer value while uploading image

texts:
I am using Drupal 7 and I got the following error while uploading an image.
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_third_section_image_width' at row 1:
INSERT INTO {field_data_field_third_section_image} (entity_type, entity_id, revision_id, bundle, delta, language, field_third_section_image_fid, field_third_section_image_alt, field_third_section_image_title, field_third_section_image_width,
field_third_section_image_height) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4,
 :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7,
 :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10);
     Array ( [:db_insert_placeholder_0] => node
    [:db_insert_placeholder_1] => 107
    [:db_insert_placeholder_2] => 107
    [:db_insert_placeholder_3] => page
    [:db_insert_placeholder_4] => 0
    [:db_insert_placeholder_5] => und
    [:db_insert_placeholder_6] => 12464
    [:db_insert_placeholder_7] =>
    [:db_insert_placeholder_8] =>
    [:db_insert_placeholder_9] =>
    [:db_insert_placeholder_10] => )

    in field_sql_storage_field_storage_write() (line 514 of /mysite/modules/field/modules/field_sql_storage/field_sql_storage.module).

Its also give some image related error on recent logs
Unable to generate the derived image located at public://styles/thumbnail/public/imac1.png.
Whenever I trying to upload the image and save the node then it gives the following error.
I have already given the writable permission to files directory and tmp directory.
Any Idea?


texts: How to overcome "Add new date link" issues in the 7.x-3.4 Calendar?

texts:
Solved See my solution in the answer below.

I am having an issue with the 7.x-3.4 Calendar, and would like to know if anyone has a solution, or suggested solution, to this issue.

Background: I have created a new content type of "Booking", and have created a new Calendar View that displays only dates of this content type. The Calendar works fine, and if I add new content through my Administrator option of "Add content", I can define my date, taxonomy terms and specific information (such as the Point of Contact (POC) name and email address) without an issue. These display perfectly on my newly created calendar, with a coloured stripe dependant on the taxonomy term selected (just for interest, the taxonomy term defines which room they would like to book). From here however, I have this issue:

In the page to edit the view for the calendar, I select Format > Show > Settings, and get the "Month: Row style options" page. When I select a content type in the "Add new date link"   dropdown box, I do not get an "Add" link on my Calendar. (I have tried all the different types of content, including a content type that all authenticated users are able to, and actively do, create new content within. I have edited the permissions to allow all authenticated users to create content of content type "Booking". As a point of interest, I also use OG, however have not defined an OG "Group" to this content type, and do not plan to align this content type or calendar with any form of OG functionality in the future. I thought it pertinent to mention this in case here is where my problem lies)

I would greatly appreciate any feedback or thoughts anyone has, please do not hesitate to ask for any more information that you feel you may need!


texts: Conditional Fields module not working when OR operator is used

texts:
Using conditional_fields 7.x-3.x module
having two fields "category"(list containing a,b,c,d) and field "total rooms".

I have placed a dependency to show the total rums when category is "a" (OR) category is "c".

                      field_category       field_total_rooms is visible when field_category has value "a".
field_total_rooms                     OR
                      field_category       field_total_rooms is visible when field_category has value "c"

total rooms is being displayed when  category is "a" but
total rooms is not getting displayed when category is selected as "c".
Any suggestion


texts:
I created a Ctools Multistep form. Its working fine. But when a user opens this multistep form in two tabs and fill the form fields simultaneously and submits it, both the submitted forms have same values for all the fields. Means both the submissions have same data.

When I have submitted this form in different browsers simultaneously, then both submissions have their own data.

I followed this tutorial to make Ctools Multistep form : http://www.xenyomedia.com/content/4-steps-form-multistep-form-ctools

I think, the problem is with $object_id = 'ctools_multistep';, because its same for both the forms in different tabs. Thats why it creates the same submissions for both forms.

Can anyone help me regarding this?


texts: Application form and fee for Drupal Commerce

texts:
I am taking application fees for application processing for a real estate broker.  When the user fills out an application, they need to submit payment immediately.

The issue is this isn't really a product.  It's a processing fee.  Am I stuck with using a product?  Can I create an order without the product and just use the fee?  I feel like I should create a line item for an order and do it that way, so the pricing rules flow normally.

When the user is ready to submit their application, I'm going to use the Drupal NoCart module to take the customer straight to payment.

I haven't been able to find a business case like this online anywhere.

For the new line item type, it looks like I should create a new one:

function mymodule_commerce_line_item_type_info() {
    $line_item_types = array();

    $line_item_types['appfee_type'] = array(
        'name' => t('Application Fee'),
        'description' => t('Line item type for app fee.'),
        'product' => FALSE,
        'base' => 'appfee_type'
    );
    return $line_item_types;
}


texts:
From a custom module in Drupal 7 I am trying to load a template after I submit and process my form.

I can load the theme fine from a page callback:

function mymodule_theme() {
  $themes = array(
    'mymodule_report' => array(
      'template' => 'themes/mymodule_report',
      'arguments' => array(),
    ),
  );
  return $themes;
}

function mymodule_menu() {
  $items = array();
  $items['reports/performance'] = array(
    'title' => 'My Module Performance Report',
    'page callback' => '_mymodule_report',
    'access arguments' => array('mymodule_client'),
  );
  return $items;
}

function _mymodule_report() {
  return theme('mymodule_report');
}

All of that works fine (e.g I can go to www.mysite.com/reports/performance and my tpl loads.).  The problem is when i submit a form, after I process the form I want to pass the form data to the template, and load the same template page.

I modified the hook_theme like this:

function mymodule_theme() {
  $themes = array(
    'mymodule_report' => array(
      'template' => 'themes/mymodule_report',
      'variables' => array('parameters' => NULL),
    )
  );
  return $themes;
}

And in my submit handler for my form after I gathered all my form values into an object ($submission), I added this at the end:

 return theme('mymodule_report', array('parameters' => $submission));

All that happens is my form reloads...what am I missing?


texts: how to hide articles page from home page in drupal

texts: I have added article page in my project and made Views for that, but articles page also display on the front page. How to hide article from home page?


texts: How to expose filter for entity reference as dropdown in the Search API view?

texts:
In my Search API view, I'd like an Exposed filter > Entity reference to be a select box, not a text field.

Details

I have a view which I created like:

Views > Add new view > Show: default node index

So it uses the Search API index as a basis.

In the Search API I have ticked to index field_entity which is an Entity reference > Content_type: entity (confusing naming, I know).

I want the user to go to the views page & be able to filter the view results by field_entity (which is an exposed filter/entity reference).

The issue is the view shows the exposed filter as a text field. I have edited field_entity & checked the box Render Views filters as select list - this works fine for a normal view but not for a Search API view.

Question

Can I somehow convert this text field to a select box?

To clarify, I cannot use custom or contributed modules on this project, so it needs to be done without using hooks, or other modules, etc.


texts: I am new to Drupal and Views. I need to list all the authors(users) in my drupal 7 page? Do I need to add relationships for this ?


texts: Drush Remote Aliases Line Wrapping Different Than Local Line Wrapping

texts:
We are using Drush version 5.9 and Drupal 7.27 and 7.26.

We have a variety of drush aliases, some marked specifically as REMOTE and one for the LOCAL instance.

Example for REMOTE:
$aliases['ALIASNAME'] = array(
   'root' => 'PATH',
   'uri' => 'URI',
   'remote-site' => TRUE,
   'remote-host' => 'REMOTEHOSTDNS',
   'remote-user' => 'DRUSHUSER',
 );

Example for LOCAL:
$aliases['ALIASNAME'] = array(
   'root' => 'PATH',
   'uri' => 'URI',
 );

When we run a drush command for the LOCAL instance, the line wrapping in the output looks as expected.  For REMOTE instances, the line wrapping is different and difficult to interpret.

Example of REMOTE Drush line wrapping:

Other        Fusion Starter Lite                Theme   Disabled       7.x-2.0
          (fusion_starter_lite)                                     -beta2

Example of LOCAL Drush line wrapping:

Other                                  Fusion Starter Lite (fusion_starter_lite)                           Theme   Disabled       7.x-2.0-beta2

What can we do to get the REMOTE line wrapping to match the LOCAL line wrapping style?

Thank you for your help.


texts: Complex conditional logic for Webform field in YAML format

texts:
I have a complex scenario in Webforms, where field #states depends on multiple OR / AND conditional logic.
For Example:
field_d has a visibility condition where field_a must be filled and either of field_b or field_c must be filled. I am not sure how to proceed with that kind of Yaml logic. I have tried something like below but it seems not to work.
field_d has below conditional logic under field advance tab -
visible:

  ':input[name="field_a"]':
      filled: true

  and

  (
  ':input[name="field_b"]':
      filled: true

  or

  ':input[name="field_c"]':
      filled: true
  )

Thanks.


texts: Where and how does drupal store the node body in drupal 7?

texts:
I am programatically trying to create a custom node to store some content, which I would like to display on a page.
Following is how I am executing it.

    $node = new StdClass();
    $node->name = $value;
    $node->title = $node->name;
    $node->language = LANGUAGE_NONE;
    $node->body[$node->language][0]['value']   = $javascript.$html;
    $node->body[$node->language][0]['summary'] = $type;
    $node->type = "custom_type";
    $node->created = time();
    node_save($node);

I notice that the content I inserted are present in the tables
'field_data_body' and 'field_revision_body'
I try to load the node and get the content

   $query = new EntityFieldQuery();
   $entities = $query->entityCondition('entity_type', 'node')
              ->propertyCondition('type', 'custom_type')
              ->propertyCondition('title', $type)
              ->execute();
   if (!empty($entities['node'])) {
        $node = node_load(array_shift(array_keys($entities['node'])));
        $html = $html.$node->body[$node->language][0]['value'];
   }

But what puzzles me is how from where is the content being loaded. I deleted the entries in both 'field_data_body' and 'field_revision_body', but the content still gets loaded.

So how does drupal7 save and load the contents of the node body?


texts: I want to allow people only with an email ending with a specific format and domain such as foo.bar@mail.school.edu to register for the site that I am building. How can I do this in the Admin Tool Bar?


texts: redirecting legacy URLs to corresponding drupal path

texts:
I'm planning to migrate the content from my existing legacy system to drupal. In process there are a lot of static pages, nodes and taxonomy terms which have hyperlink references to the legacy URLs that cannot be replaced with current URLs due to their sheer magnitude and for which redirects cannot be set manually (i'm using path_redirect module to handle redirects, atleast I intend to).

So my idea of implementing this by redirecting my legacy URLs in my .htaccess to handle them in a custom module where the drupal URL is deduced based on the URL and its params and redirect them. Also add an entry for them with HTTP 301 in path_redirect table so that next request I could check for the entry before proceeding to programmatically determine the node/page URL again. I skimmed the module code which seemed to use hook_init to work the redirections and it seemed feasible in theory, though i'm not sure of the results in practice.

Hence I wish to know if this idea is sensible or if it has some flaws as I'm not an expert in the areas of URL rewriting or SEO. Also I'd request anyone with practical experience on the same to know of any challenges involved in this.This served as a reference before I decided to post my query.


texts: Can Location Modules Geo Code on node save?

texts:
When I save a node that has a Location associated to it, it does not add the Longitude and Latitude values.  When I run the Autofill empty locations path: admin/config/services/la  it fills in all my nodes that have blank Latitude and Longitude values.

Is this normal?  I wish the Longitude and Latitude values get entered as soon as I save.


texts:
I do not really know where to look anymore. I'm using D7 and Drupal Commerce and I would like to display a block using a rendered entity. I created my node--product-display--new-teaser.tpl.php and everything works fine, until I try to load a field from the related product: field_images.
The difference is that in the default version field_images display using an imagezoom, while the new node: new-teaser (that I have created under product display) only display the first image.

What I would like to do, is to render in my node--product-display--new-teaser.tpl.php the field_images coming from the node: new-teaser new product display mode.


texts: Override a feature exported panel variant by adding pane to panel variant programmatically

texts: I have a feature export of a panel variant(node_view_panel_context_ID). My requirement is to add a pane(fielded pane) to panel variant programmatically to the above mentioned feature.


texts: How to determine if a script is started by cron?

texts:
I have a script that run in some cases when some event occur. It also run when cron run (cron.php) or the "Run cron button" from admin panel is clicked.

How can I determine that from script that is started by drupal cron.php?


texts: Exception in worker callback prevents queue item from being removed

texts:
I have created a Drupal 7 module that utilizes hook_cron() and hook_cron_queue_info() to process some data, as well as use the module Ultimate Cron to handle scheduling when each runs.

hook_cron() is run every 15 minutes and it's job is to determine how much data needs to be processed and split it up into batches, creating a queue for each batch. As an example, say 1000 records, split into batches of 25, so you get 40 queues of 25 records each.

The queue is then processed every minute, so every minute it will process one queue item of 25 records.

The problem I am running into is that occasionally during the worker callback for a queue, when processing one or more of the 25 records, a record may result in an exception being thrown.

The exception is possible and expected, so I am handling the exception in a simple try/catch, so the queue is able to continue on and processes all 25 records. However it seems that if any of the 25 had an exception, the queue item does not get removed at the end like it does when there no problems. Ultimate Cron shows the queue as having started, but never finished and is still running (though really it is not, it got through all 25), and this prevents any further queue items from running.

This is not the behavior I would like, I want the queue item to be removed or "finished" regardless if an exception happened, because I have handled the exception(s).

I am unsure of what is deciding the queue should not be removed, is it drupal's queue api? Ultimate cron? Is there a way I can have it remove the queue manually at the end of the batch if there happened to be an exception?

Basic code:

/**
 * Implements hook_cron().
 */
function MODULENAME_cron() {
  MODULENAME_queue();
}

/**
 * Implements hook_cron_queue_info().
 */
function MODULENAME_cron_queue_info() {
  $queues['MODULENAME_queue'] = array(
    'worker callback' => 'MODULENAME_process_batch',
  );

  return $queues;
}

/**
 * Queue up batches.
 */
function MODULENAME_queue() {
  // Get the queue.
  $queue = DrupalQueue::get("MODULENAME_queue");

  // Only run if there are no items in the queue.
  if (!$queue->numberOfItems()) {
    // Get the full list of records.
    $records = MODULENAME_get_records();

    // Split the list of records into batches to process.
    $pager = 25;
    $batches = array_chunk($records, $pager);

    // Queue the batches.
    foreach ($batches as $batch) {
      $queue->createItem($batch);
    }
  }
}

/**
 * Process a batch.
 */
function MODULENAME_process_batch($data, &$context = NULL) {
  // Process a batch of 25 records.
  foreach ($data as $record) {
    MODULENAME_process_record($record);
  }
}

/**
 * Process a single record.
 */
function MODULENAME_process_record($record) {
  // Processing code here, this is where an exception can happen.
}


texts:
I am working on the drupal 8 website, which is presented in 3 different languages. The issue for me is that when the user switches the language on the panel, some parts of the website (block in the sidebar) don't get updated. Does the Drupal 8 Cache store the language? If yes, how can I retrieve it?

I tried to apply the 'Contexts' when I render my block build(), but it doesn't affect anything.

return array(
    '#type' => 'markup',
    '#markup' => $render,
    '#cache' => array(
      'contexts' => ['languages:language_interface'],
      'max-age' => 0
    ),


texts: Is there a way i can import users having profile2 with feeds

texts: I have done user migration using feeds. but i am not able to migrate the profile2 fields with it. Is there a way? am I missing something. I am trying to use migrate module but its tricky. Any help is welcomed.


texts: How to parse current page URL query parameters to create link using l() function

texts:
I have a view in D7 with a few exposed filters.  This view generates a URL/page like this:  example.com/node?location=XXX&check-in=XXX&check-out=XXX&lang=XXX.

I am looking to build a link passing in a couple of the current page's query parameters from above.  I am using the l() function and currently have the following:

print l("link_name","http://www.example.com/path", array('attributes'=>array('target'=>'blank'), 'query'=>array('lang'=>'en', 'currency'=>'USD', 'standardCheckin'=>$view->get_exposed_input(), 'standardCheckout'=>$view->get_exposed_input())));

I am looking to pass in the check-in and check-out parameter values from the views-generated page in to my link function's standardCheckin and standardCheckout keys.  What I currently have obviously does not work.  I'm using the view::get_exposed_input function to pull in the values that are in the exposed filter, but it is pulling in ALL of the query parameters.  This function does not seem to have any query parameters to limit the query.  I also looked at using drupal_parse_url and drupal_get_query_parameters, but can not get those to work either (again, getting all parameters - can not limit to just the two I need).

I can pull the values from either the URL or from the exposed filter.  My PHP is a bit limited, but what is the best function to use (and a nudge syntactically on how to limit the query would be appreciated)?  Or is there a better Drupal method for achieving this?


texts: How display node author roles at node.html.twig

texts:
My user case is:

Extlink module can add exception classes to avoid processing some links.

I want some external url links on nodes whom author belongs to a special role (premium) can be mark with a class (for example with premium role name) to set an exception at external links module.

Well, at node twig template I can render node owner name, using this: {{ node.Owner.name.value }} but I don't know how render author roles.


texts: How to handle a lot of simple unique URLs (for click's statistics)?

texts:
I need to create a lot of simple unique URLs (for click's statistics).
Each such URL consist of several parameters (project_name, unique_ID, etc).

Examples:
example.com/project1_id35 or
example.com/project1/id35 or
project1.example.com/id35 ...

I plan to use Rules to decipher these URLs and to save it to database.

But how Drupal site can catch all such URLs?
It's really hard to make aliases for every case.

May be mod_rewrite can help?
Or is there any useful module for such task?

PS. It seems mod_rewrite the best solution.
PPS. Another possible solution: override 404 page.


texts:
How to create and add .install file for druapl8 custom form data storage...my file is custom_form.install but my custom module not load this file

<?php
/**
* Implemetation of hook_schema()
*/
function custom_form_schema() {
$schema=array();
  $schema['custom_form'] = array(
       'description' => 'An example form table',
    'fields' => array(
      'fe_id' => array(
        'description' => 'The primary identifier for a form.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),

      'firstName' => array(
        'description' => 'A field storing text',
        'type' => 'text',
        'length' => 50,
        'not null' => TRUE,

      ),
'lastName' => array(
        'description' => 'A field storing text',
        'type' => 'text',
        'length' => 50,
        'not null' => TRUE,

             ),

'emailId' => array(

        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,

             ),

'pass' => array(
                'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,

      ),

'likes' => array(
       'description' => 'A field storing Likes',
        'type' => 'text',
        'length' => 200,
        'not null' => TRUE,

      ),

'gender' => array(
        'description' => 'A field storing Gender',
        'type' => 'text',
        'length' => 50,
        'not null' => TRUE,

      ),

'description' => array(
        'description' => 'A field storing Description',
        'type' => 'text',
        'length' => 255,
        'not null' => TRUE,

      ),

),

     'primary key' => array('fe_id'),
  );
  return $schema;
}
?>


texts:
I struggled a long time with Drupal in order to get my page to load with SSL. I ended up getting it to work my modifying settings.php:

/**
 * Base URL (optional).
 *
 * If Drupal is generating incorrect URLs on your site, which could
 * be in HTML headers (links to CSS and JS files) or visible links on pages
 * (such as in menus), uncomment the Base URL statement below (remove the
 * leading hash sign) and fill in the absolute URL to your Drupal installation.
 *
 * You might also want to force users to use a given domain.
 * See the .htaccess file for more information.
 *
 * Examples:
 *   $base_url = 'http://www.example.com';
 *   $base_url = 'http://www.example.com:8888';
 *   $base_url = 'http://www.example.com/drupal';
 *   $base_url = 'https://www.example.com:8888/drupal';
 *
 * It is not allowed to have a trailing slash; Drupal will add it
 * for you.
 */
 $base_url = 'https://www. ... .com';  // NO trailing slash!

But now I am faced with an entirely new issue, one related to the changes I made in setting.php.

Now, when I try to reach my page internally by 192.168.1.x/?q=user, I get a terribly messed up login page, and after entering my login information, I get redirected to a page that shows nothing but "SSL connection error".

What have I done!? Will this ever work?


texts:
The configuration export feature of Drupal 8 would seem to be a very useful feature. However, I'm not sure I completely understand how it works.

For example, if I do a single export, choose "Content type" then select one of my content types, I would expect that export to contain a full description of that content type. But it doesn't contain any information about the fields in that content type. So if you wanted to export a content type configuration for use on another site, it doesn't seem possible to do that.

I'm not sure I understand the use of being to do Single exports if they don't contain all the required data for an entity. Am I missing something?


texts: Get a calculated price from Product Variation

texts:
I created a promotion with offer type - Fixed amount off each matching product and applies to - Specific product. In my custom block I get the product entity and try to get the calculated price via commerce_order.price_calculator service.

commercePriceCalc = \Drupal::service('commerce_order.price_calculator');
$context = new Context(\Drupal::entityTypeManager()->getStorage('user')->load(1),
                     \Drupal::entityTypeManager()->getStorage('commerce_store')->load(1));
$prices = $commercePriceCalc->calculate($slide->field_product->entity, 1, $context);

So, calculate method returns me a PriceCalculatorResult object with 2 properties, calculatedPrice and basePrice but they are identical.

PriceCalculatorResult {#3311 ▼
  #calculatedPrice: Price {#3310 ▼
    #number: "1000.000000"
    #currencyCode: "UAH"
  }
  #basePrice: Price {#3310 ▼
    #number: "1000.000000"
    #currencyCode: "UAH"
  }
  #adjustments: []
}

As if the discount didn't apply.


texts: Is there a module for Drupal that can be used for job postings, with specific access limited to people from HR / system admin?


texts: How to inculde 3d parrty libraries into your module?

texts:
I am using the 3d party php library, and I do not know how to connect. The file structure of my project looks like following:

-my_project
--src
---Plugin
----Action
-----MyAction.php
---libs
----mylibs
-----src
------ClassWhichINeed.php

--my_project.info.yml

So I need to connect ClassWhichINeed.php to MyAction.php.
In ClassWhichINeed.php I specified namespace as Drupal\my_project\mylibs;

And in MyAction.php i use Drupal\my_project\mylibs;

But when I create
$object = new ClassWhichINeed;

I get an error "Undefiened class"


texts: How to optimize this query generated from a View?

texts:
In a D6 site, I log queries and get this monster frequently in the MySQL slow query log:

  Query_time: 13.817393  Lock_time: 0.000261  Rows_sent: 1  Rows_examined: 3655810 SET timestamp=1366964215;

SELECT COUNT(*)
  FROM (SELECT DISTINCT(node.nid) AS nid,
               node.title AS node_title,
               node.language AS node_language,
               votingapi_vote_node.value AS votingapi_vote_node_value,
               node_counter.totalcount AS node_counter_totalcount,
               term_data.name AS term_data_name,
               term_data.vid AS term_data_vid,
               term_data.tid AS term_data_tid,
               comments.timestamp AS comments_timestamp
          FROM node node
    INNER JOIN votingapi_vote votingapi_vote_node ON node.nid = votingapi_vote_node.content_id AND votingapi_vote_node.content_type = 'node'
     LEFT JOIN node_counter node_counter ON node.nid = node_counter.nid
     LEFT JOIN term_node term_node ON node.vid = term_node.vid
     LEFT JOIN term_data term_data ON term_node.tid = term_data.tid
     LEFT JOIN comments comments ON node.nid = comments.nid
    INNER JOIN node_access na ON na.nid = node.nid
         WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_pub lic')))
           AND (node.type in ('photo'))
      GROUP BY nid
      ORDER BY comments_timestamp DESC) count_alias;

This isn't custom query; it is coming from one of my Views.

I am wondering how can I optimize it? What index(es) should I generate?


texts: Is it possible to display views result counter as a field in a node?

texts:
Using D7 and the latest DS and Views modules, is it possible to display the node position in a view (view result counter) inside the node full view display?
I'm ordering views items based on rating and I need to get every node's position in the view as a field in my nodes.
How can I achieve that?
thanks


texts:
I created a custom node template in order to change what fields are generated.

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

        ?>

The above php code renders the following html:

 lindamanual.pdf

The problem is I only want the href to be rendered (not the image and the outer div). How can I do this?


texts: How can I use file field label as clickable download link or replace field discription (file title)?

texts:
I created a file field that's have it's own desired label and should display in a node content; I'm using 'generic files' setting to display it; the problem is that this file has really ugly names like '102-32.exe' and I'd like to change the name of it to 'File field label'.

For example:

  File field Label: 102-32.exe Change to below (Automatic download field):
  File field Label


texts: Maintenance mode doesn't work on front page without www prefix

texts:
I have my site in sub directory and it works both with and without www prefix but when I place it in maintenance mode I've noticed it doesn't work for the front page without www prefix until you either try log in or go to another linked page.

Is there anyway I can fix it so it works on that front page when no www prefix?


texts: I need help implementing an ajax block to prevent it from being cached by Boost module

texts:
I have a website fully cached through boost module with a region where a block is displayed. In this block content is shown via views and the display order in the view is set to random. So far so good. This works fine when logged in. But for guest users only the first block content that hits the cache is shown.

I found a snippet on drupalgroups that should do the trick, an "ajaxified block".

This is the snippet for blocka.php

<?php
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

$block = module_invoke('statistics', 'block', 'view', 0);
print $block['content'];
?>

And this should go in a block:

<div id="info">
</div>
<script>
$('#info').load('/blocka.php');
</script>

To test this I created the "ablock.php" and put it in the root directory and also made a block with the code.

Firebug tells me that the block is there, but it doesn't show any statistic.

How can i debug this to find out, if the blocka.php is loaded?
How do i have to customize this line for my needs? In fact, i do not understand this line...

$block = module_invoke('statistics', 'block', 'view', 0);

Thanks for any advice.


texts: How to display content type field values in tab panel format?

texts: I have created custom content type. I want to display it's data (field values) in tab panel format. is there any way to change it through CSS?


texts:
I am working with Drupal 8.5-x, I am trying to render HTML with bootstrap classes, but I am having trouble. Here is my problem:

I have highlighted (region) and content (region). I am trying to add a
 with highlighted region but to no avail.

I have:

{# Highlighted #}
  {%
    set highlighted_classes = [
      page.sidebar_first and page.sidebar_second ? 'col-sm-6',
      page.sidebar_first and page.sidebar_second is empty ? 'col-sm-9 col-md-8',
      page.sidebar_second and page.sidebar_first is empty ? 'col-sm-12',
      page.sidebar_first is empty and page.sidebar_second is empty ? 'col-sm-12'
    ]
  %}

{# Content #}
  {%
    set content_classes = [
      page.sidebar_first and page.sidebar_second ? 'col-sm-6',
      page.sidebar_first and page.sidebar_second is empty ? 'col-sm-12 col-md-12',
      page.sidebar_second and page.sidebar_first is empty ? 'col-sm-12',
      page.sidebar_first is empty and page.sidebar_second is empty ? 'col-sm-12'
    ]
  %}

when rendered, I get

but I was expecting

I am lost as to where I could have gone wrong.
My info file is as follows:

    regions:
  navigation: 'Navigation'
  navigation_collapsible: 'Navigation (Collapsible)'
  header: 'Top Bar'
  highlighted: 'Highlighted'
  help: 'Help'
  content: 'Content'
  sidebar_first: 'Primary'
  sidebar_second: 'Secondary'
  footer_first: 'First Footer'
  footer_second: 'Second Footer'
  footer_third: 'Third Footer'
  footer_fourth: 'Fourth Footer'
  footer_fifth: 'Fifth Footer'
  page_top: 'Page top'
  page_bottom: 'Page bottom'

Any help?


texts: how to migrate a multi-value term reference field?

texts:
I am setting up a drupal migration where the destination node contains a multi-value taxonomy term_reference field, called 'field_features'. The machine name of the drupal taxonomy vocabulary of the field is called 'voc_features'.

My field mapping for this field is configured like this:

$this->addFieldMapping('field_features:create_term')->defaultValue(true);
$this->addFieldMapping('field_features:ignore_case')->defaultValue(true);

//i don't have tid's in the source, so i leave the source_type for what it is
$this->addUnmigratedDestinations(array('field_features:source_type'));

//i link the drupal vocabulary to the multivalue field.
$this->addFieldMapping('voc_features', 'field_features')->separator('|');

The terms are added in the 'voc_features' vocabulary, but not in the 'field_features' field.

When i add the field mapping like i do with all the other fields:

//my source fields have the same name as my destination fields
$this->addFieldMapping('field_features', 'field_features')->separator('|');

i get the following error:

strtolower() expects parameter 1 to be string, array given File ...\sites\all\modules\migrate\plugins\destinations\fields.inc, line 402

Other single value term_reference fields import just fine.
What am i missing?


texts:
I would like to be able to trap when a particular message is sent via drupal_set_message like:
"•Article john mitchell article800 has been reverted back to the revision from Tue, 05/28/2013 - 10:03."
After the message is sent that matches my criteria then I would like to send an email.
I know how to send emails within hooks/php but I need to know how to trap for a particular message so that I know to send this email.
Are their any hooks that could use to trap for this occurrence?


texts: I have added many content to content type story. How will I link to the page that shows all the nodes with their teaser? What will the link be?


texts: Programmatically created form not displaying form_set_error feedback

texts:
I've seen plenty of people ask a similar question but none of them are doing what I'm doing.

I have form function in my theme (mytheme_whatever_form()) with validation and submission handlers. I then put a placeholder in the body of a page like |my-placeholder| and a module I created there is a hook that parses the body of a node for anything with the pattern |whatever| and replaces hyphens with underscores and prefixes it with the theme name and executes that function if it exists (so it would execute mytheme_my_placeholder() from my example).

Inside mytheme_my_placeholder() I am rendering the output of mytheme_whatever_form() to place the form on my page.

When doing it this way I get the form on the page like I want and the validation and submission handlers work but no form_set_error or drupal_set_message calls return messages.

I can call whatever functions I want in the handlers and they execute as expected, except for anything that generates a status/error message.

This is very likely due to the way I'm loading the form but I can't find a good reason for it. form_set_error and drupal_set_message should both put a message into the system that is displayed via the page template and shouldn't care one bit what I'm doing with any other content on the page.

What am I overlooking and how can I get this to work?


texts: Purging session data on devel user switch

texts:
If you have used the devel module, you'd probably know about the nifty Switch user tool that is available as a block for use in a site. It allows users with the required permission to switch from the block as any other user.

This is the API doc for the devel_switch_user method.

I notice that while switching between users, the session ID of the user as whom you initially logged in to the Drupal site for the first time is re-used for all switched users i.e. In {sessions}, the uid column is simply changed while {sessions}.sid or {sessions}.ssid persists.

A problem with this approach is that the session data ({sessions}.data) (saved using the $_SESSION superglobal) remains the same even for switched users which isn't good to test the application logic sometimes (at least not in my case).

Is there an elegant way to clear the session data of the old user on switch? If not, how can this be solved?


texts:
Long story short: I'm looking for a way to provide translations... the "hard" way. So I don't want to click in the backend to apply new translations or translate it on the "Translate Interface" Page.

I really want to provide it hard coded, and when it's changed, it should get changed in the backend as well.


texts: How to use Interface Translation for specific text on specific pages only

texts:
I need to translate certain text in a twig template to one of several languages, depending on the Language selected for the node being displayed. I've installed the Interface Translation module (without translation files because I don't want the interface translated) and added custom translations for the text I want translated. This works perfectly using {{ "text to translate"|t }} in the template.

Here's the problem: When I'm at a page like "/es/node/50" (Spanish), Drupal "shifts to /es mode" by adding /es to menu entries, admin links, etc. I assume this is expected, but I don't want it. I simply want to use Drupal's built-in translation capability (via |t) to translate things I specify. I don't want any other pages to get an /es prefix.

I want to select a language for a node and then have translation capacity for that node's template only, without affecting anything else in the site.

Is this simply outside the use case for the Interface Translation module? Or is there a combination of modules/settings to make it possible?

I've fiddled with this for hours (days) and have read documentation and many posts without success.


texts: Send email to specific users when Webform submitted

texts:
How can I send emails to specific user roles when a specific Webform is submitted?

For example if a Webform named test is submitted then we have to send email to all users having the role say 'editor'.


texts:
I migrated my site to the production  server about 3 months ago . 2 weeks ago , I noticed that the db was growing too fast(about 40Gb I could not account for) I backed the site , deleted WAMP and restored the site .

Result , slower until within the 2 weeks ,it has grown to a halt . Keeps on "connecting ".
One other thing( could be related ) the site counter is showing a growth of about 1,000 users anonymous users very hour - this is not possible given the site is either too slow or not working at all outside the LAN


texts: Alter The User Login Form Into Multi Steps

texts:
I want to alter my default user login form into multi step. therefore I have wrote a code which I'm pasting below. but this code is not working, whenever I click on "Next" button it will return on the first step. please help me to get rid out of this problem.
Here is my code:

function signin_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_login' || $form_id == 'user_login_block') {
    unset($form['name']);
    unset($form['pass']);
    unset($form['actions']);
    $form['mail'] = [
      '#title'       => t('Email'),
      '#description' => t('Enter your Email'),
      '#type'        => 'textfield',
      '#required'    => 'true',
      '#maxlength'   => 40,
    ];
    $form['next'] = [
      '#name'   => 'next',
      '#value'  => t('Next'),
      '#type'   => 'submit',
      '#submit' => ['signin_step1_form_submit'],
    ];
    $form['#validate'] = ['signin_step1_form_validate'];
  }
}

function signin_step1_form_validate($form, &$form_state) {
  $mail = $form_state['values']['mail'];
  if (empty(user_load_by_mail($mail))) {
    drupal_set_message(t('The entered email is not associated with any account.'));
  }
}

function signin_step1_form_submit($form, $form_state) {
  $form_state['stored_values']['mail'] = $form_state['values']['mail'];
  return signin_step2_form($form, $form_state);
}

function signin_step2_form($form, &$form_state) {
  $form['pass'] = [
    '#title'       => t('Password'),
    '#description' => t('Enter the password'),
    '#type'        => 'password',
    #required' => 'true',
  ];
  $form['signin'] = [
    '#name'   => 'signin',
    '#value'  => t('SignIn'),
    '#type'   => 'submit',
    '#submit' => ['signin_step2_form_submit'],
  ];
  $form['#validate'] = ['signin_step2_form_validate'];
}

function signin_step2_form_validate($form, &$form_state) {
  $mail = $form_state['stored_values']['mail'];
  $user_obj = user_load_by_mail($mail);
  $name = $user_obj->name;
  $pass = $form_state['values']['pass'];
  if (!user_authenticate($name, $pass)) {
    drupal_set_message('error', t('The Password you entered is incorrect'));
  }
}

function signin_step2_form_submit($form, &$form_state) {
  $mail = $form_state['stored_values']['mail'];
  $user_obj = user_load_by_mail($mail);
  $form_state['uid'] = $user_obj->uid;
  user_login_submit($form, $form_state);
}


texts: How do I add a customized parameter to image links

texts:
Lets say I have image fields in my node. When I get that fields values in the twig it returns the image URL without any issue.

file_url(node.field_image.entity.uri.value)

But now I want to add a specific parameter (lets say ?param=0) to the end of that link. Without hard coding the parameter in the twig file is there a way to write a hook that adds that parameter for all the image links in every node. So if I have to change the param I only need to change it from one place.


texts: How to filter a view to show current month

texts:
I am building a Church Management System. I have a contact type for individuals. One field they have is D.O.B. which is a date popup field.

I want to create a block that lists people and their D.O.B. and have it filtered to only show those whose birthdays are in the current month.

I created the block and have it showing the people and their D.O.B. but how do I get it to filter to show only the people in current month?

Thanks


texts:
I'm forced to build a site on IIS-based hosting. I have a problem with different image styles (thumbnails etc.) not being generated when uploading an image using image field on a node. The original image gets uploaded and works normally, but other styles don't. To clarify - Drupal gives me a permission error (not allowed to view this page), but the image also doesn't appear on the server, I checked via FTP.

I found Image styles not generated with Drupal 7 on IIS 6 which seemed like a very similar issue, but provided solutions did not help.


texts:
I had setup my new articles directory site in Drupal 6.2 2-3 months back. You can see the article directory taxonomy in the menu block in the left side bar.
There are 26 categories in total like "Financial services, Food & Bevereges" etc. And each category has sub categories.

The problem is that frequently some categories or sub categories get automatically unchecked in the article directory menu bar. So I need to regularly count them and check them on if unchecked.

For example today I found automatically unchecked as shown in the following image which is screen shot at the path: admin/build/menu-customize/menu-articledirectory:

I'm wondering why this could be happening. Any idea?


texts: When should "'target' => 'slave'" be used in a query?

texts:
Looking at Drupal code, I notice that sometimes a query is being executed using array('target' => 'slave') as options, and I don't understand in which case that should be done.

I thought it was done when query where executed in parallel to others, but then I thought that could be said for almost any query executed by Drupal, when more than one user is looking at the pages of a site.
In which cases should array('target' => 'slave') be used?

  // node_update_index()
  $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit, array(), array('target' => 'slave'));

// search_index()
$node = db_query('SELECT title, nid, vid FROM {node} WHERE nid = :nid', array(':nid' => $linknid), array('target' => 'slave'))->fetchObject();

Also, looking at Drupal core code, why is array('target' => 'slave') sometimes used, and sometimes no?


texts: How to correctly denormalize a node with paragraph fields

texts:
I am trying to programmatically move some content from one site to another using normalizers from the relaxed module. So far it's working great but when I am trying to deserialize paragraphs entities prior to deserializing their parent nodes they get new revision ids (probably because I am using the multiversion module) rendering the target_revision_id key in the serialized parent node array useless.

Is there a way to save the deserialized paragraph items without changing their revision id?

This is how each deserialized paragraph is saved:

$entity->enforceIsNew(TRUE);
$entity->setNewRevision(FALSE);
$entity->save();

I believe the multiversion module I am using is the reason I get a new revision id. Any ideas? Do I need to change the revision_id value directly in the database?


texts: ubercart 2 views - filter by order total weight

texts:
I use Ubercart 2 with Ubercart Views. I'd like to filter orders based on total weight.

It's possible to add total weight as a field, however it is not possible to add this field as a filter. I tried Views PHP Filter using $row->weight but this filter is not picked up (it filters $row->title ok). How can I filter by total weight?


texts: embed private drupal content (view) at an external site

texts:
this is my situation:
I have a calendar view that displays events, some of them are public and some others are private, I managed to create a view that I can embed at an external site, but this works only for public events, so I'm looking for a way of making the private events be visible also, at the external site you have to log in to see this embeded view from drupal, but those users do not belong to drupal data base, so I was thinking of create a generic user able to see the private content in drupal, so at the external site code this user some way to show the private content at the external site, I hope I'm clear enough.

I've been looking for moduls to do this, but the only thing I found was for D6 and I'm not pretty sure it was the answer to my need.

Thanks.


texts: Custom Fields Widgets with Dynamic Forms

texts:
In Customs Field, We always use element as a Form element

but some code isn't the same. i am a little confused!

the code below can work at Form but not at the Field Widget

function mycustomfield_field_widget_form(&$form,&$form_state,$field,$instance,$langcode,$items,$delta,$element)
{
    $base=$element;

    $element['toggle_me']=array(
         '#type' => 'checkbox',
         '#title' => t('Tick this box to type'),

    )+$base;

    $element['settings']=array(
         '#type' => 'textfield',
        '#states' => array(
         // Only show this field when the 'toggle_me' checkbox is enabled.
          'visible' => array(
         ':input[name="toggle_me"]' => array('checked' => TRUE),
    ),
  ),)+$base;
return $element;
}

i don't know why the settings textfield showed even if the checkbox doesn't check?

Thx for reading My Question!

I appreciate that!


texts: Where do you edit the css of a basic bootstrap theme in Drupal 7?

texts:
I've download the latest release of the original Bootstrap theme for Drupal 7, and Installed it, and yet it is unclear to me where could I change it's css?

I need to RTLize the template, i.e make it RTL instead of the default LTR, and for this I need to flip some properties in the template's Style.css file (or whatever main css file) of this template as I did in the past with almost any other template...

I tired to search a bit in the theme's folder and just couldn't find such file... The following image display my navigation (at least the most logical part of it):


texts: Custom module with custom node type, error Trying to get property of non-object en comment_node_type_delete()

texts:
I'm quite new with Drupal 7 development, after researching and following some tutorials I was able to create my custom module that defines a new node type with some fields, but now I have a problem when I uninstall it, the hook_uninstall runs almost fine(the node type, the contents from my custom node, and the node fields), except that display this error after the uninstall:

  Notice: Trying to get property of non-object en
  comment_node_type_delete() (línea 344 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module). Notice:
  Trying to get property of non-object en comment_node_type_delete()
  (línea 355 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module). Notice:
  Trying to get property of non-object en comment_node_type_delete()
  (línea 355 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module). Notice:
  Trying to get property of non-object en comment_node_type_delete()
  (línea 355 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module). Notice:
  Trying to get property of non-object en comment_node_type_delete()
  (línea 355 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module). Notice:
  Trying to get property of non-object en comment_node_type_delete()
  (línea 355 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module). Notice:
  Trying to get property of non-object en comment_node_type_delete()
  (línea 355 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module). Notice:
  Trying to get property of non-object en comment_node_type_delete()
  (línea 355 de
  /opt/lampp/htdocs/drupal/modules/comment/comment.module).

This is from mymodule.install:

function mynode_uninstall() {

    $ournewtype = 'mynode';
    $sql = 'SELECT nid FROM {node} n WHERE n.type = :type';
    $result = db_query($sql, array(':type' => $ournewtype));
    $nodeids = array();
    foreach ($result as $row) {
        $nodeids[] = $row->nid;
    }
    node_delete_multiple($nodeids);
    node_type_delete($ournewtype);
    field_purge_batch(500);
    drupal_flush_all_caches();
}


texts: Is there a Drupal Wiki documentation site?

texts:
Like on other Drupal support sites, there are many questions and very few answers here.  The community appears to divide into two Drupal groups, coders and users.  I am a user trying to make a website out of the tools available, not invent a new module.

One problem here is that a question quickly gets lost and answers harder to find. I am finding parts of answers at various sites and would be happy to contribute them to a central depository.  Anyone know where that might be?

Added Related Question:
I see a checkbox below the answers box for a Community Wiki. Does this option tag items for use in a Wiki about Drupal?  If so, How do I filter to see them?


texts: How do I count multifield for body of block?

texts:
So I have a custom template for the custom block and I can print each one using the following code.

Body 1: {{content.body.0}}
Body 2: {{content.body.1}}

I need to know how many there are. I tried a whole bunch of variations of {{ content.body | length }} or {{ content.body.getvalue | length }} but nothing is working.

My goal is to add responsive grid support depending on how many bodies there are. How can I achieve this?


texts: How to create permission to allow access to an admin form?

texts:
We have created a custom permissions that we want to use to prevent unauthorized access to an admin form. Only someone with "administer admin_form" should have access to the page. There is a menu link that was created to allow access to the page.

How can I create a controller that will check if the user has the permission and hide the menu link if the user does not have the permission? If somehow they got access to the menu link path, we would also like to display a message "you do not have access to this page" and hide the form.

We have tried the following:

mymodule.permissions.yml

administer admin_form:
  title: 'Administer admin form'
  description: 'Allows the ability to change settings'
  restrict access: true

mymodule.links.menu.yml

mymodule.settings:
  route_name: mymodule.settings
  title: 'My module'
  description: 'some message'
  weight: 99

mymodule.routing.yml

mymodule.settings:
  path: /admin/config/user-interface/admin-form
  defaults:
    _title: 'My module setting'
    _form: \Drupal\mymodule\form\AdminForm
  requirements:
    _permission: 'administer admin_form'


texts: How can I set a default node owner for anonymous nodes on the node edit form?

texts:
This question is refining the poorly asked Is there any easy way to set the default author for a node being edited to the current author if it is currently anonymous?

The site I'm working on has a lot of Anonymous nodes because it is a migration from a system that didn't have a proper user system.  Users can claim their articles (they have permission via the override node options module) by going in and editing the node and changing the system author.

I'd like the default value on the edit form for node owner to be the current user for non-admin users who are editing a node that was not owned by anyone previously.  I'm sure it must be imminently doable through some form alter or form preprocess hook, but I don't quite get the drupal form system yet.  Solutions and pointers to good sources of information both welcome.  My ulterior motive in this question is to learn more about how to use hook_form_alter to change the values of fields on the form, and particularly the owner field, so answers related to that are preferred.


texts: I have a custom content type that contains a Link field. I want to add a Meta refresh to every page of that content type that will redirect to the contents of the link field after a fixed number of seconds. (I also have a link/button that will open the target of the link, but I want to redirect automatically after a few seconds as well.) I am a bit confused about the number of meta modules available - which module or combination of modules can be used to achieve this, preferably without hacking any of the core or additional modules?


texts: How do I send user credentials and get the access token?

texts:
I am linking a Drupal site to an Android application. With the help of the Simple OAuth module, users will log in to my android app using their Drupal site credentials.

I understand that once the client application has the access token, it can be  included in the headers of any GET request to fetch JSON content from Drupal. I also know that https://example.com//simple-oauth/refresh will give a new access token, having the refresh token.

What should I do if both access and the refresh tokens are already expired?
How do I get them from scratch?
What is the URL to ask for the token, and how do I include the credentials with that via HTTP headers or in the URL?

Is there something I'm not aware of about this way of authenticating?


texts: Creating a node via REST - Entity reference field value not updating

texts:
I'm trying to create a node on a Drupal 8 site via REST. Passing all the values to create the fields work fine apart from the field that is an entity reference field. The field is an entity reference to Drupal users. Drupal creates the node, there is no validations errors, but the entity reference field has no value. I've tried changing 'target_id' to 'value', same thing, the node gets created without errors but no value is given to the user entity reference field.

Any ideas?

$serialized_entity = json_encode([
    'title' => array(
      'value' => 'some_title',
    ),
    'type' => array(
      'target_id' => 'node_type',
    ),
    '_links' => array(
      'type' => array(
        'href' => $base_url . '/rest/type/node/node_type',
      ),
    ),
    'entity_reference_field' => array(
      'target_id' => $entity_id, // This does not work. Using a valid uid.
    ),
    'normal_field' => array(
      'value' => 'some_data',
    ),
]);


texts:
I was creating my first project with drupal and now my problem was the request new password since this is a link and i want to make it into buttons so i generate my hook_form_alter but i got a problem with the url i'm not sure if markup is working.

Here my code for form_alter:

  $form['actions']['request'] = array(
'#markup' => l(t('Forgot Password?'), 'user/password', array('attributes' => array('class' => 'form-request','title' => t('Request a new generated password via e-mails.')))),'#weight' => 2, '#type' => 'button' );

I'm not sure if this is correct. Thanks for the help folks!


texts: How Generate Configure button ? (Module Page)

texts:
What hook or how do I generate the configure button in the module page?

I'm trying to have the operation button that user click on the module page to take them to the configuration page.

If someone can provide me good resource or an example I will appreciated.

Here is an example of what I'm trying to generated.


texts:
I am writing a module, and am confused about the term's URLs. because, if pathauto moduel is installed, then the alias of that module should be provided. How to achieve this?

Default drupal's URL: taxonomy/term/30
Pathauto's probable pattern:

category/30
category/[title]
category/[title]/[id]
...and millions of other possible patte

Using drupal_get_path_alias() returns drupal's default path.

How should I get the path used by pathauto? I have seen pathauto's module,
but it does not provide an API for this purpose as it seems.


texts: How to replace node tabs with jQuery ones

texts: I use Drupal 6 and the content profile module in order to create user profiles for my site users. Also i use panels 3 module in order to make a blog page with path /user/%user/blog for every user attached as a menu tab in each one profile page. Now i want to ask if there is a way to replace node tabs as "Home" "Edit" and "Blog" with jQuery ones. Thanks in advance.


texts:
I am facing a session cookie hijacking vulnerability please refer the attached

  image. When i put these cookie in another browser which i simply type
  the domain like http://example.com and add the copy cookie using the
  extension then simply i change the url to example.com/dashboard
  then user dashboard automatically open just because of copy cookie
  all have the same label only value is different.


texts: How can I roll the database back to the backup

texts: I have a problem with a module the site functions but  I need to roll the database back to the backup I took before deploying the module. How can I do that?I am using D8


texts: source code shows proper img tag from $row output, but no actual image in browser

texts:
In my tpl file that has custom code for a block view, I have an object $perfomer which I use to display it's picture with custom code. So I've written code as follows:

    <?php $picture = file_load($performer->field_performer_foto['und'][0]['fid']);  ?>
    <?php $realpicture = file_create_url($picture->uri); ?>
 <?php  print ''; ?>

So like the title of my question says, in my source code I get a proper img tag that looks like this:

To test this, I pasted this html into a Page, and the picture showed just fine on that page. However, in the block view for which the mentioned tpl file is coded, there is no picture shown in the browser, only a square box of 120px by 120px with the alt value inside of it.


texts: I created a new content element: how do I print it out?

texts:
I created a new content element for the page content type.
How would I print out the content of that text area in page.tpl.php?


texts: Using hook_form_alter to add a label/placeholder insider a form  tag

texts:
using Drupal Commerce checkout form there is a default 'address' field (it's dynamic and includes several fields in one that are not easy to separate - such as country, name, address 1 and 2, state, etc.). I turned off the labels for the address field because they are ugly and I'd like to put the labels INSIDE each  tag, as you would normally do with html like so:

HTML 5:

<input type="text" name="user" placeholder="Username">

Where the 'placeholder' property shows what should be entered into the field within the  tag, thus removing the need to have a separate label at all.

Anyone know how to do this (include a placeholder property if you will) with hook_form_alter?


texts: Calculate the greater of two values in Rules?

texts: I'm trying to set up a rule which sets a CCK field to the greater of two other CCK fields, but calculate a value only has +-*. How do I figure out the greater of two values?


texts:
I am a total Drupal newbie so need advice.

I installed a new module commerce_shipping_postal_code_weight-7.x-1.x-dev, and tried to activate it. I was then advised a couple of other modules needed authorising. I authorised everything and then returned to my home screen.
My left hand column had disappeared which contained my login box, my stock file has disappeared, and so has my admin toolbar.
Logging in using /?q=user doesn't reveal the toolbar, but I am logged in.
I've restored all my files from 24 hours ago with no joy and now am waiting for our ISP to send me a backup database.
The only error message I get is :-

    Notice: Undefined index: search_api_views_fulltext in
 views_handler_filter->accept_exposed_input() (line 1273 of
 /homepages/11/d95668464/htdocs/drupaltest/profiles/commerce_kickstart/modules/contrib/views/handlers/views_handler_filter.inc).
 Notice: Undefined index: table in
 entity_views_plugin_row_entity_view->init() (line 20 of
 /homepages/11/d95668464/htdocs/drupaltest/profiles/commerce_kickstart/modules/contrib/entity/views/plugins/entity_views_plugin_row_entity_view.inc).

I had only downloaded and enabled the modules, and they had not been used so I have no idea of how I could have prevented it.


texts:
For Drupal 8 webform, I see there's a way to specify custom email recipients based on a Select component. But I don't see a Taxonomy term reference as an option in the email handler. Is there a way to set that up in the UI? Using the UI would be ideal to let other form maintainers update the emails as needed. A taxonomy term reference is needed to also use Webform Permissions by Term.

Alternatively, if a select component was made using matching term keys, and the taxonomy term component was set to hidden/private, could the term component be populated with the select component? In that way, I could use the email handler with the select list and still use Webform Permissions by Term.


texts: How do I find the role id from role name?

texts:
On log in I want to check a third party data source (table in the db) for a user, and if found I want to add a role to that user.

I don't want to guess the rid of the role, I want to get it from the role name.


texts: Where does Drupal save the trim length for the body field?

texts:
When I navigate to Manage display for any node type that has a standard body field and click on the Teaser tab the default format will be "Summary or trimmed". The default trim length is 600 (characters), but you can change it to whatever you want and Save the new value.

However, I want to know where (i.e. in which table or variable) this value is saved.

(I need this information in order to find out what trim length to use when comments are emailed to users that subscribe to comment notifications. The project specification requests comment notifications to be trimmed to same length as the content type they're attached to.)


texts:
I made a module, and defined my custom entity there. I set the path for the administrative page using the following array.

'admin ui' => array(
  'path' => 'admin/structure/optimizations',
)

How can I get the edit path for one instance of my entity, for example admin/structure/optimizations/manage/2?

I don't think its a good idea to hard-code the path as with  'admin/structure/optimizations/manage' . $entity->id.
Is there any function to get the edit path for an entity?


texts: How do I do an if conditional based on a view in template.php

texts:
Related to this question: Adding a body ID to a view page

How do I add a conditional based on whether a page is a view or not? I'm not sure how to test for whether a page is a view.


texts: How to get a form field to allow additional values?

texts:
I need to have a way to allow for multiple values to be used for a field.

For example,

Someone has school name(s), and the form description says, "Add your schools here."

I add a school, press a button for an additional, another text field appears, etc.

I know I have seen this before, but I cannot seem to find it anywhere.  How do I do this?

I thought it might be this module(s):

https://www.drupal.org/project/field_collection

https://www.drupal.org/project/webform_addmore

How to add additional "items" on a webform in Drupal 7

But I'm not sure.  I thought it was built into Drupal webforms.


texts: D8: Cannot redirect user at onKernelRequest event

texts:
I want to redirect the user at "onKernelRequest" event and I have this method:

  public function onKernelRequest($event) {
    // Restricts access to nodes (views/edit).
    if (!empty($event->getRequest()->attributes->get('node'))) {
      $nid = $event->getRequest()->attributes->get('node')->get('nid')->getValue()['0']['value'];
      if (!$this->accessCheckService->canUserAccessByNodeId($nid)) {
        $response = new RedirectResponse('/access-restricted-by-taxonomy-term');
        $response->send();
        return;
      }
    }

The response is being sent, but the user is not redirected to the given address (access-restricted-by-taxonomy-term). It seems that RedirectResponse takes no action at onKernelRequest event. How can I fix this?


texts:
I'm trying to change the submit button text "Save and keep published", but with no luck. I'm using the standard hook_form_FORM_ID_alter().

function mymodule_form_node_news_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  // This is the problem, what should I put here
  $form['actions']['publish']['#value'] == '';
}

This is what dpm() returns.

'publish' => array(7)
  '#value' => object Drupal\Core\StringTranslation\TranslatableMarkup(5)
    protected string -> string(18) "Save and keep published"
    protected translatedMarkup -> NULL
    protected options -> array(0)
    protected stringTranslation -> NULL
    protected arguments -> array(0)

How do I change text on the submission button in the node form?


texts: Why is my Strongarm feature immediately overridden?

texts:
I am using features to save a content type.  Here are the fields that my new feature contains:

body  field_product_site_id  field_product_repair_price  field_product_manufacturer  field_product_description  field_product_terms  field_product_url  field_product_model  field_assigned_to  field_role_designater

node-product-body  node-product-field_product_description  node-product-field_product_manufacturer  node-product-field_product_model  node-product-field_product_repair_price  node-product-field_product_site_id  node-product-field_product_terms  node-product-field_product_url  node-user_role_marker-field_assigned_to  node-user_role_marker-field_role_designater

I decided to add the Strongarm module to capture additional fields (and hopefully save the field order/weights of my content types.)  The strongarm module added a few new variables to the list:

 field_bundle_settings_node__product  menu_options_product  menu_parent_product  node_options_product  node_preview_product  node_submitted_product

After recreating the feature, I discovered that it had become overridden.  As I understand it, features are only overridden if the data stored within it is difference that the data stored in the database.  How can this feature be overridden as soon as it is created?

Edit =========================================

The feature now seems to be in the Default state.  All I did was install the diff module.  Could this have been a cache issue?


texts: Git merge made by recursive ? Why I cannot fetch the updated contrib module?

texts:
I am using git repositories to keep Drupal core and contrib modules in sync.

The set up looks like this:

[drupal.org git repository] -> [my-contrib repository] >> [my-dev-site repository]

Recently I updated my-contrib repository with the latest dev version of one of contrib modules from drupal.org.

When trying to update my dev site repository from my-contrib repository I run

git fetch origin

Normally this works fine but today I received this message:

  Already up-to-date! Merge made by recursive.

I compared both repositories and I can see there is no updated contrib
module in the my-dev-site repository.

How to correct this ? Why I cannot fetch the updated contrib module ?