texts: How to fix Admin Menu that's broken on live site, working on identical dev site

texts:
I've got an installation of Drupal Commerce Kickstart, and I've been developing it on my LAMP stack on my computer. The admin menu's working perfectly there. I recently migrated the site to the live server (also a LAMP stack), and Admin Menu simply doesn't work. Everything else works.

Specifically, it's being displayed (unstyled) at the bottom of the page on front-end pages (Zen subtheme) and admin pages (Seven subtheme). Sometimes it doesn't even show up at the bottom (it's completely missing).

More info: The version of PHP and MySQL are recent on both sites.

I used Backup and migrate to do the DB migration, with no issues. I've also just updated to the latest core version (7.37), and that made no difference.

Strangely, every other module seems to be working fine, except Admin Menu. And I've never encountered this before on any other Drupal sites I've built.

I have a feeling it's something to do with Commerce Kickstart's interference in the Management menu.

Updates: things I've tried that didn't work:

I've cleared Drupal cache, browser cache, site-specific cookies.
changing all the Admin Menu settings.
uninstalling and re-installing the module.
using a different browser: tried Firefox and Chrome.


texts: User cannot change password due to lack of "current" password

texts:
If a user signs up & login with a 1-time login link (Since the site is configured to moderate users), and if they don't set their password and navigate away, they can no longer come back and set a password as Drupal will now require their "current" password (which obviously does not exist).

Is there any way around this? Not have Drupal ask for a "Current password" when none is set, perhaps?


texts: Commerce - How to hook into ajax call on commerce cart form variation change

texts:
When you change a product attribute on a product display page, ajax loads the fields of the new product.

See here: http://demo.commerceguys.com/ck/tops/drupal-commerce-hoodie

By changing the size, color, etc, you trigger an ajax call that changes the fields such as SKU, images, etc.

My question is, how do you add additional markup to be updated on the attribute(form field) change?

By default, the form will update all fields printed in the template in this format.

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

This wraps markup around the price with the following classes.

commerce-product-field commerce-product-field-commerce-price field-commerce-price node-880-product-commerce-price

Im assuming the ajax call is replacing fields by looking at this markup.

So how do I add additional markup, that printed in the node template, to be replaced with ajax when a form field is changed.

Im not sure what to hook into.

Many thanks.


texts: Custom js added with drupal_add_js doesn't actually get added if I enable "Aggregate JavaScript files" or "Cache blocks"

texts:
The site is the most stock, only Drupal 7 core is installed.
included my theme, where the page.tpl and html.tpl theme files are copied from core
I created a Yandex.Maps module, this is a block where js is added.
<?php
  function yamap_block_info(): array {
    $blocks['yamap'] = [
      'info'  => 'Block Yandex.Map',
      'cache' => DRUPAL_CACHE_PER_ROLE,
    ];
    return $blocks;
  }

  function yamap_theme(): array {
    return [
      'main-yamap' => [
        'template' => 'yamap-block',
      ],
    ];
  }

  function yamap_block_view($delta = ''): array {
    if ($delta == 'yamap') {
      $module_path = drupal_get_path('module', 'yamap');
      drupal_add_js($module_path . '/src/js/yamap.js', ['scope' => 'footer', 'weight' => 40]);
      drupal_add_css($module_path . '/src/css/yamap.css');

      return [
        'content' => theme('main-yamap'),
      ];
    }
  }
?>

When I enable cache and aggregation, js falls off .. there are no errors on the page and in the console.
Drupal.settings.my_data does not exist too. But, if I turn off the block cache or aggregation, then everything is ok


texts: How do I use webform tokens in my PHP code for the form submission page?

texts:
I see this in webforms, but I don't know how to use these in my result page, as print_r(%value) doesn't print anything.

  Submission tokens

  %sid - The unique submission ID.
  %value[key] - A value without additional formatting. Elements may be accessed such as %value[fieldset_a][key_b]. Do not include quotes.


texts: Module Rules-> PHP Code, trying to use a Form Handler from Pardot, but Pardot is not receiving the info

texts:
I am trying to use the Rules module to send a form-handler to Pardot using a PHP script when a user logs in. I tested my variables to make sure they were valid by seeing them in a message and they appear fine. The problem I am having is that Pardot does not seem to be getting the form.

The Rules module information

Event: 'User Logs in'
Condition: none
Action: Execute custom PHP Code.

Pardot given form handler link

(similar to)

<form action="http://go.pardot.com/5/38543/2014-03-31/xyz" method="post">

Pardot has a link explaining that I could use an IFRAME instead a Form Action to POST.

Custom PHP Code:

$name = [account:mail];
$FName = [account:profile-user:field-profile-last-name];
$LName = [account:profile-user:field-profile-last-name];
echo '<iframe src="http://go.pardot.com/5/38543/2014-03-31/xyz?name='.$name.'&FName='.$FName.'" width="1" height="1"></iframe>';

Any help?


texts: Drupal 7 Can a custom textarea render html without a rich texteditor enabled?

texts:
I am using Drupal 7, (fairly new to module dev) here's my use case- I am trying to add a terms and conditions field directly within the user_registration screen. The Administrator sets the terms, so they have access to change the field values, but the authenticated user will not.

I am adding a custom field and when the field is loaded paragraphs, breaks, quotes are converted to html characters instead of rendering as an actual paragraph - I am assuming because the textarea isn't seen by ckeditor library? Im trying to display the field with the rendered paragraphs and breaks as this displays fine for admin users. It almost as if I need to specify rich-text

How would I do this?

function myModule_form_user_register_form_alter(&$form, &$form_state, &$form_id) {

 $form['field_agreement']['#access']=FALSE; //the default field is hidden from authenticated users

 //adding in custom field for auth users

 $form['Agreement'] = array (
  '#type' => 'textarea',
  '#title' => t('Terms & Conditions'),
  '#default_value' => $form['field_venue_agreement']['und']['0']['#default_value'],
  '#weight' => '10',
  '#description' => t('You must agree to our terms each time a new user is added'),
  '#disabled' => TRUE,
);

}


texts: how to change the size of an exposed filter autocomplete form?

texts:
the source shows:

<input id="edit-field-location-taxonomize-terms-tid" class="form-text form-autocomplete ctools-auto-submit-processed" type="text" maxlength="128" size="60" value="Germany" name="field_location_taxonomize_terms_tid" autocomplete="OFF" aria-autocomplete="list">

tried hook_form_alter but didn't find size or maxlength using drupal_set_message('<pre>' . print_r($form, TRUE) . '</pre>');

also

function modulename_element_info() {
  $types['textfield'] = array(
    '#input' => TRUE,
    '#size' => 20,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
    '#process' => array('ajax_process_form'),
    '#theme' => 'textfield',
    '#theme_wrappers' => array('form_element'),
  );
}

didn't work and don't know if/how i can change the size with css.

any help is appreciated. thanks a lot!


texts:
I have requirement in that I want to show a dropdown values. So to achieve this I created a form function with select type and returning the form. I want to display it in a html page. Here is what I have tried:

function cart_confirmation_form($form, &$formstate){

  $opt = array('Hi','Bye');
  $form['dropdown'] = array(
    '#title' => 'somethinfg',
    '#type' => 'select',
    '#options' => $opt,
  );
  return $form;
}
   function testing(){
     $message .= '
' . cart_confirmation_form($form, $formstate) . '
';
      $message .= '
'.$form_message.'
';
    drupal_set_message('
' . $message . '
' );

}

This is not working, It says array to string conversion, form and formstate is undefined something like this. I know this is not correct way please suggest me the correct way to print values in dropdown.


texts: What is the difference between getValue() and referencedEntities() to fetch paragraphs?

texts:
What is the difference between using getValue() and referencedEntities() in order to get the paragraph on a node?

See example below. Both examples are used in a node template such as node--page--full.html.twig and mymodule_preprocess_node() hook.

Using getValue()

$paragraph = $node->field_paragraph->getValue();
foreach ( $paragraph as $pr ) {
  // Get the entity using Paragraph::load(entity_id).
  $pr_item = \Drupal\paragraphs\Entity\Paragraph::load($pr['target_id']);

  // Now use $pr_item to get any field.
  $pr_item_img = $pr_item->field_image;
}

Using referencedEntities()

$pr_field = $node->field_paragraph->referencedEntities();
foreach($pr_field as $pr) {
  $item_image = $pr->get('field_image');
}

I am mainly concerned with the following:

What is more performant?
What is the best practice since both work?
Is either method considered a magic method? I ask because you can use $node->field_paragraph as opposed to $node->get('field_paragraph')


texts: Do we require a token module for token_replace() to work?

texts:
I am creating a custom token using token_replace() and then adding hook_tokens_info() and hook_tokens in .tokens.inc file.
Will this function work without token module
?
I mean do we need token module for this function


texts: Devel admin interface unreachable; or I broke my Devel?

texts:
Not sure what broke where, been using devel & love it. I enabled the Display $page array option, went, did stuff, came back to disable and when trying to load admin/config/development/devel either through button, url or asking nicely, I get a

  Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection
  without sending any data.

I uninstalled, reinstalled, no change. I uninstalled, deleted variables (shouldn't devel do this?) flushed caches, ran cron, deleted the devel folder, and reinstalled from a fresh download (7.x-1.2), no change. The strange part is devel still works (when module is installed), i'm still getting my $page array in the message area, but I can't admin devel anymore :'(

Unfortunately I'm ramping this site up for production & can't turn back now, might have to proceed w/o it.

Anybody know how to admin devel another way? Run into this before? Have something else I can try?

Update:
Just started testing the rest of devel & these functions elicit the same response (324):

Execute PHP
Devel settings (either the development menu link /devel/settings or the link in the admin toolbar admin/config/development/devel)
Menu item

Rebuild menus ! Thankfully this still works, because it fixed the problem! So try that if you start getting 324's in weird places!


texts: Migrate only taxonomy terms from a specific vocabulary

texts:
When doing a D7->8 migration, my taxonomy term migration template imports all the taxonomy terms found in the source D7 site. How to filter only the terms that belong to a specific vocabulary? For a node, I simply said:

source:
 plugin: d7_node
 node_type: article

But for terms? Is there something similar?

source:
 plugin: d7_taxonomy_term
 ????

Thanks in advance!


texts: Using Domain Access produces HTTP code 500

texts:
I was having a 500 error when going to subdomain. I looked at this thread, Drupal 7 Domain Access Module Gives 500 error, WSOD for subdomains, and managed to get rid of the 500 errors by editing my htaccess file. However, I now get a Page not found on homepages.

In my htaccess, if I use:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

The last line is giving me Error 500 when I start switching between main domain and sub-domains

However, if I use:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

the last line gets me rid of the Error 500. But when I go to the domain or sub-domain homepage and refresh it, I get a Page not found

So what is the right line to put in my htaccess to prevent both errors?

Thanks.


texts:
We are working on a site building using drupal. We have 3 different user profiles / roles.

Site Administrator (manage client admin and content)
Client Administrator (manage department admins)
Department Administrator (manage his own content)

Project Flow: Site admin, will manage client administrator. Whereas client admin will manage department administrator.

Since we are at the beginner level in Drupal, I wanted to know which module will suit the above user management.


texts: Create custom form and store form data into database

texts:
I am start working with Drupal just some days ago. I am really a amateur in Drupal . I just want to know how can I create a form in Drupal with textbox or check-boxes and store the value of the form in the database.

Like a registration form script in PHP.


texts: How do I direct link a view to a taxonomy menu?

texts:
I have created a vocabulary with over a hundred terms on three levels (parent/child/child) and used Taxonomy Menu to create a custom menu.  Selecting a menu item brings up a  default menu page with the description and a list of teasers of content that has the vocabulary term in a field.  I would like it to use a view to manage the content display.  IS there a way to direct the menu items to a view? I cannot find a way to change the link generated by the taxonomy menu module.

Edit to clarify the question:
Taxonomy menu generates a user defined menu block that will call up the taxonomy term selected. Unfortunately it locks the path (so it can regenerate the menu from the vocabulary if it changes).   I am looking for a way to generate the menu but change the path to display the view rather than the term page offered by taxonomy menu.


texts: How to write Custom Javascript in "drupal commerce" checkout page?

texts:
In drupal 7, there is a common page in Templates folder i.e., "page.tpl.php". In this page if we write javascript, it works in all pages. Now I need to write custom javascript for "drupal commerce kickstart" checkout page. For Example, If I want to use onchange event function to "Full name" field. Even though If I just use "alert(document.getElementById('edit-customer-profile-billing-addressbook').value);", it is not working any where of the pages written. I tried javascript code in below pages.

profiles/commerce_kickstart/themes/commerce_kickstart_theme/template.php
profiles/commerce_kickstart/themes/commerce_kickstart_theme/templates/ {almost all pages}
profiles/commerce_kickstart/modules/contrib/commerce/modules/checkout/ {almost all related pages}

So please help.. where should I write Javascript code to work in checkout page. Thanks in advance.


texts:
I would like to give permission for user profile image to registrant users only. i.e. anonymous user who visit the site can see the default profile image only in the user list and registrant users can see the real image of the user.
How can I make it? Does it required changing the setting or utilizing view?
Thanking you in advance


texts: Can't save any changes on the Content Language & Translation page

texts:
I'm using Drupal 8 and when I go to /admin/config/regional/content-language and try to turn on "Custom menu link", it doesn't save, and it just reloads unchecked.

I saw here that you need to check the actual items, as well, to get it to save, but that doesn't work either: https://www.drupal.org/forum/support/translations/2016-09-07/i-cant-save...

Then I realized that I can't save ANY changes to this page.

I see the warning "(* unsupported) Paragraphs fields do not support translation. See the online documentation.", which was red before I turned off translation for all Paragraph fields, and then the warning turned orange but remained. I had to go to the actual Content Type edit page to turn off translation from paragraph fields to get those changes to save.

Nothing is saving and I'm not seeing anything in the dblog. It just reloads as it was. I'm not even sure where to start on this. Any help would be greatly appreciated.


texts: Blocks are invisible after hosting drupal7

texts:
I am facing with a problem in drupal7, I am new to drupal7 too. When I run my website in localhost everything fine, blocks and menu are visible. But after I host my website in GoDaddy, that blocks and menu are invisible, where they gone. I am also hoping someone can help me to solve this problem. Thanks.

This is the image when I call this website in localhost. We can see block and menu.

This is the image when I call after hosting this website.


texts: user registration redirect for custom form drupal 6

texts:
I have worked on a solution which will redirect from the user registration form to my own form. My own form can be reached by typing the website name testweb/my_module/form. Here is the code of my module using a form_alter. When I run the function it doesn't redirect to my own form. Could someone advice me why it is not working?

function redirect_custom_reg_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_register') {
    $form_state['redirect'] = 'my_module/form';
  }
}


texts:
I need to add some new filters to the admin/content (or admin/content/file) page. Standardly, it offers me just type and status. Let's say, I would like to add the filter "name", that shows just the files of specified author. I am able to generate all the possible authors (their names) from SQL table, as well as showing them on the page (simple add it to $form['filter']['filters']['status']['filters'] with hook_form_alter function).

But now I do not know, what to do next. The submit button calls some function to generate some filters (but then it seems pretty difficult to change everything).

Do you know any way to do that?


texts: How to add Autocomplete to a Views Custom Textfield Filter

texts:
I have created my own custom views filter handler which works perfectly with a simple textfield for the value form. However, I am unable to add autocomplete to that textfield (ie: the blue circle denoting autocomplete doesn't show up in the textfield and in the page source, autocomplete is not mentioned for that element).

What am I missing? Does Views re-write my value form somewhere as implied in Making text fields autocomplete in views exposed filters and if so, how do I plug into the after build within a custom filter handler class? (The question linked to involved altering an existing exposed form as opposed to creating a custom filter which I am.)

NOTE: I am using Drupal 7 and Views 3.

My Code

Here is my custom filter class:

/**
 * The Germplasm Genotyped views filter handler class (autocomplete textfield).
 */
class views_handler_filter_germplasm_genotyped_name extends views_handler_filter_string {

  /**
   * So that the value form is not inherited.
   */
  function value_form (&$form, &$form_state) {

        $form['value'] = array(
            '#type' => 'textfield',
            '#default_value' => $this->value,
            '#autocomplete' => 'tripal_ajax/nd_genotypes/genotyped_germplasm/name_to_id/Phaseolus/only'
        );

  }
}

I've defined my autocomplete in hook_menu():

  // Name autocomplete (display only the preferred organism -in path).
  $items['tripal_ajax/nd_genotypes/genotyped_germplasm/name_to_id/%/only'] = array(
    'page callback' => 'nd_genotypes_germplasm_name_to_id_callback',
    'page arguments' => array(4, FALSE),
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK
  );

And created my callback:

function nd_genotypes_germplasm_name_to_id_callback($organism_genus, $all_organisms, $string) {
  $matches = array();

  // custom table select
  $query = db_select('nd_genotype_germplasm', 'g')
    ->fields('g', array('name', 'genus'))
    ->condition('g.name', '%' . db_like($string) . '%', 'LIKE')
    ->condition('g.genus', $organism_genus, '=')
    ->orderBy('char_length(g.name)','ASC')
    ->orderBy('g.genus','ASC');
  $result = $query->execute();
  foreach ($result as $row) {
      $key = $row->name;
      if (!$all_organisms) {
        $matches[$key] = $row->name;
      }
      else {
        $matches[$key] = format_string(
          '@genus: @name',
          array(
            '@genus' => check_plain($row->genus),
            '@name' => check_plain($row->name),
          )
        );
      }
  }
  drupal_json_output($matches);
}

Testing I've done

I have tested the autocomplete callback directly by entering the path in my browser (ie: tripal_ajax/nd_genotypes/genotyped_germplasm/name_to_id/Cicer/only/CDC where "CDC" is the $string) and it works perfectly. By that I means it returns a json array outside my drupal theme with the elements I expect:

{
"CDC Xena 454 DNA Extraction": "CDC Xena 454 DNA Extraction",
"CDC Frontier 454 DNA Extraction": "CDC Frontier 454 DNA Extraction"
}

But as I said, my exposed fitler textfield in my view doesn't have autocomplete functionality. I know my value form is being executed because I can dpm() from within the handler and see it in my view, #autocomplete and all. However, when I look at the page source I see a plain textfield input with no autocomplete mentioned.

Note: Working autocomplete fields seem to have the class "form-autocomplete" on the input tag and an addition hidden input with the callback path and class "autocomplete autocomplete-processed".


texts: Entity reference default value to first value

texts:
I have an entity reference field using a view to dynamically create a list based on a contextual filter from a user ID in URL. Works perfectly.

Question is, how can I default the value to the first result in the list, instead of displaying -None- or -Please select-


texts: Duplicate published content to another language

texts:
I have a big question without a solution, but I can't believe it doesn't exist.
I have a site in Portuguese and one in Spanish, I want to pass the contents of "pt" to "es", how would I do it without having to download the images and upload again manually? There are 400 more items and I would stay another 6 days just doing this.
I already tried going through the "Content", "Updates Options" below the filter list, but didn't get a good result. I would be very grateful if anyone could help me.

I have a website, this website has three versions, "Portuguese", "Spanish" and "English". All versions, although different, are managed by "Taxonomy", and "Content Types" to differentiate them.
There is a "Content Type" which is a photo gallery, such as a field and text, that text field needs to be translated into the other languages. However, some photos I needed to upload again, that is, I downloaded the photos, translated the text field and saved marking Spanish, but it was so time consuming and tiring. I would need to duplicate these fields, so translating them would greatly dominate the time spent.


texts:
I am trying to expose data fetched from remote API and stored to $user object. I have accomplished that with a custom views handler suggested in this post Custom views handler without table.

However, I need to add sorting and filtering, so any help will be great.

This is the custom views field handler code.

/**
 * A handler to provide a field that shows the license type.
 *
 * @ingroup views_field_handlers
 */
class views_handler_apms_license extends views_handler_field {

  function query() {
    // do nothing -- to override the parent query.
  }

  function option_definition() {
    $options = parent::option_definition();

    // Override the alter text option to always alter the text.
    $options['alter']['contains']['alter_text'] = array('default' => TRUE);
    return $options;
  }

  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);

    // Remove the checkbox
    unset($form['alter']['alter_text']);
    unset($form['alter']['text']['#dependency']);
    unset($form['alter']['text']['#process']);
  }

  function render($values) {
    $user = user_load($values->uid);
    if (isset($user->apms['userLicense'])) {
      return $user->apms['userLicense'] ? t('BASIC') : t('FREE');
    }
    else {
      return NULL;
    }
  }
}


texts: How do you call ubercart's shopping cart block?

texts:
I have a need to manually call and place the UC shopping cart block. I know that to call the block it would be something like this;

<?php
$block = module_invoke('block', 'block_view', #);
print render($block);
?>

I tried;

<?php
$block = module_invoke('block', 'block_view', 'cart');
print render($block);
?>

and

<?php
$block = module_invoke('uc_cart', 'block_view', 'cart');
print render($block);
?>

Neither worked. How do I properly do this call?


texts: Which Omega theme should I use with Drupal 7?

texts:
I need to use the Omega theme framework. I find there is two different versions: Omega 3 and Omega 4.

Which one should I use with Drupal 7?


texts:
I have created the form using custom module, and it is working fine now. In this case, when I submit the form it simply sends the mail to the particular person from particular id. For this what i did is,

function custom_form_my_form_submit($form, &$form_state) {
$valid_email = $form_state['values']['email'];
$from = 'karthik.k.siva@gmail.com';
$body = 'Email: '.$valid_email.'<br />URL: '.request_uri();
$to = 'karthikeyan.ameex@gmail.com'; // Set this email address - emails will be sent to this email address!
$params = array(
'body' => $body,
'subject' => 'Website Information Request',
);

if (drupal_mail('custom_form_my_form', 'some_mail_key', $to, language_default(), $params, $from, TRUE))
{
    drupal_set_message('Thanks, we will be in contact with more information soon.');
} else {
    drupal_set_message('There was an error subscribing you. Please try again later');
}

}

And now I want to receive the submitted form contents through email, for that what I have to do.


texts: Using db_insert with a reserved keyword as the column name

texts:
It appears that db_insert() (Drupal 7) fails when I try to specify a column name which is one of the reserved keywords (in this case, insert).  I tried finding a way to use the back tick syntax which works with a direct SQL command, insert, but it still does not seem
to work.

Googling so far has only confirmed this problem and returned suggestions to change the column name.

Is this the only solution, or is some other way to get db_insert to work (there's a good
reason why the column is called insert in our application)

thanks!


texts:
I have a custom content type of "Press Release." I would like to make an archive listing of the press releases, based on a "release date" field in the content type. The archive view built into views uses the "content: created" date, and I can't figure out how to make it work with this other date instead. (This is Drupal 7.)

Any help would be appreciated. Thanks.


texts:
I'm currently using a digital asset management tool that allows us to host images as a CDN.

The DAM allows us to crop and position the image using URL parameters (example: https://embed.widencdn.net/img/du/ewjtweqh77/1800x714px/CampusScenics_0279.jpg?crop=yes&position=c), however, when I try to remote file upload (in entity browser) this image, I get an error message that tells me that the file has to be a .jpg or .png.

If you take a look at the URL, you can clearly see it's a .jpg image but for some reason, the validator is registering this as a non .jpg. I tried appending the last 3 characters of the URL (n=c) but that doesn't work, also there might be various different parameters depending on the image and how it's changed in the DAM so that wouldn't be a consistent solution even if it did.

Does anyone have any suggestions for this? I understand that I can embed this image in CKEditor but the solution for this ask needs to be an enhancement (or work around) to this remote file upload issue as we use this file upload process for all of our paragraph components.

Any and all help would be greatly appreciated, thanks!


texts:
I need to hide the red "required" star sign, but I can't understand how to hide this red star mark using hook_form_alter().
I know this can be done using CSS, but I want to know if it is possible to do it using hook_form_alter(), or if there is any other way to hide it programmatically.


texts:
I would like to keep track of the number of visits for each anonymous user. I want to be able to show special messages, for example when they visit the site the 10th time.

Incrementing a cookie variable will just be fine in this case. How do I find out when a new session has started?


texts: Drupal 8 Commerce 2 Trigger custom mail to product author

texts:
We can get the uid for purchased product after checkout using Event Subscriber.

How to sent mail to product author with product details when someone checkout the product. We can get all the details in $order.


texts: How do I add comments to a YAML webform?

texts:
I would like to add comments to the Sourcecode of my webforms in YAML.
# comment (without quotes).
But when I save this, it automatically gets removed.
20_e_mailadres:
  '#type': email
  '#title': E-mailadres
# write a comment here
21_werkmail:
  '#type': email
  '#title': werk E-mailadres

How do I add comments to a YAML webform so they are kept when I save?


texts: Disable/Trim DHTML Menu Description Popup

texts:
I would like to disable or trim DHTML Menu's description popup. I have checked both dhtml_menu and taxonomy modules. I could not get any clues. Please help me.

Thanks


texts:
I am writing a rule to store Tenant field's value to Previous tenant field whenever the Tenant field is updated and saved. The following are apartment and tenant content types.

Apartment content type:

Room
Tenant (entity reference to Tenant content type)
Previous Tenant (unlimited number of values is set for this field)

Tenant content type:

Name
Phone

And this is my rule:

{ "rules_tenant_records" : {
"LABEL" : "Tenant records",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_update--apartment" : { "bundle" : "apartment" } },
"IF" : [
  { "entity_has_field" : { "entity" : [ "node-unchanged:field-tenant" ], "field" : "field_tenant" } }
],
"DO" : [
  { "data_set" : {
      "data" : [ "node:field-previous-tenant" ],
      "value" : { "value" : [ "[node:field-tenant]" ] }
    }
  }
]

}
}

It does not work, any suggestion?


texts: How do I change the text of the "View" and "Edit" links on the user account page?

texts:
I'm looking for a way to change the text being displayed in the links on the user account page.

More specifically, I'm trying to change the text "View" and "Edit" to "View Profile" and "Edit Profile". Ideally, I would prefer a solution that allows me to do this in my .theme file via a preprocessor or a hook function.


texts: Using cache for twig variables in preprocess function

texts:
I implement a menu on a region using a preprocess function to get a link with an anchor for each block of it with a title.
I made a preprocess function for region, in my theme, where I test the region machine name.

I first used the $variables['elements'][XXX]['#id'] to load each block, to find out if the label was set to be display. But I quickly discover that on my server, where the cache is on, the $variables['elements'] only contain an array of cached render.

I then modify my preprocess hook to use the key of the $variables['elements'], witch is finally the block key.

use Drupal\block\Entity\Block;

/**
 * Implements hook_preprocess_region().
 */
function MYTHEME_preprocess_region(&$variables) {
  if ($variables['region'] == 'one_page') {
    $blocs_menu = array();
    foreach ($variables['elements'] as $key => $values) {
      if (substr($key, 0, 1) == '#') {
        continue;
      }
      $bloc_object = Block::load($key);
      if (is_object($bloc_object)) {
        $bloc_settings = $bloc_object->get('settings');
        if ($bloc_settings['label_display']) {
          $blocs_menu[] = array(
              'id' => $key,
              'label' => $bloc_settings['label'],
          );
        }
      }
    }
    if (count($blocs_menu)) {
      $variables['region_menu'] = $blocs_menu;
    }
  }
}

And in my override file region--one-page.html.twig

{%- if region_menu -%}

{%- for menu in region_menu -%}

{{ menu['label'] }}

{%- endfor -%}

{%- endif -%}

Everything is working well, but I would like to improve the concept :

Be able to detect if the cache is activated on the project
Include in cache my 'region_menu' variable, and generate it only when cache have to be rebuild.

If I understand well, the twig template is also cached, then it is maybe just not really necessary to declare the menu if cache is ON ?

The thing is I'm really lost in the D8 cache API.
I think I have to deal with the cache tags, because I don't have a render to cache.

I would appreciate some help, I cannot find some good (and easy) examples on the documentation or in the core modules.


texts:
I'm working on a pre-existing Drupal 7 website that has been through several iterations so I'm trying to have a tidy up and remove items which are not required.

I'm currently looking at the Image Styles, of which there are 26 on the site. I'm pretty sure a lot are not used any more, is there any best practise method of making sure they're not used before removing them? My current thinking is either to check every Content Type & View to see if they're used, then do a search in the database & code base to see if they appear in there. Is this the best way? Would it cover all locations they could be being used?


texts: How to import image using Feeds which doesn't have a correct file extension?

texts:
I am using Drupal 7 and Feeds to import an image field into a content type article and it does work when the image URL is a direct link to the image.

However images that are linked to image handlers, like:

  http://business.iafrica.com/apps/imageUtil/view/article/1008937/1/630x385/

are not importing.

I have tried:

to use the Feeds Tamper module and Feeds Tamper PHP and alter the image name, but this resulted in an invalid URL loading,
to use Field Image Grabber, but I have an XML source, not HTML.

Here is my source feed URL:

  http://resource.thumbtribe.mobi/ds1.portal/portal/1/4/resource/view/maximized/9500187?format=atom_extern

and my Image: URI XPath mapping is:

string(link[@rel="enclosure"]/@href)


texts:
I'm not sure if this is a Views issue or an Entity reference issue, so I'm cross-posting here to see if I can find an answer.

I'm trying to export a view from my testing & development site, to our production site, but I keep running into issues, and I'm not sure where I'm going wrong.

To the best of my knowledge I've got the exact same setup on both sites - modules are all the same, and all have the same versions for both Views and Entityreference.

However, when I try to import the view on our production site I get the following errors:

Relationship handler node.reverse_field_plan_document_attachment_node is not available.
Display plugin entityreference is not available.
Relationship handler node.reverse_field_plan_document_attachment_node is not available.
Unable to import view.

I'm stumped. I have no idea where else to look. I'm assuming it's a simple issue with a setting somewhere, but I can't find it. Everything works perfectly without issue on our testing site, and doing wholesale database swap is not an option.

When I go to create a new view on our production site, I don't even have the option to add an entity reference display:

Initially, I tried to use the features module to move the feature set from the testing site to the production site, but that was an enormous mess. I completely uninstalled the features module, and all the modules I created with it in effort to try to get this stuff working. After uninstalling all that stuff, I'm still left without an option to even create an Entityreference display with Views, and obviously cannot import my view either.

Can you help?


texts: How to solve the huge HTTPRL error that fills down all of Cron \ Status report?

texts:
Background

For some time now, and only in some occasions, when I run CRON (Status report), I see a huge error (About 170 rows) at the HTTPRL section (related to the HTTP Parallel Request & Threading Library module). It happens randomly - Sometimes it happens and sometimes it doesn't. When the error does not appear, the HHTPRL "section" in status report is all green. Here is a screenprint of it:

What I already tried

I've tried to play a bit with the HTTPRL preferences, but nothing really helped... For example, tried to change at "IP Address to send all self server requests to": from -1 to 1. Also tried to uncheck "Enable background callbacks", But IIRC nothings has changed.

The only changes I saw (When the error was apparent) were when I unchecked "Enable background callbacks", or otherwise, when I check-marked "Use httprl to handle drupal_http_request" --- When I ran Cron afterwards the error's text went from about 170 rows to 90 rows. But this data doesn't help me to understand Why the error was there on the first place and even worse - Why it appears randomly?

Bottom line

Is this a known problem? You might have an idea why this happens or a tip how to try to solve it?


texts: How to attach a css style with a node in the node-edit form

texts: I don't want to save the style in a file. What I want is to store the css code in a field while editing node and use the id or class within the node content.


texts: When adding a relationship to the author, I'm unable to see any custom field

texts:
I'm trying to get the username of a blog last poster; I created a view that shows the blog's fields. If I click on "Add field" I can see all custom fields. However, when I add a relationship for Author, I now loose all custom content fields including any author-related fields. The only fields available are the ones like "Content: Nid" and "Content: Path."

Can anyone help me understand what is going on? I've tried everything and it's now day 2 hung up on this. Is Views broken?


texts:
I have picked up some work on a headless Drupal 7 site, using services, and service_token.

Where the "normal" service login, as I understand it, uses a cookie to authenticate, Services Token allows authentication by passing a token as the username in a basic auth header.

All appears to work well. But I have been asked to implement "Forgot password", and I am struggling to understand how that flow fits with Services Token.

Any guidance most appreciated.


texts: How to put a view generated slideshow as a page background?

texts:
I need to create a homepage with a slideshow as a background.
The slideshow shows images and texts. Similar to this one: enter link description here

What I've done:

1) I created a slideshow block with views

2) I put that block in the homepage

Now I spent some hours playing with css to put it in the background and making it fill the entire page. But with no results at all..

I'd like to know if is there module to make easier to accomplish this.


texts: media module update, shows always old version

texts:
I get a security update for some modules, I upgraded them with no problems,
but when come to media module, It shows me always the older version before the update run, although, I changed all files :

I checked also .info file to make sure that I downloaded the right new version :

name = Media
description = Provides the core Media API
package = Media
core = 7.x
dependencies[] = file_entity
dependencies[] = image
files[] = includes/MediaReadOnlyStreamWrapper.inc
files[] = test/media.types.test
files[] = test/media.entity.test
files[] = test/media.file.usage.test
configure = admin/config/media/browser

; Information added by Drupal.org packaging script on 2014-01-08
version = "7.x-1.4"
core = "7.x"
project = "media"
datestamp = "1389219517"

Have anyone an idea about this strange happen!
Thanks in advance.


texts:
I have inserted comment form to my custom node.tpl via print drupal_render(drupal_get_form("comment_node_{$node->type}_form", (object) array('nid' => $node->nid)));. It works fine, but form isn't submitted when I click on Save button. It submits the data correctly to comment/reply/<nid>, but data aren't saved correctly and I'm only redirected back to node page.

I'm using current D7.


texts: After enabling Calendar the Next/Prev buttons are off to the side

texts: How can I get these two buttons in a better place to make them useful?  Currently they reside overlapping the sidebar and calendar almost right in the middle of it.  I've looked at documentation and I can't figure it out. I'm using drupal 7.  Thanks


texts: Exposing Individual Fields on Output for Styling

texts:
I've created a view which outputs a particular content type into a jCarousel.

One of my fields is a 'background colour' and I want to use this value for the actual background colour of the li element in my jCarousel. The next is an image and I want this image to be wrapped in a div that I can lay out correctly within the same li of the carousel.

So, this carousel will have a customisable image and background colour for each member of the content type.

The problem is, in jCarousel, the fields are just dumped into an array haphazardly, so I cannot output different fields in different ways. Ideally, what I'd like to happen is: in the jcarousel-view.tpl.php I'd like to output $rows[0]['background-color'] into my custom html div tags and then $rows[0]['image'] output into my own custom classed div tags also - obviously iterated within a loop to apply the individual settings to each element.
However, the current set up is that $rows[0] dumps both fields into their default styles and I can't access individual fields.

Now, is this something I can control in Views? Or do I need to do some custom hacking to get this to work?


texts: how to filter and show fields of content types in custom page tpl.php file

texts:
I have the following fields in content type ‘Articles’

Year:
Volume:
Issue:
Title:
Description:
Upload file:

Now I want to create a custom pages tpl.php and categorized based on Year, Volume, Issue. So the output should be like below.
On clicking issues, it should display the all the posts.  (2013/volume 3/Issue 1)

2013
Volume3 – Issue1, Issue 2

2012
Volume 2 – Issue1, Issue 2, Issue 3

2011
Volume 1 – Issue1


texts:
I have a configuration form which extends ConfigFormBase.

How can I add a confirmation popup/page to give a message to the user that some field has certain value and do you wish to continue form submission?

I know there also is the ConfirmFormBase class but I don't have a clue how to implement this in my configuration form.


texts: Taxonomy autocomplete returns "connection reset"

texts:
I have an autocomplete issue on an otherwise functional Drupal 8 site. I'm hoping someone has either found and fixed this problem before, or can steer me on how to diagnose it myself.

When editing a node, taxonomy autocomplete fields appear to hang - the spinner keeps going round forever. However, looking at the Network inspector, the lookup has returned "Connection Reset".

Further information:

Other kinds of autocomplete work on the site (e.g. node lookup when adding a redirect)
I am logged in as an admin user with full permissions to everything
The vocabulary is not empty
The autocomplete field is set to "create if term doesn't exist".
The form saves fine on submit, either creating a new term or working out which term to link to if I enter the exact text correctly
I am on the second-latest version (8.1.9)
Accessing the lookup URL directly from a separate tab gives "This site can't be reached / the connection was reset"
PHP error log - empty
Drupal "recent errors" log - empty
Behaviour same in Chrome and Firefox
Linux server, Windows client for browsers

The URL being accessed looks like this:
http://[mysite.co.uk]/entity_reference_autocomplete/taxonomy_term/default%3Ataxonomy_term/UhDfSC7PJL0Sf6NxfMCVY27CaUM15rrS-gVsL6eD66E?q=[search_term_here]

EDIT:

As requested, here's the list of contributed modules:

Protected Pages
AT Theme Generator
AT Tools
Admin Toolbar
Admin Toolbar Extra Tools
Adminimal Admin Toolbar
Chaos Tools
Chaos Tools Views
Chaos Tools Blocks
Bigpipe
Calendar
Calendar Datetime
Devel
Feeds
Audiofield
Computer field
Datetime
Image
Simple Google Maps
Image Effects
IMCE File Manager
Backup & Migrate
Blog
Coffee
CookieConsent
Entity
Exclude Node Title
Libraries
Masquerade
PathAuto
Profile
Redirect
Redirect Import
Scheduler
Special Menu Items
Token
Twitter Block
Typed Data
User Display
Supercache
Rules
Security Review
Honeypot
Google Analytics
Flood Unblock
Superfish
Views PHP
Views Slideshow
Views Slideshow Cycle
Views templates


texts: drupal_goto(request_uri()) replaces my '?', '=' and '&' in url

texts:
I need to redirect user from a page with example.com/node/add/dispo?arg1=1&arg2=2 to the same type of URL. But when I simply do a drupal_goto(request_uri());, it redirects my user to example.com/node/add/dispo%25F%3C etc....

I tried a str_replace but it didnt work.

Would you have any workaround ?


texts:
Is there any way referenced entities could be named in a meaningful way?

Currently when I am creating a custom view and need to reference some entity, I have tens of entities that are named exactly the same: Entity Referenced: Referenced Entity (see the picture below).

In such setup there is no way to tell what the referenced entity is before using it. Is there any better way to have referenced entities on the system and still know what they are before using them?


texts: How do I schedule a reminder email with Rules to users that have flagged an event?

texts:
I have a content type: event
It has a single date field: date
It has a flag on it: reminder

When the user flags the node, I want to schedule a rule to send them an email the day of the event.

Can someone walk me through the steps on how to do this?

Edit: I have now gotten as far as being able to schedule the email

This is what I have so far.

Add new component
 - Type: Action set
 - Name: Send reminder email
 - Data Type: User
 - Data Type: Node

Add action
 - Send reminder mail
 - To: 'user:mail'
 - Subject: Don't forget about [node:title]
 - Body:
 - Don't forget about [node:title] tomorrow!

Create new Rule
 - Name: Schedule reminder email
 - React on Event: A node has been flagged, under "Remind"

Condition: Entity has field Data Selector flagged-node  Field: Date

Action: Schedule component evaluation Action set: Send reminder email


texts: How to pull pictures and summary information from external web pages when posting links?

texts:
When posting a link (external web page) to my Drupal blog, is there a way to have Drupal automatically pull the picture and summary information from that link and include it in the post on my Drupal blog the way Facebook does it when a person posts a link from an external web page on their Facebook wall or group?

If it is possible, can somebody please point me in the right direction on how to do it.


texts: How to have multiple exposed filters in a block that affects multiple views content panes in a panel?

texts:
I have a view with multiple content panes. One shows a table, other shows a chart and so on. On every content pane I have the same exposed filters and it's exposed as a block.

In a panel I add all thosse content panes and on top of the page I show the exposed block. How can I make the filter to affect all the content panes and not one individually?


texts: Configuration settings of Authcache for roles

texts:
I'm not sure about configuration of roles in Autchcache module, specifically with authenticated user role. I want to enable caching for both anonymous and authenticated users, but I want to exclude from caching some roles (administrator and webmanager). My web has a lot of roles but an authenticated user may has one, two or more of them.
For example, my web has the next roles: anonymous, authenticated, administrator, webmanager, rol1, rol2, rol3, etc. Some users may have some roles: rol3 and rol4, but other users may have only rol1 and rol2, etc. I want cahing for all of them except the ones who has webmanager or administrator.
How should I config this behavior in Authcache module?


texts: How do I set the exact post date timestamp as Views contextual filter?

texts:
I need to display nodes that were created within a certain period of time.

Setting Date: Date (node) (content: post date) as contextual Views filter works super smooth. Now when I call archive/2014-04-01-10--2014-04-04-15 all nodes created between April 1st 10am and April 4th 3pm will be displayed.

But how can I set the granularity to also respect minutes (and seconds)? How to alter the date filter or how to write a custom timestamp contextual filter?


texts: Attach a submit handler on an ajax-y form (hook_media_format_form_prepare_alter)

texts:
I'm working with media 7.x-2.0-unstable7.

I am attempting to adjust the behavior of the media module's wysiwyg embedded image attribute editor modal dialog (c.f. http://drupal.org/node/835516).  It was pretty easy to adjust the contents of this dialog with hook_media_format_form_prepare_alter (see: http://drupal.org/node/835516#comment-7075374), and I expected that it would be easy to add a submit handler, and Drupal would jump through the hoops for me to insure that it was called at the right time. If this service is offered, I can't seem to figure out how to make it work.

The only other place I can find that uses hook_media_format_form_prepare_alter is media_crop, and it includes its own ajax POST to send its data back to the server.  It's not clear to me how the standard media_format_form saves its data.  It looks like ctools handles calling the submit handler for similar form, media_file_edit_modal (called for editing image metadata fields for media image files that are entity fields).  Is there something similar for hook_media_format_form_prepare_alter, or do I have to write my own Javascript and my own data-receive menu, like media_crop does?

media.api.php did not help clarify.


texts: How to change a user reference field from select list to autocomplete in a Views exposed filter?

texts:
In Views filter I have added user reference field and its showing me as select drop-down. I have exposed that field in the filter.

Those user reference fields are related to a content type, but I want those as auto-complete fields instead of drop-down, just as taxonomy fields can be drop-down or auto-complete fields.

The issue with select list is that there are thousands of users in that list and it is taking time to load all values and render the page.

How can I achieve this?


texts:
I am using exposed filter in my views for taxonomy term. It is displaying taxonomy terms in 'drop down list'. Is it possible to use jquery tab or button instead? Please let me know if there is any way to do so via template or any module.

Thank you.


texts: How do I delay error messages from firing until after a page is loaded

texts:
If anyone could please advise me on how to delay $messages from firing until after a page has loaded I would tremendously appreciate it.

The issue I'm having is, users are filling out a form generated by a block, and the errors are triggered, but do not display, because the page has already loaded.

The form is printed with the following, on a node template:

$form = drupal_get_form('user_register_form');
print drupal_render($form);

If I understand correctly, the $messages variable is used on the page template level, and is therefore loaded before the form is ever loaded.

I've tried adding:

if(isset($messages)){ print $messages }
to various parts of the node template. To no avail.

I've tried using:
print theme_status_messages($variables);
But am still experiencing the same behavior, and I've tried the steps recommended here:

Print $Messages in node.tpl.php file

Specifically, modifying the preprocessor_page and preprocessor_node functions as requested, and either that is not working, or I am not calling it correctly from the node template.

Thank you very much!


texts: Can I just change Drupal's default timezone to test to see if some scheduled rules will fire?

texts:
I need to test to see if some scheduled rules will fire as expected. I cannot change the server time, as I do not have access to do this. However, if I change Drupal's default timezone can I expedite the process? If not is there another way to do this.

Note: I cannot just shorten the schedules rules as they are hardcoded in a contrib module.


texts: What to do when translation imported using Locale has an inappropriate translation?

texts: I used Locale module to translate Drupal to my national language. But some words' translation is not appropriate. How can I change the translation of some words?


texts: How can I set a separator for a taxonomy field?

texts:
Within my nodes I'm want to display my taxonomy field references with a separator, like this:

term1 - term2 - term3

what I get as a standard is:

term1
term2
term3

with display suite I can get:

term1 term2 term3

I know that I can do this with CSS styling, but is there another solution to add a separator?


texts: Some menus not showing in Menu Settings drop down when editing page

texts:
I'm working on a website in Drupal 7.

I have the following menus in admin/structure/menus:

About Us Menu (added)
Get Connected Menu (added)
Main Menu (default)
Management (default)
Navigation (default)
User Menu (default)

Behind each menu in the list above, I have included "default" if it was included in the Drupal install, or "added" if I have added the menu myself.

I can add any page to any of these menus by using structure/menu/manage/[MENU NAME]/add, but I would like for my client to be able to select the menu from when adding or editing a page.

By default, I was able to add pages to the the Main Menu menu from the Menu Settings when adding or editing a page, and after adding the About Us Menu, I was able to add pages to same from this dropdown. However, I added another menu - Get Connected Menu, but I do not see it in the dropdown.

Adding additional test menus, I am still able to see only those that are in bold above - About Us Menu and Main Menu.

Has anyone ever seen this or know of a reason why this is happening and how to fix it?


texts: Hide and Reveal Sidebar Blocks in Drupal 7?

texts:
I am working on a 1920px-wide site that will be displayed on HDTVs internally at an office. I'd like to place text and other info into (ideally) sidebar blocks, but I'd like for those blocks to be hidden when the page loads. Then, when someone clicks a block's title, that block alone would expand, displaying its content over the primary content area. I have attached an image to illustrate what I mean.

Does anyone here know of a module that can accommodate this type of functionality? If not, any recommendations on how to achieve this would be most appreciated. The sidebar content does not necessarily have to be in blocks.


texts: Calendar Module: Calendar block with mini-calendar to show next month instead of current

texts:
I am using the Calendar module (http://drupal.org/project/calendar).

One of the default block  (called Block) in the Calendar module gives you the option to embed a mini-calendar as a block on your site. I would like this mini-calendar to show a future month instead of current month.

Does anybody know how to do it?

Thanks.


texts:
I'm trying to override the file-link.html.twig to display the size next to the file link (also the file MIME type, but I think I can figure that out once I figure out how to display the size) but so far I've been failing spectacularly. I assume this must be super simple and I'm missing something obvious.

Using kint($variables) in the function themename_preprocess_file_link(&$variables) I see the filesize:

$args array (1)
array (15
'file' => Drupal\file\Entity\File(27)
"contents" tab:
    protected values -> array(13)
    'filesize' => array(1)
    'x-default' => string(7) "2245389"

But I can't figure out how to turn this into a variable I can use in a template file.

I tried following How can I override template_preprocess_file_link function? but then I couldn't figure out what was suppose to be the variable to use in the template file. Also, his "code" just seems to be same as what is on https://api.drupal.org/api/drupal/core%21modules%21file%21file.module/function/template_preprocess_file_link/8.6.x.


texts: Views taxonomy exposed filter, show tree/hierarchy in drop down menu

texts:
I have an exposed taxonomy filter that allows the user the filter by term. The vocabulary is 2 tiers, however in the exposed filter menu the hierarchy appears flat.

Is there a method/module to show the hierarchy with indentation or prefixing child terms with "-", similar to the taxonomy term selection menu from the node edit form itself.

x-post from https://stackoverflow.com/questions/6222875/drupal-views-taxonomy-exposed-filter-show-tree-hierarchy-in-drop-down-menu

SOLUTION:

The filter Taxonomy: Term ID (with Depth) will display the option "Show Hierarchy In Dropdown" when you select the Dropdown widget.


texts: drupal 7 Ubercart recurring fee settings tab is blank

texts:
I get an error
on my screen There are no payment methods configured for orders with recurring fees, enable one from recurring fee admin settings.

I then go to the link
cart/checkout#overlay=admin/store/settings/products/edit/features

Next i try and choose the Reccuring fee settings tab but it is completely blank.

Version of UC Recurring Payments and Subscriptions module is 7.x-2.0-alpha3

I am wondering if down grade will that fix the problem.


texts: Calling a field in views-view-fields--view-name.tpl.php ---- Error

texts:
I am trying to call a field by using the line of code:

<?php print $field->handler->view->field['title_1']; ?>

But i keep getting this error:

I used devel dpm() to look for what was the correct path to call it and it said handler->view->field['title_1']. I am absolutely stumped and I am not sure if I am using the right .tpl.php file or what. Anyone have any ideas?

---EDIT---

<?php foreach ($fields as $id => $field): ?>
  <?php if (!empty($field->separator)): ?>
  <?php print $field->separator; ?>
<?php endif; ?>

<?php print $field->wrapper_prefix; ?>
<?php print $field->label_html; ?>
<?php print $field->content; ?>
<div>
    <?php print $field->handler->view->field['title_1']; ?>
</div>
<?php print $field->wrapper_suffix; ?>


texts: Webform confirmation message replacing my webform block while using webform_ajax

texts:
i have made a contact webform and i want to submit it using ajax,for that i used web_form ajax.
In the settings i selected "show all the messages in the same webform block "
But the thing i want is that i want to show the confirmation message in the webform block but don't want it to replace my contact form.
Or is there a way that i can show confirmation message on the same page in a pop-up window using when the webform is submitted


texts: How could I create an iframe page like this in Drupal?

texts:
I want one of my content type pages to look like this http://flippa.com/auctions/2647380/site
The data at the top would be filled by cck fields from that content type. How could I do this?


texts: How do I set a variable in the configuration file setting.php and use it from code?


texts: What is an alternative to hook_node_view()?

texts:
When a node is rendered in a panel pane, hook_node_view() is not invoked. (I use Panels 7.x-3.4.) Is there any alternative to change rendered node content in any other hook?

I have tried  with hook_ctools_render_alter(), but the HTML output of the node is presented as one large string. I need to change node content in one particular field, so I need to access a $node variable as an array, as it happens with hook_node_view(). I need to execute custom PHP for changing the output of one of the fields.


texts: I need to change the output of the logo (to make it adapative) of a site. Which is the theme template file that contains the logo image of the site?


texts: Regarding flag actions and rules integration

texts:
I am using flags by the Flag module. I added two action on that flag through Flag actions:

The first one is to send an email to the site admin whenever the node is flagged.
The second is to do a Page Redirect. This action does not works and gives me an ajax error.

In my search I found this was an issue for flag module for Drupal 6. However, it still does not work. My version of Flag is 7.x-2.0 and I am using Drupal 7.

After trying out with action, I went for the better option, i.e, using Rules. I added a reaction rule with the action: A node is flagged under "my_flag" and the event : Page redirect. And I also checked the forced redirect. Its still not working.

Would really appreciate any help or suggestions regarding this.


texts: how to create a link to mysite/user and how to theme mysite/user?

texts:
I have searched for this for some time and the only thing that pops up is how to create/customize your own login/register page.

I would like to add a link to the default Drupak 7 login/register pages and keep the default Drupal 7 login page (mysite/user) and registration page (myste/user/register). Furthermore, I would also like to add some fields to them.

I am currently using the LoginToboggan module and it has provided some help. Could someone please tell me how I can create a stand alone link that i can theme on the front page that will take a user to login/registration pages?

For example, I would to display something of the following on the front page:

login | register

So both 'login' and 'register' are stand alone links that appears somewhere on the front page and can be themed. but when clicked on, they will take the user to mysite/user (for login) and mysite/user/register (for register)

Thank you any help would be appreciated.


texts:
I'm generating the URL inside a controller in a custom module. The URL I generate is to pages on the same site, but not in the module. I want to append an arbitrary number of slugs to the end of the base URL. Some slugs depend on the return values from other API calls, so there's no way to predict how many there are, or what they will be.

I want to generate a $url variable of the form:

'www.base-path-of-website.com'/any/number/of/arbitrary/slugs

I have tried using:

Url::fromRoute()

But cannot figure out how to get the base route for the website from it. Or how to add arbitrary slugs.

This was trivial in Drupal 7 and earlier, but I cannot find how to do it in Drupal 8. In Drupal 8, how do you generate arbitrary internal URLs from a module?
What should I be doing?


texts:
I'm working on an existing website. So before I started I copied all files and database to my local environment. So far so good. To port the changes over I'd planned on using features. For a number of reasons the project got slightly off track I can't no longer migrate the features using the features module. Other than trying to fix why I can't port the features to the live site, I've been wondering whether is there a way to sync the two databases (effectively moving all the content - nodes, taxonomies and users - from the live site to the local site). I've tried Migrate Drupal to Drupal but the content wasn't imported. (I'm also looking at why it didn't work) but my question now is:

Are there any options to do it ? How ? (Other than Migrate Drupal to Drupal or using Features to migrate the features over)?


texts:
I am using Drupal 8.1.1. I have made a copy of the Bartik theme and enabled that theme and using that as default theme.
I want to disable the RSS feed-icon. I was hoping to find some control/code in the templates folder to disable the RSS feed icon, but could not find anything like that. (Though there is some reference to feed-icon in theme.libraries.yml).

Can someone suggest how to remove the RSS feed icon in Drupal 8.1.1?
Thanks.


texts: How to get relationship id in views drupal 7?

texts:
I am using User relationships module and created relation friends. Where we can send and receive friend requests just like fb. So l have created view to list all my-friends and also added remove link to the each friend. In view "status link (action)" field is providing remove link which can be used to remove the particular friend from our friend's list, but the link is not accessible to the users other than admin. I want to get relationship id (rid) in view so that I can create remove link. Is there anyone who knows the way to get rid? I just want to create url like below
myhomesite.com/user/26/relationships/1115/remove?destination=user/373/friends . where 26 is logged in user id and 1115 is the relationship id.Thanks.


texts: How can I implement a non-CRUD function in hook_service_resources()?

texts:
This question is similar to this question but I don't understand how the URLs are modified enough for the answer there to make sense to me.

The module adds retrieve and index operations by default.  I am attempting to extend privatemsg_services_resources with an additional option, unread.

I have added unread to the function as shown below, but I cannot figure out how to access it via URL.

function privatemsg_services_services_resources() {
  return array(
    'privatemsg' => array(
      'operations' => array(
        'index'    => array(
          'callback'        => '_privatemsg_services_get',
          'access callback' => 'user_is_logged_in',
          'args'            => array(),
        ),
        'unread'    => array(
          'callback'        => '_privatemsg_services_unread_count',
          'access callback' => 'user_is_logged_in',
            'args' => array(
              array(
                'name'        => 'uid',
                'type'        => 'int',
                'description' => t('UID of the user to check the number of unread messages for.'),
                'source'      => array(
                  'path' => 0,
                ),
              ),
            ),
          ),
        'retrieve' => array(
          'callback' => '_privatemsg_services_get_thread',
          'access arguments' => array(
            'get private messages from remote',
          ),
          'args' => array(
            array(
              'name'        => 'thread_id',
              'type'        => 'int',
              'description' => t('ID of the thread to be retrieved.'),
              'source'      => array(
                'path' => 0,
              ),
            ),
          ),
        ),
      ),
    ),
  );
}

When I go to www.myexample.com/drupalgap/privatemsg, I get the value for index.

When I go to www.myexample.com/drupalgap/privatemsg/THREAD_ID, I get the retrieve value for THREAD_ID.

When I go to www.myexample.com/drupalgap/privatemsg/unread/UID or www.myexample.com/drupalgap/privatemsg/unread, I get the message ["Invalid parameters passed."].

However, if I comment out the function for retrieve and then rename unread to retrieve (to test my code for unread), after clearing the caches, going to  www.myexample.com/drupalgap/privatemsg/UID gives me the number of unread messages.  So the code is OK, I'm just setting up the resource the wrong way.

How can I call both retrieve and unread from the URL?


texts: How do I add a custom html.node--.html.twig based on content-type?

texts:
I want to override the default html.html.twig according to my custom content-type.
But I only get suggestions like:

* html--node--16.html.twig
* html--node--%.html.twig
* html--node.html.twig
x html.html.twig

I have tried for file-name

html--node--content-type.html.twig

But this was not successful. Can anybody help?


texts: Getting the inverse of drupal_realpath (Drupal 7)

texts:
I know drupal_realpath is depreciated but as far as I can tell I cannot avoid using it.

I have a little module that will unzip a file and search the contents of the unzipped file and create content with the images it finds.  In order to search the unzipped directory tree I need to rely on standard php methods will not work with paths like 'public://..." so I need to use drupal_realpath to massage my paths into something drupal can handle.

When I actually create the image file I do not want to use the drupal realpath because this would obviously be problematic if I migrated to a different server.

Is there a way I can turn the realpath which will look something like this:

/Applications/MAMP/htdocs/drupal/sites/default/files/my_file.png

back into something like:

public://my_file.png

If not is there some way I can search a directory structure without using drupal_realpath?

EDIT:
So it seems that my problem may really only be with certain PHP lirbaries for example simpleXML.

$shape_xml = 'public://Arcade Projects/ender2012/AgentCubes/Open Arcade/Moonsweeper/version8/Moonsweeper/agents/Tutorial/shapes/Tutorial/shape.xml';

watchdog("file exists normal",file_exists($shape_xml));
watchdog("file exists real path",file_exists(drupal_realpath($shape_xml)));

In the above example, both watchdogs print 1, so it seems that file_exists works fine with the drupal path or the realpath.

But, if I call simplexml_load_file with the drupal_realpath like this:

$xml = simplexml_load_file(drupal_realpath($shape_xml));

everything works fine.

But If I call it like this:

$xml = simplexml_load_file($shape_xml);

I get the following error:

Notice: Trying to get property of non-object in harvest_icons() (line 775 of /Applications/MAMP/htdocs/drupal/sites/all/modules/custom/unzip/unzip.module).


texts: Using SQL how do I select the value of a translated field in a specific language?

texts:
Give an entity field that has been translated into the target language, how do I retrieve a specific language version using SQL - not php.

Give this query for instance (using an imaginary field called data on an entity form):

SELECT field_method_value
FROM entityform
LEFT JOIN field_data_field_method
ON entityform.entityform_id = field_data_field_method.entity_id

And assuming that we have a default language of English (en) and Spanish (es) enabled on our site, and that a translated value for the spanish version of the field is stored...

What SQL statement would return the Spanish version rather than the English one?


texts:
In Drupal 8 i would like to change the date format in cck date field of a custom content type . For example i would like to have french format d/m/Y . How can i do this ? I've try this code that i have found here https://www.drupal.org/project/drupal/issues/2646454 to a custom module but that 's  not working , nothing change in my field:

function mymodule_element_info_alter(array &$types) {

// Set defaults for datetime fields.

$types['datetime']['#process'][] = '_set_datetime_defaults';

}

/**

* Set defaults for datetime fields.

*/

function _set_datetime_defaults($element) {

$element['date']['#attributes']['data-drupal-date-format'] = ['d/m/Y'];

$element['date']['#date_date_format'] = 'd/m/Y';

$element['date']['#attributes']['placeholder'] = ["DD-MM-YYY"];

$element['time']['#attributes']['placeholder'] = ["HH:MM:SS"];

return $element;

}

Thanks for your help

Edit :
In admin/config/regional/date-time , i've create my custom date format but i'm not able to see it in manage form display . You can check attached


texts:
I have a view page and I want to show two content type same time. What I want is simple: I have two content types and these content types have own type fields. Like this:

Content Type 1 - Cars (this have a type field names "BMW")

Content Type 2 - Motorcycle (this have a type field names "Ducati")

I want to show all BMW Cars and Ducati Motorcycles at the same page. How can I do that with view filters? I try that but it is not working:

In my example;

Cars = Post

Motorcycle = Feed

BMW = Type (= iframe)

Ducati = Type (or foto, video, ...)


texts: Is it possible to disable File (Field) Paths for a certain field?

texts:
As I'm having a hard time using Filefield Paths together with Filedepot (see http://drupal.org/node/1572170) I'm wondering if its somehow possible to disable Filefield Path on a per-field (or content type) basis? Filedepot works nicely when FFP is disabled and puts its file inside its directory structure, but all other file fields should be processed by FFP.

If I could somehow disable FFP processing for the field "filedepot_folder_file" everything should work fine.

Regards,
Daniel


texts:
I had a very odd error where the image showed as style'ed but was using the wrong source image. When I deleted the style'ed image and reloaded the page, the correct image displayed and was style'ed.

I haven't figured out how to reproduce the error, but I am positive the source image didn't change.


texts: How to tell if a menu link is route: or not?

texts:
Trying to theme a menu in Drupal 8, running into a case where we need to add classes on certain links.

In the case of a menu link that is route:<nolink> we need to not add any class at all.

Example:

{% if item.below and item.url %}
 {{ link(item.title, item.url, { 'class':['link', 'link--arrow']} ) }}
{% else %}
 // not a link
{% endif %}

How can we tell at this level that item.url is route:<nolink>?

Update:

Current solution so far, is there a better way?

{% if not item.url.isExternal() and item.url.getRouteName() is same as('<nolink>') %}
  {{ link(item.title, item.url) }}
{% else %}
  {{ link(item.title, item.url, { 'class':['link', 'link--arrow']} ) }}
{% endif %}


texts:
I'm using Feed Importer to import data from a csv file, and I got this error

SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xA0 a TN...' for column 'message' at row 1

All values are in english characters, and I really don't know how to solve this problem

Help please. thanks


texts: Right now my nodes say published by "author name 19:02". How can I change it to display 12 hour time 7:02?


texts:
I have created a content type called "product". On this product, I need to create a "entity reference" field to other products, should this product be a bundled product.

For example, I might create a "Playstation 4" product, but add "Call of Duty" as a FREE bundled addon item. I want to then be able to specify the number of these "sub products" are applicable. For example, if you buy the playstation, I might have it come bundled with 2 copies of the exact same Call of Duty. So I need to be able to specify that all though Call of Duty is the bundled product, two of them are relevant.

How do I do that with Drupal, without using entity nodes (as they are very slow in practice)?


texts:
I have a node template, rendering a product list based on a query :

$productsQuery = db_select('commerce_product', 'p');
$productsQuery->join('commerce_product_type', 't', 't.type = p.type');

$productsQuery->fields('p')
    ->fields('t')
    ->condition('p.status', 0, '>')
    ->orderBy('p.created', 'DESC')
;

$results = $productsQuery->execute()->fetchAll();

foreach ($results as $product) {
    $productNodeQuery = new EntityFieldQuery();
    $productNodeQuery->entityCondition('entity_type', 'node', '=')
        ->propertyCondition('type', $product->type)
        ->fieldCondition('field_product', 'product_id', $product->product_id, '=')
        ->range(0, 1);

    if ($node = $productNodeQuery->execute()) {
        $node = array_shift($node['node']);
        // Render the node
    }
}

It is working well, but I do not access to the different fields of the product-display node in EntityFieldQuery...

For instance, In my product-display, I have a required relation to a taxonomy term, that I would like to display for each product.

How to get this specific field ?


texts: How to access node from hook_html_head_alter()?

texts:
I want to add an og:url tag to the <head> so that the correct image shows up when my page is shared on Facebook.

I've found the hook_html_head_alter() hook which looks like I can add something to the head. I don't see how I can access the node object though when inside this method. I want to check if this page is for a certain Content Type. If it is that type, then look at some of the data on that node to determine which image to put in the og:url tag.


texts: Like Modal Frame API in Drupal 6, is there a similar solution to load content in popup(without page refresh) in Drupal 7?


texts: Can't use node_page_edit in ajax callback function

texts:
I have an ajax callback function:

function mymodule_callback($form, &$form_state) {
    $nid = $form_state['build_info']['args'][0]->nid;
    $node = node_load($nid);

    module_load_include('inc', 'node', 'node.pages');
    $form = node_page_edit($node);
    return print_r($form, true);
}

(Please note that I'm returning from print_r as I'm trying to debug the problem).

This callback is being run from a form submit:

function mymodule_form_{my_form_id}_alter(&$form, &$form_state, $form_id) {
    $form['actions']['submit'] = array(
        '#type' => 'submit',
        '#value' => 'save',
        '#ajax' => array(
            'wrapper' => 'my-form-id',
            'method' => 'replace',
            'callback' => 'mymodule_callback',
            'effect' => 'fade'
        ),
        '#submit' => array('node_form_submit'),
    );
}

When I submit the form I get an AJAX error which says 'cannot unset string offsets' in field.default.inc. I know that the node_page_edit function is causing it because when I remove it the error doesn't happen.

Interestingly, if I press the submit button again straight after getting this error, it works - and the full structure of the form is loaded in to my div.

Why doesn't it work the first time and how do I fix it?


texts: How to apply Simple Regex Filter to forum signature?

texts: I'd like Simple Regex Filter to be applied to Signatures for Forums to close the loophole for human post spammers on my drupal 7 forum. How to achieve it?


texts: Is there a filter input to properly embed MP4 to a browser?

texts:
I'd like to use input filter emfield to allow users to embed video content (local on server) but can't seem to find the proper syntax for this input filter. Can anyone point me to an online example?

For example, in the main Content Textarea (CKEditor or TinyMCE), my users would like to key in [[video:/sites/default/files/video/introduction.php]] and have it rendered in an HTML5 <video> and <source> tags.


texts: Mobile Tools frontpage for mobiles problem

texts:
I have Mobile tools 2.x-dev version installed at this moment.

Device detection and theme switching is working properly. But frontpage for mobiles specified in mobile tools settings, does not work. In mobile version I'm viewing desktop version frontpage.

I'm using m.domain.com for mobile version.

Also I noticed that if I go mobile frontpage URL (which is /mobile), I also receive desktop version frontpage (which is /front).

Edited: this is bug. http://drupal.org/node/1197570


texts: Module for floating vertical and customizable image menu

texts:
I'm looking alternative module to ShareBar (but not for social network buttons).

The features should include:

floating image menu items/buttons (like: Menu Icons) on the side linking to pre-defined paths/URLs
ability to add new menu elements
visible to standard user (including anonymous), not like Quickbar which is for used for admin

Something like having Back To Top or SnapEngage floating button, but with multiple menu items grouped together which are customizable.

Which modules can provide such features? Or how this can be achieved?

In summary, like this:

Image source: Floating Social Share for Drupal

but beyond social buttons (so any button/menu item with any image/link can be added).


texts: Why does managed_file not respect the #upload_location?

texts:
I've got a managed_file, with an #upload_location set to 'public://uploads'. When I upload files using the managed_file form element, uploaded files get copied to the 'public://' root, but not the subfolder 'uploads'.

I've got the below piece of code, which happily uploads files to 'public://', but not to 'public://uploads/'.

function mymodule_admin_form_submit($form, &$form_state) {

  $form['search_results']['file_upload'] = array(
    '#type' => 'managed_file',
    '#title' => t('Thumbnail'),
    '#default_value' => variable_get('file_upload'),
    '#upload_location' => 'public://uploads/',
  );

  $form['#submit'][] = 'mymodyle_admin_form_submit';

  return system_settings_form($form);

}

/**
 * Form submit handler.
 */
function mymodyle_admin_form_submit($form, &$form_state) {

  if (!empty($form_state['values']['file_upload'])) {

    global $user;

    $file = file_load($form_state['values']['file_upload']);
    $file->status = FILE_STATUS_PERMANENT;
    file_save($file);
    file_usage_add($file, 'mymodule', 'user', $user->uid);
    variable_set('file_upload', $file->fid);
    unset($form_state['values']['file_upload']);

  }
  else {
    $file = file_load(variable_get('file_upload', ''));
    if ($file->fid) {
      file_delete($file, TRUE);
    }
    variable_set('file_upload', '');
  }

}


texts: Access a specific property of the article node

texts:
I need access to a specific property of the nodes of articles/post (the text in this case). But I can only access the complete node object and print all the properties, I think I need to access a variable of the node but I don`t know how to nominate this variable loaded of the DB of the web.

The code:

<?php if (block_get_blocks_by_region('content')): ?>

<?php  print render(block_get_blocks_by_region('content'));
 ?>
<?php endif; ?>

<?php
$type = "article";
$nodes = node_load_multiple(array(), array('type' => $type));
foreach($nodes as $articles):
?>
<?php print $articles->nid; ?>
<?php print $articles->title; ?>
<?php print $articles->page; ?>
<?php print $articles->safe_value; ?>
<?php print_r($node)?>
<?php
$nid = $articles->nid;
$node = node_load($nid);
$node_tpl_output = node_view($node); ?>

<?php endforeach; ?>

I try put to print for any article/post a specific footer or info.

Thanks for all


texts: Node titles are erased when I update a field with entity_metadata_wrapper

texts:
I've written a script which fetches data from a REST API and uses it to update a field in a node. The website is multilingual (Canada English, Canada French, Australia English and US English) with US English as the default language. When I run the script with drush, it updates field_gj_metro_id with the correct value from the REST API, but for all nodes with languages other than US English, it deletes the node title.

What am I missing in my script that would take care of the language settings so that the titles will be unaffected?

function fetch_metros() {
  return gj_api_request('GetMetroList', $arguments = array());
 }

$metros = array();
$metros = fetch_metros();
foreach ($metros as $metro) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'gj_locations')
    ->propertyCondition('status', 1)
    ->propertyCondition('title', $metro['metroName'])
    ->propertyOrderBy('created', 'DESC')
    ->fieldCondition('field_display_in_listing', 'value', TRUE);
  $result = $query->execute();

  if (!empty($result)) {
    $nids = array_keys($result['node']);
    $node = node_load($nids[0]);
    $node_wrapper = entity_metadata_wrapper('node', $node);
    $node_wrapper->field_gj_metro_id->set($metro['metroID']);
    $node_wrapper->save();
  }
}


texts: Form API submit handler does not get called

texts:
I am using FAPI with dynamic fields. The code I am using is:

function email_action($form, &$form_state) {

$result = db_query('Select * from my_action_plan_settings ORDER BY action_type');
$records = array();
foreach ($result as  $record) {
  $records[] = $record->poa;
}

for ($i = 0; $i < count($records) ; $i++) {

  $form['action'] = array(
    '#type' => 'fieldset',
    '#title' => t('Action #@num', array('@num' => $i)),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );

  $form['action'][$i]['poa'] = array(
    '#type' => 'textfield',
    '#title' => t('Point of Action'),
    '#default_value' => $point_of_actions[$i],
    '#description' => t("Enter first name."),
    '#required' => FALSE,
  );
  $form['action'][$i]['email'] = array(
    '#type' => 'textfield',
    '#title' => t('Email Address'),
    '#required' => FALSE,
  );

}

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

return $form;

}

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

The submit handler never gets called, I used a custom submit handler also, it does not get called. If I limit the count of loop to 20, the submit handler gets called and everything works fine but without breaking the for loop, the submit handler never get called, is there a limit to number of fields? Or am I doing something wrong. Not sure what the issue is.


texts: Check if a field group's subfields have values

texts:
Is it possible to check if a fieldset's subfields have values?
If none of the fieldset's fields have values it would return null.

$field = field_get_items('node', $node, 'group_name');
if ($field) {
   // At least 1 of it's sub-fields has a value!
}
else{
   // None of it's subfields have values!
}


texts: Any kind of sorting gives duplicate results in Views (Search API)

texts:
Problem

My view based on Search API is giving me duplicate results. I get duplicate results if I use the following things in combination:

A pager
A sort of any kind. e.g. Sort by ascending integers, sort by descending select field etc.

Sometimes I get a couple duplicate results, other times entire pages are identical.

According to the module page I should be able to use view sorts on single valued indexed fields, but I can't seem to get this to work at all.

Has anyone else run into this? How did you solve it?

Common solutions for duplicate results

Most of the solutions I've spotted for this involve options which don't appear for Search API. They usually involve adding aggregation or distinct filters in the Views options.

The possible solution here fails. The problem is it searches for duplicate results only amongst the current page of the view.

i.e. if I get 60 nodes on a search with a pager of 15, this splits into 4 pages. If the duplicates are on pages 1 & 3 then they're not spotted.


texts: Unable to get titles to show up as higher priority in search than content

texts:
I have a website I am working on that has a TON of content. The client has noticed that when searching for titles in the site search, it seems to prioritize the body content over the title.
So I changed the search index for titles to be fulltext with a boost of 13. With the rendered output set to a boost of 1. Then I reindexed and that didn't fix it. I did a full rebuild of tracking information. Same problem.
I found this article: https://medium.com/@easternstandard/how-to-configure-drupal-8-text-search-to-return-better-more-intuitive-search-results-fe0a78136ad7
And followed the instructions there (pretty much what I had already done) and reindexed. Same issue.
An example of this is that we have an article about the response to covid where the phrase "response to covid" is part of the title. When I search for that phrase I do not see it in any of the first-page search results. It is set to show 20 items. In fact, the article in question doesn't come up until result number 39. None of the prior articles seem to have covid in the title at all. Even searching with quotations makes no difference.
This is currently using the database search/index. I am tempted to implement Solr. But that is a whole-nother ball of wax and I am on a deadline right now.
We are running Drupal 8.9.9 and the Search API 8.x-1.18.
What can I do differently to make it value the title over the rendered content?


texts: How do I recreate the navigation function of Book Module while using Entity References?

texts:
I'm recently been recreating a bunch of my sites functionality and decided to move away from Book module. It seems to get no love and nothing I need to work with seems to work with it for no apparent reason. So I moved over to just using Entity References.

I'm managed to recreate the Child page listing but I really need to add navigation to inside the structures as well. I need the next previous navigation links and I'm trying to create a jump menu for all entities that reference a story page.

I could use some advice, or documentation linking to somewhere to help explain more of this.


texts: What alternative do I have to the Private Taxonomy Terms module?

texts:
I am developing a Drupal site in which every authenticated user must have the privilege of creating new taxonomy terms, and only those taxonomy terms created by the user are shown on the content type. It should work exactly like the Private Taxonomy Terms module.
The issue with that module is that it doesn't work with the Services module, and I need it.

Is there a module available for this purpose, or should I create a custom service for this purpose?


texts: How to get the URL of a file located in the theme folder?

texts: Is there a way to get the URL of an image located in the theme folder? Or just get the URL of the theme folder?


texts:
I use Drupal 8 in French and I have never managed to delete the word "ago" which means nothing in French.

How to remove the word "ago" in drupal 8?

When I created a duration since, drupal added "ago" at the end of the date.


texts: Getting Miss always in varnish cache for the page using REST API

texts: While hitting URL using REST API, it is always giving Miss for varnish cache for specific path and giving response from Memcahce. In header if we can check for cache-control we are getting "must-revalidate, no-cache, private". Can someone guide us what exactly the issue or help us with the solution.


texts: Where are the field labels and descriptions stored?

texts: I have been exploring Drupal 8 and it's tables lately. The config table has the storage information serialized as blob. But it doesn't store the Label or Description of a field. Where can one find these data? Is there a core function which helps in fetching all these data for a particular content type?


texts: How do I set my custom input type as default?

texts: I strongly need to use my custom type as default. How do I set it as default?


texts: Create a separate view for each primary menu based on URL aliases in drupal 7

texts:
I have created a taxonomy menu in drupal 7. Let say the main menu has technology and market data.

Let say Technology has sub menu as security and security has test1 and hello as sub menus and so on.

-Technology       URl: http://localhost/drupal/taxonomy/term/1
     -- Security    URL: http://localhost/drupal/taxonomy/term/2
         --Test     URL: http://localhost/drupal/taxonomy/term/3
         --Hello    URL: http://localhost/drupal/taxonomy/term/4

Market data also has the same hierarchy.
These are the values I have set while creating the view

    Format:

      Unformatted list | Settings

      Show:Content | Teaser

    FILTER CRITERIA
      Content: Published (Yes)

      Content: Type (= Article)

      Content: Has taxonomy terms (with depth) (or Technology, ...) | Settings

    PAGE SETTINGS

      Path:/taxonomy/term/%

      Menu:No menu

      Access:Permission | View published content

    CONTEXTUAL FILTERS
      Content: Has taxonomy term ID (with depth)

After creating this view I am able to see the view in all pages (Technology,Security,test1,Hello) I am able to display article as mention in point 1.

Now I replaced the url with automaic url aliases and the url it generate the following URL.

        -Technology       URl: http://localhost/drupal/technology
             -- Security    URL: http://localhost/drupal/technology/security
                  --Test     URL: http://localhost/drupal/security/test
                  --Hello    URL: http://localhost/drupal/security/Hello

Now I replaced the view with following settings

     Format:

   Unformatted list | Settings

   Show:Content | Teaser

FILTER CRITERIA
   Content: Published (Yes)

   Content: Type (= Article)

   Content: Has taxonomy terms (with depth) (or Technology, ...) | Settings

 PAGE SETTINGS

   Path:/technology/%

   Menu:No menu

   Access:Permission | View published content

 CONTEXTUAL FILTERS
   Content: Has taxonomy term ID (with depth)

Within  Has taxonomy term ID (with depth) has the following settings:

     WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED
       Override title:    %1
     Specify validation criteria

      Validator

         Taxonomy Term

      Vocabularies

         Home Page Main Menu

      Filter value type

         Term name converted into ID

   I have selected the Transform dashes in URL to spaces in term name filter values also.

But the problem is I am not able to overwrite the taxonomy pages.

Can anyone help me what I have missed while creating the view.


texts: How to use Drush for Particular Project?

texts:
In my loalhost there are few drupal 7 sites installed.

Suppose I have projects A,B and C then how to use for A,B Or C etc.

How to use Drush by project wise?


texts: template.php hook to add variable to view

texts:
I'm trying to include the total count of a given node type into a view tpl.php file. I would like to set this variable in the template.php file, so that it is available in the tpl.php file (that way I also don't have sql queries gumming up my template files, which I'm trying to avoid.)

I'm trying to set them the variable with template_preprocess_views_view, but the reference variable never seems to be getting updated. I did some sleuthing and threw in some dpm statements, one in the preprocess function, one in the template, and the result looks like this:

template
preprocess views_view
preprocess_views_view__home_image

(The thrid line prints out the preprocess function with the view name attatached)

So it looks like the issue is the template is being called before my preprocess functions, which means the variable hasn't been updated it yet, but is that correct? Shouldn't the preprocess function be called BEFORE the template is called? Is there another hook that I can use to add a variable to views-view-fields.tpl.php?


texts: How to display contents which matches the path alias of a content from URL using views contextual filters?

texts:
I have a content type "basic" and have contents with different URL alias
for ex:

  www.example.com/news/newsletter/title;

  www.example.com/content/title;

both are same type. I need to create a view page and the path for that view page is news/newsletter, In this page I want only the content which having the path alias news/newsletter. How can we get the content?

Thanks.


texts: Cannot log in site despite having credentials from settings.php

texts:
Ubuntu 16.04, Drupal 8 managed through ISPConfig 3.1

I'm trying to log in at mysite.com/index.php/user/login and I get bad username or password. I have copied and pasted from the settings.php file and everything.

This is a box that was setup for me by someone else who, when asked for the credentials, directed me to just get them from settings.php.

The only thing I can think of is that I'm somehow getting a site-login instead? But it's a fresh Drupal 8 install with no config.
Is there any other source for the password or alternate password for it?

I've tried going through ISPConfig and changing the database password there but it just breaks the whole site:

  “The website encountered an unexpected error. Please try again later.”

So I just revert to the snapshot.


texts: Ubercart shipping API, get the package object with php to send the tracking number to the client as email

texts:
I have an online shop implemented in Ubercart 6.x-2.4 and Drupal 6.19

All cool everything works but I'm struggling to do custom things

What I want to do is after saving the shipment data (i'm insterested in sending the Client that the package has been sent and he has to receive by email the tracking number)

So I added a predicate that does just that, but I don't know how to get the shipment object associated with the order and get that tracking number. I just know that there is an API somewhere...


texts:
I am using Google Cloud Messaging for one of my projects. I think I have configured everything correctly. I am getting the following error when I tried to send some message.

  Notice: Undefined offset: 1 in gcm_action_send_message()

I can't find any information in the module documentation.


texts:
Giving all of the other components are simple. However the radio button seems a bit challenging.  I've added class to the following

.checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"], .radio input[type="radio"], .radio-inline input[type="radio"] {
margin-left: -20px;
position: absolute;

however doesnt seem to work. I'm looking for an HTML5 style layout.


texts: Why can I not find all fields shown under "Manage form Display" under "Manage fields"?

texts: When I try editing a content type in Drupal. I' can't see all the fields available under Manage Display in Manage fields? Is this a wanted behaviour or a bug?


texts: How to make full text search case Insensitive

texts:
I'm using Search api (8.x-1.0-beta3) and Database Search (8.x-1.0-beta3). I have created DBIndex Server and created index for content type 'Test' and then created search index view with filter 'Full text search'. But I observed search is case sensitive. How to make this search as case insensitive.

Thank you in advance.


texts: Setting link target through views programatically

texts:
I have a text field that turns its value into a link, provided it's an absolute link. For some reason, setting the target to blank is not working. Am I doing something wrong? I set the target inside the array.

elseif (valid_url($row->{$view->field['field_myDoc_link_value']->field_alias}, TRUE)) {
  $fields['title']->content = l(
    $fields['title']->content,
    $row->{$view->field['field_myDoc_link_value']->field_alias},
    array('target'=>'_blank', 'html' => TRUE)
  );
}

Or would I set it somewhere else? Thanks!