texts: Migrate different content types from other CMS

texts:
I want to migrate content from a non-Drupal CMS to Drupal 8 using the Migration API. In the source CMS, I have different types of content that I have to map to Drupal 8 content types. The navigation needs to be migrated, too. Thats a task, I already finished. During the process, I create a page type for every menu_link_content like so:

# Migration configuration
id: navigation_main
label: Main navigation
migration_group: test

source:
  plugin: url
  data_fetcher_plugin: http
  data_parser_plugin: json
  urls: 'http://my.url.com/migrate/structure?start=841'
  item_selector: data
  fields:
    -
      name: tid
      label: 'Unique element id'
      selector: tid
    -
      name: nav_title
      label: 'Element title'
      selector: nav_title
    -
      name: path
      label: 'ID Path from root down to given id'
      selector: path
    -
      name: parent_tid
      label: 'Parent id'
      selector: parent_tid
    -
      name: elementtype_unique_id
      label: 'Elementtype'
      selector: elementtype_unique_id
  ids:
    tid:
      type: integer

destination:
  plugin: entity:menu_link_content
  no_stub: true

process:
  bundle: menu_link_content
  title: nav_title

  menu_name:
    plugin: default_value
    default_value: main

  'link/uri':
    -
      plugin: migration
      migration: page_node # Use different migrations here
      source: tid
    -
      plugin: generate_path

  route_name: '@route/route_name'

  ...

That works as expected. The page_node migration uses the same url as the navigation_main migration. But thats not what I want.
Now, I need to create different content types depending on the source "element_type_unique_id". Each row needs to fetch its data from the source CSM via HTTP GET first (using the "tid" as indicator), e.g. http://my.url.com/migrate/element?id=1234. The Response gives me all the data I want to migrate to Drupal 8 according to the elementype in the source CMS. I think I have to write a migration for every type but I don't know how and where to connect them in the migration process.

Is this possible? Thanks for your help!


texts: Views gives 200 instead of 404 if incorrect argument and a pager is present

texts:
I am using with success the global null variable as described here
How do I set my views to return a 404 using Global: Null under contextual filters?

The solution by Kiam works fine, until a pager is added.

So,
myviews/mybadarg returns 404, but
myviews/mybadarg?page=2022 returns 200

Any tips why?

I tried enabling and disabling pager but no luck.


texts: How to prevent user point totals from going below a threshold for a given user?

texts:
I'd like to set an absolute floor for an individual user points (using the User Points module). Specifically, to make it impossible to have a total number of user points below 1.

In Drupal 6 there was the userpoints_no_negative module in Userpoints_contrib, but this was removed in favour of Rules integration for 7.x (https://drupal.org/project/userpoints_contrib).

The documentation provides an example using rules to evaluate point totals with a condition of "Userpoints - Compare current Userpoints"  (https://drupal.org/node/874390), but I am not finding this condition available.

I'd accept any solution, be it using rules or a custom module.

EDIT 2/4/2014 9:17PM UTC - Example code based on ramesh babu's accepted answer:

/*
 * Implements hook_userpoints().
 * Checks if points at minimum threshold, corrects to 1 if pushed below limit.
 * Based on comments in Userpoints API documentation on D.O. a separate transaction
 * is made to correct for the threshold rather than modifying the points for
 * the existing transaction.  See https://drupal.org/node/206558
 */
function mymodule_userpoints($ops, $params) {
  if ($ops == 'points before' && !isset($params['threshold'])) {
    $future_total = userpoints_get_current_points($params['uid'], 'all') + $params['points'];
    if ($future_total < 1) {
      $params['description'] = 'Minimum point correction.';
      $params['points'] = abs($future_total) + 1;
      $params['threshold'] = true;
      userpoints_userpointsapi($params);
    }
  }
}

The documentation for the Userpoints API on drupal.org is also a helpful resource https://drupal.org/node/206558


texts:
I have a situation where I need to remove (via client request) the letter count in the header of a view based on Glossary view. How might I remove the numbers (in parenthesis)

Previous question history: Paginate views by first letter of Node title


texts: How to check if a referenced entity is being used in other places?

texts:
I have a paragraph component that has a single field (reference) that calls on other paragraph components. I'd like to remove one of the paragraph reference field options so that users do not accidentally select it, however, when I do this I start receiving errors across my multisite environment that a reference no longer exists. Is there a quick way to check if a paragraph (or any entity) is being used and in which places (preferably one that shows paths) so that I can remove the reference before deleting this paragraph reference option from my paragraph component?

Any and all assistance would be greatly appreciated, thanks!


texts:
How do I make complex taxonomy searches? Simplifying my drupal database to the following example (number in quotes are the taxonomy numbers assigned by drupal):

Nodes = Blogs, Stories, Questions, Forums

The following are taxonomy dropboxes

Author = A.Tan(1), B.Chua(2), C.Smith(3), D.Perez(4)
Category = Gadgets(5), Food(6), Movies(7), Entertainment(8)

I want to make a complex search for example all Blogs by B.Chua pertaining only to Movies category? I could almost do this with the advance search since it allows checkboxes to search particular nodes and taxonomy however would not accept a blank or asterix as a search word.


texts:
I want to add Javascript in Head Tag. I found answer as below from this link

How to add script to <head>? , but it is not working used in tempalte.php.

function mytheme_preprocess_page(&$vars, $hook) {
    drupal_set_html_head('<script type="text/javascript" src="http://use.typekit.com/12345.js"></script>');
    $vars['head'] .= drupal_get_html_head();
}

Can we do adding Js script in head tag through page.tpl.php? or any suggestions


texts: jQuery_ui slider doesn't load for anonymous user

texts:
In my recent drupal 7 install... I've installed jquery_update. I configured it, and added a little module with a js.

jQuery_ui is not loaded for anonymous use. I've done some researches on the web ... for most people jquery doesn't load for anonymous user because it wasn't called. But for me jquery loads correctly I can alert(jQuery("#amount")) succesfully.

My error message is TypeError: jQuery(...).slider is not a function : jquery_ui slider method is not loaded for anonymous user... I searched in permissions too.. no jquery_ui permission configuration.

What did I missed ? Couls anyone help ?

Thanks in advance.


texts: How to extend default user registration page in Drupal 7?

texts:
I would like to extend the default user registration page by adding more fields that will be stored in the same users table of database with the default fields.

What is the easiest way to do that? Could explain how to achieve this?


texts: Display and submit a Webform as part of another form?

texts: I have a form that users submit to build a custom entity. I need to add an optional Webform to the bottom of my form. When my form is submitted, I need to save the custom entity, then set a hidden Webform input with the new entity ID and submit the Webform. Should I do this with Subform?


texts: How can I set a webform's field value by query parameter?

texts:
I have created the query string for the particular fields.

My URL : www.examples.com/path?title=something

How could I pass the "title" query string value to webform field's default values.


texts: Should views search specific caching skip preprocess?

texts:
Problem

I have a view powered by the Search API, which uses the views inbuilt caching - "Search Specific" in order to provide better performance.

However I also run a number of theming alterations in:

theme_preprocess_views_view_unformatted

However this code appears to be skipped when the views caching kicks in. Is this by design or an I encountering a bug? If it's not, how have people gotten around this sort of thing before?

Re-creation

Clear all caches Load page - Code runs correctly
Refresh the page a number of times usually between 2 & 5
Refresh the page - Code is skipped

I've been testing if the code is skipped by including:

function theme_preprocess_views_view(&$vars) {
  ...
  watchdog('test', 'This chunk of code has just run');
  ...
}


texts: Adding members to a group dynamically in Drupal 8

texts:
I am trying add members to a group programmatically using Groups module in Drupal 8, and I am doing the following to achieve this:

use Drupal\Core\Entity\ContentEntityBase;
$roles = array('test_role');
$values = ['group_roles' => $roles, 'gid' => 1];
$account = $this->createUser();
$group = \Drupal\group\Entity\Group::load(1);
$group->addMember($account, $values);

So, users are already present in the site. I want to add only those users to a group who have successfully paid for it. Hence, I am trying to write a custom solution that I add a user to an already existing group on the site. I came across this addMember($account, $values) function in the group module, however am still not sure on what values its arguments ($account and $values) take. Above piece of code does not add users to my group. Can someone please suggest what wrong I am doing here?


texts: How to compare a field value with each title values?

texts:
I need to compare two field values.

Let's say I have a content type named "Specimen".
The content title is the accepted name of that specimen.
A second field, named Synonyms, can be filled by users to suggest synonyms for the accepted name.

What I need is a field validation with that kind of test :
If the synonym matches any title of that content type, then display a message (That synonym is actually an accepted name already entered in the database) and invalidate the value entered. Else, the synonym is valid and can be entered in the form.

I know Uniqueness which is a great module to compare titles between them but not between a CCK Field and each title (unless I missed something?)

I have tried to configure a test with the module Field validation but did not manage to get a nice result, even with the test "Match against a field". Maybe it was not set properly.

I guess that Rules can be my friend too but for now, I have always created very simple rules. So I would appreciate any help to build this test.


texts:
I have installed Drupal 6.19 and 6.20; in Drupal 6.19, I can see the page title like "site title|page title", but in Drupal 6.20 the page title "site title".

How can I add the node title to the page title in Drupal 6.19?
I didn't use Page Title in Drupal 6.19, nor did I in Drupal 6.20.


texts: Theme not working when using non-standard port number

texts:
I've been having some performance issues with my local WAMP install and saw a suggestion to move Apache to a different port.  I achieved this by updating httpd.conf:

Listen 89
ServerName localhost:89

I also update my vhosts to use the new port:

<VirtualHost *:89>
    ServerName mysite.local
    DocumentRoot "D:\wamp\www\mysite"
</VirtualHost>

This works.  I can now access the site via mysite.local:89.  However, the site appears unstyled because the CSS and JS files are not linked properly. For example, the following CSS file cannot be found:

<link type="text/css" rel="stylesheet" href="http://mysite.local/sites/default/files/css/css_0-h4tIT-Kdty3gonMCX41fM-7MgTrV9BMd5XQoTqeaQ.css" media="all">

I need the CSS and JS to use mysite.local:89 instead of mysite.local.  When I change this manually via the web inspector it works.

How can I change the CSS and JS imports to use the new port?

Update on WAMP Slowness

For anyone who is interested, WAMP is running much better now. I followed the recommendations in the following article (specifically, I disabled IPv6, put all host file entries on one line, moved Apache to a new port): http://devside.net/wamp-server/wamp-is-running-very-slow


texts: I've been using EntityFieldQuery to query my fields but I need the SQL 'like' operator.  For this I'm querying the database manually.  Question:  How do I get the name of a field's table?


texts: Unable to use rules to update field after the first update

texts:
I currently have a field that shows the last updated date on a user edit page.

I'm using the current configuration for rules.

Event:
    After updating an existing user account
    After saving a new user account

Conditions
    Entity has field
      Parameter: Entity: [account], Field: field_last_updated

Actions
    Set a data value
      Paremter: Data: [account:field_last_updated], Value: now

It works great the first time but subsequent updates do not update the last_updated field with the current time. Is there something I'm doing wrong?


texts: I really need to create a cart system without payment methods , I only want to get an order email from the user. Is there any modules in drupal 7 to do this?


texts: some node image missing after node convert batch

texts: I have convert 50,000 nodes from one content type to another and mapping each and every fields. but after batch complete, some images migrate but some not. how i will fix this ? am i run migrate again ?


texts: How to export recent logs report in csv file drupal 7

texts:
Download all recent logs messages into csv file which is stored in database in Drupal 7
admin can filters records  and all records and filters records should be export in csv format


texts: Updating non-required fields via Services/JSON

texts:
I am using Services 7.3 and REST server to add new authenticated users via POST. All is working well except for the "customer" user field (boolean) that isn't required (and is actually hidden on the User Registration form). This is what my Json looks like:

"field_customer":{
   "und":"1"
}

But the field value of the newly created user remains unchecked. As soon as I turn the field into required, this same exact code works and the field value on the new user becomes checked. I've tested it with another test field and the result was the same - if the field isn't required it won't save the data to the new user.

I've tried to look through Services code to see why this would happen without success. There is a similar issue here: how can I update user global fields in drupal services?
but it was never answered and it also deals with updating existing users via PUT.

Has anyone else had problems with non-required items on user creation via REST? Am I doing something wrong here which I have overlooked, or is this a bug?


texts: Why do I see the node ID on the menu URL instead of the path alias?

texts:
I created different menus and need them to be displayed in a node based on the language currently visited for a specific node type.
Via my theme.theme, I added the following code to retrieve the menus:
if($lang == 'pt') {
   $recipe_block = \Drupal\block\Entity\Block::load('recipespt');
   $variables['recipe_menu_block_view'] = \Drupal::entityTypeManager()->getViewBuilder('block')->view($recipe_block);
 } elseif($lang == 'es') {
   $recipe_block = \Drupal\block\Entity\Block::load('recipeses');
   $variables['recipe_menu_block_view'] = \Drupal::entityTypeManager()->getViewBuilder('block')->view($recipe_block);
 }

Then I went into the node template and pulled the menus:
{% if content.field_product_type['0']['#context']['value'] == 'Recipe' %}
  {{recipe_menu_block_view}}
{% else %}
  {{cocktail_menu_block_view}}
{% endif %}

When I visit the main site(English) the menu links look ok.
But when I switch language and hover over the menu, instead of seeing the URL alias I am seeing the node id.
How can I pull the menu through the .theme and see the node alias instead of the node alias?


texts: Storage API + Services 3: How to work together?

texts:
I am trying to set up a site that will be storing a large amount of images. I am using Storage API module for that and It is working fine through web.

Now I need a REST Service to upload images.
I am trying with the default file POST endpoint of the Services module:

--> POST http://example.com/api/file http/1.1
Content-Type: application/json
Content-Length: 343901
Cookie: ..............
X-Csrf-Token: .........
{"file":"iVBOR.......Jggg==","filename":"myimage.png","uri":"storage-field-images://myimage.png"}
--> END POST (343901-byte body)

<-- 200 OK http://example.com/api/file (888ms)
Content-Type: application/json
{"fid":"81","uri":"http://example.com/api/file/81"}
<-- END HTTP (74-byte body)

But http://example.com/api/file/81 is responding me:

{"fid":"81","filename":"myimage.png","uri":"public://myimage.png".........

(Not the same uri that I sent in the request)

Am I missing something in the resquest? Or do I have to develop a new endpoint to manage that?


texts: How do I use a term as contextual filter correctly?

texts:
I'm using Drupal 8.
I have a book content type that uses a vocabulary called "book type" as an entity reference field.
I have basic page content type which also uses the the vocabulary "book type" as an entity reference field.
So both of the content types are using the same vocabulary.
What I'm trying to do is filter the books by the chosen book type on the basic page content type, but I just can't figure it out. Here's what I tried.

This is the book content type, which uses the vocabulary "book type" in an entity reference field

This is the basic page content type which also use the vocabulary "book type" in an entity reference field

This is my second try with the help of prkos:


texts: How to override a module theme function in a custom module but still allow themes to override the template file?

texts:
I'm writing a fairly simple module which allows the removal of colons from field output on a per field basis and I need to override the core field module's theme_field function in my module.

I can modify the theme registry with hook_theme_registry_alter() and change the field function to point to my custom function. Unfortunately once I do that I'm no longer able to override field.tpl.php in a theme.

The cascade I'd like to achieve is in order of template preference (most important first):

Active theme's field.tpl.php
My custom module's field.tpl.php (or custom_field theme function)
Field module's theme_field function

Is this possible?

This answer comes close but requires a differently named template which I don't want. I'd like to keep things clean for the themer so if they override field.tpl.php in their theme the output is as expected, rather than having to copy a different tpl file from my custom module.


texts: Menu that conditionally shows webform, or edit previous submission

texts:
How can I have a menu item "RSVP" that shows a webform, but after an authenticated user has submitted that webform, clicking on "RSVP" would now bring them back to their submission in edit mode?

rsvpdirect.info:

name = rsvpdirect
description = "Redirects webform nodes to edit if the user has already submitted it once before."
package = Custom
core = 7.x
files[] = rsvpdirect.module

rsvpdirect.module:

<?php

/**
* @file
* Forces redirect of webform node to edit the user's previous submission.
*
*/

/**
* Implementation of hook_node_view()
*/
function rsvpdirect_node_view($node, $view_mode, $langcode) {
  global $user;
  if ($node->type == 'webform' && $view_mode == 'full' && arg(0) == 'node') {
    $submissions = webform_get_submissions(array('nid' => $node->nid, 'uid' => $user->uid));
    $submission_count = webform_get_submission_count($node->nid, $user->uid);

 if ($submission_count >= 1) {
      // Get first submission
      $submission = reset($submissions);
      drupal_goto('node/' . $node->nid . '/submission/' . $submission->sid . '/edit');
    }
  }
}


texts:
I have created a custom block in the Drupal CMS. Say it is called "test_block". Is there a way to render this block in a template file using the name of the block?

Thanks,


texts: How do I get core to detect when a module adds a new service?

texts:
I created a module that we are using internally for at least two projects. I pull it in via Composer and it ends up in modules/contrib. The first install went great, but now I have added a few services so that I can use the Drupal DI container and when I update the module on the Drupal end (using Composer update) it says that the service doesn't exist.

I have tried running drush cr and drush updb to no avail. The services are defined in a mymodule.services.yml file and the original services were detected and used upon install. I have since added two more services and it is those two it does not seem to detect until I uninstall and reinstall the module.

Running drush cr does not seem to fix the problem, nor does drush updb.

Error in the logs is:

Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: "You have requested a non-existent service "endpoint.placeable.search"." at MY_SITE_PATH/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php line 157

Aside from uninstalling and reinstalling the module, what else we can do? Surely there has got to be a way to rescan a module directory for services changes.

To be clear, this is in Drupal 8.


texts: Does get_defined_vars() show variables defined in variable_set()?

texts:
I'm using Drupal 6, and I'm having problems retrieving a set of variables I set with variable_set() using variable_get(). I'm doing a dpr(get_defined_vars()) to see what's defined, and I don't see my variables; I see only the arrays $form and $form_state (this is inside hook_submit()).

Does get_defined_vars() show all the variables defined via variable_get()/variable_set()? I would just like to see a list of all of them. I just need to see if they've been set correctly, and troubleshoot why I can't retrieve them.


texts:
Cannot get node_mass_update(); to update Votes field. $node_ids is an array of node ids and $votes is a number.

    $updates = array('field_votes' => $votes);

    node_mass_update($node_ids,$updates);

My module fires and it tells me that nodes are being updated and gives me a progress bar, but the fields in the nodes are not updated.


texts: Way to integrate a latex-based wiki into a drupal 6 site

texts:
I have a website with users already designed in Drupal 6. We would like to add an area/module that would allow registered users of a certain type/category to be able to collectively edit/contribute to a set of wiki-based statistical documents, ideally written in LaTeX, but that other users (registered and anonymous) could download in the original LaTeX or exported to .pdf. (Imagine a wiki-based, open-source statistics textbook.) There are wiki modules and LaTeX modules for Drupal, but no LaTeX-wiki modules.

Is there some stand-alone wiki software that could be hosted on a sub-domain of our site but uses the Drupal user permissions to manage access? Is there a Drupal module or option I haven't found?

What we have:
Drupal 6 site that anyone can visit/see, but that requires registered user status to contribute/participate on site. We can add subdomains/create any databases, etc. needed on the servers to do what we need to do.

What we envision:
A wiki that allows a subset of registered users to collaboratively edit/write statistical texts easily (many of these users are already familiar with LaTeX) that will preserve mathematical equations and render them onscreen (.html) and as .pdf output.

Version tracking and attribution to particular users is necessary.

Any user can view .html of current wiki, or download the raw LaTeX file (for their own use), or choose certain wiki pages to be exported as .pdf.

Is there some stand-alone wiki software that would meet these criteria? And, if so, could we somehow use the same user database as our drupal install to set permissions? We anticipate hiring someone to do the programming necessary (our current Drupal developers do not do this level of development), but it would be helpful to know whether we're looking for someone to modify two existing tools to work together or to write a new drupal module that suits our needs.


texts: Views fields relationship and node reference count

texts:
I have two content types A (=leg) and B(=review). The later has a node reference(=field_leg) to A.
I'm building a view. I want to include a field which displays node count of review of each leg. There are other relationships in the views, and thus, I failed to achieve it.
You can see a related question of mine here.

Views result with the red ones are what I'm looking for.


texts: How to properly declare module settings with options list

texts:
In my ConfigFormBase derived class I want to add select list to settings form.

How should I declare it in mymod.config.yml file?

I've tried:

mymod.config:
  type: config_object
  label: 'Settings'
  mapping:
    test_mode:
      type: checkbox
      label: 'Turn on test mode'
    country_code:
      type: multiple
      label: 'Action site'
      value:
        - 1
        - 22
        - 34
        - 56
        - 107
        - 168
        - 181
        - 209
        - 228

and can I specify list as key -> value pairs also?


texts: Entities being stripped from formatted field

texts:
I have a formatted text field using the basic_html filter, which is set up like this:

It is removing HTML unicode entities, in the format &#x<hex>; for example, the Euro symbol is &#x80; which becomes €.

But this is not appearing in content. When I look at the source code, it is showing a little box, e.g. €65 becomes . But if I edit the node in CKEditor, it shows the Euro symbol there.

If I call $node->get('field_my_field') then I see the values is an array like:

$values = [
  'value' => 'Content\n<br />Example content: &#x80;65',
  'format' => 'basic_html',
];

So at some point when it goes through check_markup(), this entity is being turned into a Unicode character which is then for some reason invisible on the page.

I've tried all sorts of messing around with html_entity_decode() and htmlspecialchars() but just end up breaking the HTML tags. I'm not sure what I can do other than a str_replace() of all possible entities I think might occur.


texts: Programmatically log in user not working correctly

texts:
Here's what I am doing:

global $user;

if (!user_is_logged_in()) {
  $user = user_load(31);
  user_login_finalize();
  echo $user->uid;
}

When a user is not logged in - we have to log in him as user with id 31. I have placed this code at top of page.tpl.php.

I am noticing some strange behavior. If I visit the homepage (http://ggames.kz/), at the top I can see the id 31, that's correct. However, if I visit the user page (http://ggames.kz/user), it shows that I am not logged in. If I refresh the browser or visit another pages, I am logged in. I can't figure out why it won't authenticate user from the first page load?


texts:
I want to track the history of particular content items on particular date,
ex: i have saved the node of content on 9/4/2015 and also i have edited the same node on 9/9/15, so when i give the from date 9/4/15 to date 9/9/15 with filter condition field,it should show the all changes that has been done for that particular filter condition field on From to To date mentioned, I tried to create a view of content revisions but it's of no use because revisions are shown for all content items. How do I create a view of the revisions of a specific item?by giving filter condition From to To date.


texts: How to run a drupal application in github?

texts:
I am trying to setup Drupal Application in Github and was able to  successfully setup the instance and moved the project to github.

Can anyone help me with as how to execute a drupal application in github,as I am finding tools to run html files but executing a drupal files seems to be a tedious task.


texts:
I'm working on a site that should let users to publish files (images), but I would to add a kind of workflow for these files.
Is there a way? I was thinking to use private/public files, in this way:

by default files are stored in "private" mode (so only certain users can see them)
create a module that simulates a workflow that "publish" a file, moving it to the "public" mode

Could be a solution?


texts: FormStateInterface::setValidationHandlers not working properly?

texts:
I'm using Drupal 8. Within \Drupal\Core\Form\Form\FormBuilder::buildForm, if $cache_check == TRUE, i.e. - the form has a form_id and a build_form_id, then the $form_state object which results from the call made to retrieveForm() in \Drupal\Core\Form\FormBuilder::buildForm() is overwritten by the form_state that is cloned prior to the retrieval.

This would seem to effectively nullify any modification done to the $form_state object within the buildForm() method of a Form class implementing FormInterface. Is this correct?

For example, MyForm class extends FormBase -- which implements FormInterface. If I make a call to $form_state->setValidateHandlers() within the buildForm method in MyForm, the extra validate handler methods set in that call will never be invoked, as the $form_state object will be overwritten after being rebuilt within MyForm::buildForm().

Is this the expected behavior? i.e. - Is it not expected to be able to alter the $form_state within buildForm() in this way?

If that is the case, then is simply using the more "Drupal 7-ish" syntax of $form['#validate'] = ['::method1', '::method2'] the accepted/best-practice way to accomplish multiple validate handlers?

This will work, because the $form array does not get overwritten after the MyForm::buildForm() method is invoked. However, if this is the accepted/best-practice way to achieve multiple validate handlers, how would one set a validate handler that exists outside of the current form class (in this example's case, MyForm)?


texts: On node edit form, how to edit field from a referenced entity?

texts:
I've got a master entity (node) that users edit, and I've got an entity reference on it. I'd like to be able to edit a field on the referenced entity on that master referencing entity's edit form.

Is there a module for this? Or can somebody just give me a general sense of a good way to accomplish this?

I know I can create a custom form element with hook_form_alter, then use a form_submit function, and then use entity_metadata_wrapper to load and save values.

That seems cumbersome, is there a better way to do this?


texts: Loose compression for all images directly from Drupal

texts:
I need to do image loose-compressing usually done with GIMP/TinyPNG/GPI, but just inside Drupal, but also For all images, in a single process or several sporadic processes (say, for each content type).

This could save much time instead of download, compress, reupload, etc.

Is there a way to loose-compress all images in the application so that webpages containing them load faster?

If you don't know such a tool but does know a way to show all nodes that has images, please comment naming such a tool, so it could at least help in the alternative of downloading and manually loosely-compressing each image before re uploading it.


texts: How can I use a media field in a custom form?

texts:
I tried something below, which is not working in drupal 8.

$form['upload_documents'] = [
  '#type'          => 'media',
  '#tree'          => TRUE,
  '#title'         => t('Upload your documents'),
  '#default_value' => ['fid' => $default_value],
  '#media_options' => [
    'global' => [
      'file_extensions' => 'pdf doc docx',
      'types'           => ['document'],
    ],
  ],
  '#attached'      => [],
  '#extended'      => TRUE,
  '#required'      => TRUE,
];


texts: how view count number vote fivestar on comment?

texts:
it like this.
examp:

5 star ***** (15)
4 star **** (150)
3 star *** (2)
2 star ** (0)
1 star * (12)

now.

15 is number comment vote 5star for node this
150 is number comment vote 4star for node this
2 is number comment vote 3star for node this
....

This examp other:


texts: Programmatically set updated time on node

texts:
I'm creating duplicates of nodes by doing

$node->createDuplicate();

It duplicates all the values of all the fields but but it duplicates the created and updated time as well. I want both of those set to now. I know how to set the created time.

$clone->setCreatedTime(time());

However there doesn't seem to be a function or a property for setting the updated time. I read up on the source code of the Node class but couldn't find any mention of it.

Is there any kind of method where you can set the updated time of a node?


texts: I have roughly 200 blogs in my drupal website. Are they able to auto post to instagram? When I create new blog, is it able to post to instagram? If yes, how to do it? Many Thanks.


texts: How to fix migrate query() that's breaking my migration?

texts:
So I have a Drupal 2 Drupal (d2d) migration configured as follows:

class RanchoAboutNodeMigration extends RanchoNodeMigration {
  public function __construct(array $arguments) {
    parent::__construct($arguments);

    ...

    // This is an entity reference field
    $this->addFieldMapping('field_attached_images', 'iid')
         ->separator(',')
         ->sourceMigration('Image');
    ...
  }

  protected function query() {
    // Get the default query
    $query = parent::query();
    $query->leftJoin('image_attach','ia','n.nid = ia.nid');
    $query->addExpression('GROUP_CONCAT(DISTINCT ia.iid)', 'iid');
    $query->addField('ia', 'iid', 'iid');
    $query->addField('ia', 'nid', 'inid');

    return $query;
  }
}

The query causes two problems:

I can only import items one at a time through drush mi or the UI
Most important: I'll eventually run into a PDOexception for duplicate rows and then the error "Could not save to map table due to NULL value for key field nid" with migrate attempting to move totally empty rows.

Both items can be addressed by commenting out the line with $query->addExpression(), but then I miss some desired images. When the migration is actually working, everything migrates correctly, including the referenced image(s).

Any thoughts on what's causing this bizarre behavior when things go wrong and how to address it?

Only thing I can think is to create a local query in prepareRow(), but I don't think I've seen anyone else do that before.


texts: How to Get data of Content type in a custom view

texts: I have a content type "tasks", I created a custom view.i want to show all data of content type "tasks" in that custom view.


texts: I made a block using the Views module, that displays 3 blog posts. It only displays the title and the teaser, and I want to add a "Read More" after each blog post teaser. I can only see how to add a footer to the end of the whole block, not after each listed item. Is this possible? thanks


texts: How to add a new map supports (Baidu map) for openlayers?

texts:
Our customer wants to use Baidu maps in their website and my pm assigned this task to me. I found that the OpenLayers module has good expansibility and I just need to add Baidu support.

Has someone made Baidu maps work on A Drupal web-site?

Demo:

http://ec2-54-242-164-149.compute-1.amazonaws.com/samples/baidu/index.html
https://github.com/shitao1988/baidu/

What steps do I need to take? I guess it is not just to add a new layer in the openlayers.layers.inc-file?

I'm a new drupaler without complicated module experience.


texts: Australian payment gateway adapter for Pay API

texts:
Is anyone aware of a working code for the Pay (7.x) module that will process payments over eWay or NAB Transact?

I am considering writing adapters for these gateways, but though I would put out a call for any existing code to start from.


texts: Conditional PHP works in Node Template but not in Views Custom Fields

texts:
This code in my node template checks a CCK field and prints some text dependent on the value:

<?php if ($node->field_stock[0]['view'] == 'No' ) : ?>

Out of Stock

<?php endif; ?>

How can I do something similar with Views Custom Field's PHP filed type?
Thanks


texts:
I have search and searched and have not found this question yet. Nor have I found a way to do it.

I want to have a page built where it has a few fields, Objectives, Audience, Credits, Location, etc. I want the user to be able to type in all content on one edit screen.

When you view the page I want a horizontal bar with the fields listed - Objectives, Audience, Credits, Location - and when you click on the name Objective, the information for objective pops down in a div. When you click on Audience - text for audience pops down. This would be below the main body copy of the page.

I was thinking maybe fields group or conditional fields for forms however I do not see how those would work.

Does anyone have any ideas? a tutorial to send me too? a module to review?

Thanks
Tim


texts: multisite multilingual over different directory

texts:
I have multi-site over directories.

xx and yy are made symbolic links are linked to same Drupal directory

domain.tld/xx
domain.tld/yy

And on .htaccess it requires to have different Rewritebase

RewriteBase /xx

or

RewriteBase /yy

which is not possible.

Any other way to solve using someother  RewriteRule?

Note: It is also multilingual website

Update: It is Drupal 7.26


texts: How to avoid taxonomy terms other than current language terms in taxonomy menu?

texts:
Vocabulary settings:

Per language terms. Different terms will be allowed for each language
and they can be translated.

I translate one term to other language (different than default), but this term is in the taxonomy menu on default language too, could somebody give me any advice?

[EDIT]

I'am trying with a hook:

function myalter_translated_menu_link_alter(&$item, $map) {
    if ($item['module'] == 'taxonomy_menu') {
    $t = _taxonomy_menu_get_item($item['mlid']);
    if ($t['tid'] > 0) {
        $term = taxonomy_get_term($t['tid']);
            global $language;
            if ($term->language != $language->language) {
                unset($item);
            }
      }
    }
}

It seems that this hook catch taxonomy menu terms with language other than current, but there are still displayed in the menu.


texts: Customize days that can be clicked on a Calendar popup

texts:
I am creating a form in Drupal 7 with the form API. Right now, I can create an ordinary calendar input field with the following code:

   $form['services_tab']['schedule_datepicker'] = array(
    '#title' => t('Pick the desired date'),
    '#type' => 'date_popup',
    '#date_year_range' => '0:0',
    '#date_format' => 'Y-m-d',
    '#prefix' => '
',
    '#suffix' => '
',
  );

Right now I can get the beautiful calendar popup to appear. What I am trying to achieve is enable or disable certain dates based on a rule like: disable all Saturdays and Sundays; or even remove the click state from specific dates based on a list of national holidays...

Is this something that can be achieved with PHP coding, or does it need to be done with jQuery? In case jQuery is the solution, I would appreciate any hints on how to do that... The calendar is a table, but table cells don't have an ID or something that could help me find and disable them based on a rule...

Thank you.


texts: Force Field Required based on Widget Type

texts:
I'm using the GeoField module to geocode fields for mapping on my site. There is an issue with the current stable release of this module.

If Widget Type is "Geocode from another field" this field must be marked REQUIRED or GeoField will create this error:

Notice: Undefined index: default_value in geofield_field_presave()

Is there a way in Drupal 7 that based on the widget type you can FORCE the required option for a field? This would be a solution to this problem. Thanks!


texts:
Hi,
I want to create a drupal view that display as the uploaded image. There are two select list. First select list is static. According to the selected category sub category should by populated. All categories and subcategories are stored as taxonomy term. Any idea would be appeciated.


texts:
I've got one radios element:

$form['trip_radios'] = array(
  '#type' => 'radios',
  '#options' => array(
    'new' => t('Create a new trip'),
    'existing' => t('Use an existing trip'),
  )
);

I've got some #states prepared:

$trip_states = array(
  'visible' => array(
    ':input[name="trip_radios"]' => array(
      'value' => 'new'
    )
  )
);

And some other elements that use $trip_states for their #states:

$form['itinerary_radios'] = array(
  '#type' => 'radios',
  '#options' => array(
    'new' => t('Create a new itinerary'),
    'existing' => t('Use an existing itinerary'),
  ),
  '#states' => $trip_states
);

$form['title'] = array(
  '#type' => 'textfield',
  '#title' => 'Itinerary name',
  '#required' => FALSE,
  '#states' => $trip_states
);

The title form element (and many others) properly listens to the #states condition and works just fine. However, itinerary_radios always shows up no matter what (if anything) is checked on trip_radios. Why does a visible condition on a radios element's #states not listen to another radios value?


texts: Drupal 7 contexual filter display block based on node reference

texts:
I have been going around in circles with this for a few hours now... Time to ask for help!!

I have two Content Types:

1: Book

2: Reader

The Book Content Type has a node reference field which is a select list of readers create with the Reader Content Type.

This is all set up and working fine.

Now the issue with my views:

I have a view with is a block containing the Reader fields. What I want to do is have it when the Book node is loaded my block shows underneath with the referenced reader details. Also if no reader is referenced then no block shows up.

I have spent some time in Relationship and Contextual Filters but can't get it to work.

The book URL is formatted like this:

books/[book-title]

I tired using 'raw value from url' in Contextual Filters as setting it to the 2nd argument but that didn't work either.

If anyone can help me out here I would be very much appreciative.

Thanks
C


texts:
I've added new roles and give it to them a permissions to create content and for some content... and fields but not work with open atrium.

Please help!


texts: Allowing simple footer customisation in settings?

texts:
So, I want to give the client the ability to edit the footer, copyright & legal area. This isn't worth it's own content or block. I don't think....

Is is possible to add a text entry field into setting to customize the footer area or alike areas on the website.


texts:
I'm transferring 10K users from Drupal 7 to Drupal 8. I want to retain passwords. What I'm trying is

Dump user records from Drupal 7 as a CSV file
Dump hashed passwords from MySQL as a CSV file
Load user records and hashed passwords into a custom program
In the program, add hashed passwords to the correct user records (match by UID)
Manipulate user records (consolidate duplicates, combine fields, and more)
output fixed-up user records (including password hash) to a CSV file
use this CSV file as input to a custom Drupal 8 module to create users

All of this is easy except creating users in Drupal 8 with their Drupal 7 passwords.

I have tried simply

$values = array
[
  'name' => 'test',
  'mail' => 'test@test.com',
  'roles' => [],
  'pass' => $hashed_drupal_7_password,
  'status' => 1,
];
$account = entity_create('user', $values);
$account->save();

but of course Drupal 8 assumes the pass value is the textual password and rehashes it.

Is there a way to get the already-hashed password into the user account, either during creation or after it is created? If I get them in, will they still work? As you can tell by reading, I'm a neophyte when it comes to passwords, encryption, etc. I've read many posts and articles, but don't recognize an answer to this question.


texts: getUrlObject() returning empty proto object

texts:
I'm trying to follow this post to turn my menu tree into an array I can more easily work with.

When I run my code and look at $filteredArray I get:

title: *Name here*
url_obj: {}
has_children: true

I'm mostly working in THEME.theme page in:

function THEME_page_attachments_alter {
  $filteredArray = array();
  $menu_tree_service = \Drupal::service('menu.link_tree');

  $menu_parameters = new \Drupal\Core\Menu\MenuTreeParameters();
  $menu_parameters->excludeRoot();
  $menu_parameters->onlyEnabledLinks();

  $tree = $tree = $menu_tree_service->load('main', $menu_parameters);
  foreach ($tree as $item) {
    $itemObject = (object) ['title' => '', 'url_obj' => '', 'has_children' => ''];

    $itemObject->title = $item->link->getTitle();
    $itemObject->url_obj = $item->link->getUrlObject();
    $itemObject->has_children = $item->hasChildren;

    array_push($filteredArray, $itemObject);
  }
  $page['#attached']['drupalSettings']['mobileMenu']['menuTree'] = $tree;
  $page['#attached']['drupalSettings']['mobileMenu']['filteredArray'] = $filteredArray;
}

So it looks like it is grabbing the pages and returning them and looking at the docs I should be able to just call $item->link->getUrlObject(); to get the url so I'm not sure where I am going wrong.

Any pointers are appreciated, thanks!

Edit

Thanks to @stevekeiretsu for the pointers I have updated my code to:

Stringify getUrlObject:

$itemObject->url_obj = $item->link->getUrlObject()->toString();
JSON encode $filteredArray before it is added to Drupal Settings:

$page['#attached']['drupalSettings']['mobileMenu']['filteredArray'] = json_encode($filteredArray);

I am still getting an empty url for the url_obj and I also noticed that on $tree's menu items each had an empty object for 'link', so that I could see that leading to an empty url but then I do not understand why I am able to get the title of each of the menu items.

Thanks again!

Edit 2

It looks like this might have been an existing issue: https://www.drupal.org/project/drupal/issues/2642602

I'm really new to Drupal so I'm not sure about this.


texts: "Home" not changing in Breadcrumbs when switching languages (Locale)

texts:
I am using Locale to translate content and menus.

Despite that, even when viewing a page in Spanish, the "Home" link in the breadcrumbs does not change to "Inicio".

What can I do to fix that?

I have attempted to create a node called "Home", translate it to be called "Inicio" and then changed the url to the homepage in the Configuration > Site Information but have still not had any success.

Is there a possibility to fix this without an additional module and a ton of re-configuring?

Thank you.


texts:
I want to customize the user edit page.  I want to separate the elements (eg. user password, user picture, user email) and put them each on a separate edit page.  I tried the panels module, but that only allows me to move the entire form.

Is there a way to separate these form elements on different pages. For instance a change password page, a change user picture page and add the email into an existing user profile edit page?


texts:
I have a drupal with many external databases. I do the same things in all databases but I want to limit the access to the database basing on the role the logged-in user has.

I mean:

The administration user has access to all databases
Employee has access to db1 and db2
Worker has access to db1

How can I control database access per role?


texts:
What is the best way to handle server side e-mail validation in the form API?
Can it be implemented somewhere inside part of the form described below or are there other options?

 $form['address']['mail'] = array(
   '#type' => 'textfield',
   '#title' => t('E-mail'),
   '#required' => TRUE,
   '#default_value' => $subscription->mail,
   '#maxlength' => 255,
 );

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

 return $form;
}


texts: Adding full HTML field to Superfish/navigation

texts:
I'm looking to add a simple  tag to a few letters in the navigation menu. It's super important that the person I'm working with has italics surrounding a few letters every time a certain work is mentioned.
I haven't been able to figure out how to do this in the Navigation Menu yet. I am not that experienced with editing twig files so i dont know if its something that can be done easily so I would really appreciate some help!
Of course, a module that would work with Superfish would be the most painless route but at this point I'm open to anything. Thanks.


texts: Show next two nodes of view inside the node

texts:
I have a list of nodes in a view from around 10 articles. if I click on the fifth linked article in the view, I see the whole article and I want to display on a sidebar the sixth and seventh article with a small picture and the title.

Does the Views module have the ability to do something like that, or do I have to write a preprocess hook where I query the view list, the current node, and sort it with i.e. date and pick the next two articles?


texts:
I have htmlmail--htmlmail.tpl.php in the root of my theme directory (matching the path outlined in the bottom of the test email which tells me I got some things right)

Set Mail system to use HTML Email, but when I send a test email from the HTML Mail plugin page, it ignores the template file (originally had it just named htmlmail.tpl.php  but I changed it based on what it said at the bottom of the test email.

In the template I just added
TESTING
 above the $body variable.

But the test email ignores all of that.

Not sure what else to check or if I'm missing a setup step, I have my template file, set the theme and not worrying about post-filtering (as outlined on the module page

The mentioned page does list Autoload 6.x-2.1 (New for 6.x-2.28) under requirements, but this seems to only be for Drupal 6 so I did not worry about it and presume that I don't need to.


texts: From a custom module. How can I get the typed value from a textfield and put it in a variable?

texts: In a drupal page, I have a form where I need to read a text field value of an element, via javascript, when it is typed by the user, just after the input field lost the focus and before submit is done, I need to save it in a variable.


texts:
I'm trying to create a clickable link that changes the css using jquery. I've tried many approaches and nothing seems to work. Hopefully someone here can push me into the right direction.

Button html (in a block):

Change CSS

Button code (in change_css.js):

(function($) {
    Drupal.behaviors.my_node_toggle = {
        attach: function(context, settings) {
            $("#change_css", context).click(function(){
                $('a').css({"color":"#ff0"});
            });
        }
    };
})(jQuery);

The script is being loaded, but nothing happens when I click on the link.


texts: Is there anything wrong w giving a node a status other than 0 or 1?  I want to have several different statuses for a content type im working with.


texts: On content, choose the taxonomy parent and display all the children

texts:
I have a content type with a taxonomy field based on a hierarchical taxonomy with 3 levels. I use Simple Hierarchical Select (SHS) to select and display the terms.

I want to have a view that displays the chosen terms on each content page, but I also want when I choose the parent term to show all its children without selecting every one of them.

I made a content view with a Content:ID contextual filter. As a formatter I use SHS but it displays only the selected term at the selected depth, no other options. I tried with another contextual filter on the taxonomy depth, also with another taxonomy view to take the children of a term and then use views field view to embed it on the primary view, no success at all.

Any ideas?


texts: Link to anchor on current page with smooth scroll

texts:
I have smooth scrolling working (https://drupal.org/project/scroll_to_destination_anchors) and I have linking to anchors working (https://drupal.org/project/menu_token) but I can't get my desired result of clicking a menu item and then scrolling to the anchor. I only need this to work on the current page - if the anchor is on another page, I am ok with the menu item loading the other page and jumping (not scrolling) to that anchor.

Do you have any idea?


texts: How to search for string in Drupal database and replace

texts:
I am wondering what would be the safest way to search through the mysql database for a specific keyword and update.

More specifically here is what I am trying to do.

In many of the nodes we have videos embedded. Unfortunately, we didn't add preload="none" to our videos. Now the pages take a long time to fully load plus they download the whole video without the user clicking on it wasting bandwidth.

I want to search the nodes (mainly the body field) for:
video controls=""
and replace with
video controls="controls" preload="none"

I assume I can use something like this? update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

Which table should I search?

I don't want to mess up the database so a second opinion is highly appreciated.


texts: Create a View with Previous Next and Return to Parent options

texts:
ok so I've currently sorted this out using raw PHP and mySQL queries but it feels like a hack and I'd like to Drupalafy it if possible. not sure if it would be quicker or not, but would certainly be easier to manage in the long run.
I have a list of node thumbs on a front page, ordered into Tax based groups. Click any of these and you are taken to that nodes page and you can next/previous though all the other nodes in that Tax group. there is also a link to take you back out to the front page (of which there could be many, as this is based on a higher level tax term).
I'll try and show an example.
Tax top 1.
  tax sub 1
  tax sub 2
Tax top 2
  tax sub 3
  tax sub 4

nodes 1,2,3 are in Tax sub 1
nodes 7,8,9 are in Tax sub 2
nodes 4,5,6 are in Tax sub 3

Main page 1 shows nodes 1,2,3 under heading Tax Sub 1, and 7,8,9 under Tax Sub 2,
main page 2 shows nodes 4,5,6 only under heading Tax Sub 3.
Click though to a node say 5, and you will have a
Next take you to node 6
Previous to node 4
Home/back to Main page 2.

hope that makes senese. you can see it in action on this site.
www.martynazoltaszek.com
So my question is can I do this using I guess Views? I've tried but cannot elicit the control I want completely.
edit: the nodes can be in any sort order so I guess I require the nid to be carried though to the view of a single node, and from that work out what would be next previous.


texts: How to disable image title tags in scald MEE / Drag'n'Drop text field

texts: I would need to disable the rendering of image title tags. Is there a way to do this 'native'? Or is there any other way of doing this?


texts: Drush aliases and Permission denied (publickey,password) problem

texts:
Im trying to use Drush Aliases but getting Permission denied (publickey,password) error. I can login to server using publickey without password but Drush can not.
I've read the solution mentioned here and made the change but no success. Is there anything I'm missing here?


texts:
I have static query (db_query works great) but for some reason, I have to put a condition to the query result

I don't want to re-write the same db_query with "where", I'm looking for a way to write just the condition part and avoid to re-write all the query.

So I want to add a condition (that is for dynamic query) to a static query

Is there any solution ?

Here is one example on my code :

$resultat = db_query(
    "SELECT `field_titre_en_arabe_value`, `field_etat_du_livre_value`, e.denomination_ed, entity_id, `field_prix_value`, `name`
    FROM (
        SELECT `nid`, ta.entity_id,  n.created, `field_titre_en_arabe_value`, `field_etat_du_livre_value`,`field_prix_value`,`name`, n.uid, edi.field_edit_target_id, COALESCE (edi.field_edit_target_id, n.uid) as newid
        FROM {node} as n
            left join {field_data_field_etat_du_livre} as et on n.nid = et.entity_id
            left join {field_data_field_titre_en_arabe} as ta on n.nid = ta.entity_id
            left join {field_data_field_edit} as edi on n.nid = edi.entity_id
            left join {field_data_field_prix} as pr on n.nid = pr.entity_id
            left join {field_data_field_categorie} as cat on n.nid = cat.entity_id
            left join {taxonomy_term_data} as tax on cat.field_categorie_tid = tax.tid
        ) as tabb
        left join {editeur} as e on e.uid = tabb.newid
        order by  field_etat_du_livre_value asc, created desc"
);

Now here is the condition I was talking about, and look at the 'where' part, it came after I re-write the same first query, I want to write only the "where" part after the if

if (isset($form_state['storage']['etat_livre'])){
    $resultat = db_query(
        "SELECT `field_titre_en_arabe_value`, `field_etat_du_livre_value`, e.denomination_ed, entity_id, `field_prix_value`, `name`
        FROM (SELECT `nid`, ta.entity_id,  n.created, `field_titre_en_arabe_value`, `field_etat_du_livre_value`,`field_prix_value`,`name`, n.uid, edi.field_edit_target_id, COALESCE (edi.field_edit_target_id, n.uid) as newid
            FROM {node} as n
                left join {field_data_field_etat_du_livre} as et on n.nid = et.entity_id
                left join {field_data_field_titre_en_arabe} as ta on n.nid = ta.entity_id
                left join {field_data_field_edit} as edi on n.nid = edi.entity_id
                left join {field_data_field_prix} as pr on n.nid = pr.entity_id
                left join {field_data_field_categorie} as cat on n.nid = cat.entity_id
                left join {taxonomy_term_data} as tax on cat.field_categorie_tid = tax.tid
        ) as tabb
        left join {editeur} as e on e.uid = tabb.newid
        where field_etat_du_livre_value = :field_etat_du_livre_value
        order by field_etat_du_livre_value asc, created desc", array(
            ':field_etat_du_livre_value' => $form_state['values']['etat_livre']
        )
    );

As it is now, it works, but i think the code is redundant is there any way to avoid that please ?


texts: Drupal 7 Multiple Display Types Different Options?

texts:
I have one view with two display types (two blocks), for one of them I want to limit it to 1 result, for the other I want it to show all the results.

How can I do this? I can't seem to figure out how to allow one display type to override the other. They keep to copy eachother.


texts: Videos Stored in D7-s private file system do not play on Android devices

texts:
I have .mp4 video files that I store on my D7 site's Private File system. I am using Video JS module for videos.
I am having issues on playing them on devices (Phone, Tablet) running Android OS.
Does anyone have a solution for this?

I had the same issue on iOS platform, the fix was using Resumable Downloads module for iOS.
For Android the problem still exists.


texts:
I have created a panels page using Panels and for some reason it takes an age to load. It seemed to have started when I added another panels page as a child of this one, and added a navigation block to the left column.

Is there any way to debug this? I've tried using Firebug to check the Net tab, but it just loads and loads. This is running on my localhost so it must be a code loop somewhere, but I've no idea how to find it.

I've checked the reports.

Drupal 7.8
Panels 7.x-3.0-alpha3
Chaos tools 7.x-1.0-rc1

I found this in my log, any ideas?

Type    theme
Date    Monday, September 19, 2011 - 12:33
User    admin
Location    http://localhost/project01/admin/structure/pages/nojs/operation/page-about_us/handlers/page_about_us_panel_context_3/content
Referrer    http://localhost/project01/admin/structure/pages/nojs/operation/page-about_us/handlers/page_about_us_panel_context_3/content
Message Theme key "panels_edit_display_form" not found.
Severity    warning
Hostname    127.0.0.1
Operations


texts:
On a multilingual site (source language: English) I have a view that displays a few product categories. The categories are represented by Taxonomy terms. If I display the (translated) category names linking to the respective category overview page, everything works perfectly: The links are being translated, too.

But when I introduce a category image (an extra field in our category Taxonomy type) the generated image link will never be translated. This means: My view renders the category name as link in the Interface text language selected for page (e.g. http://example.com/de/tastatur/xy-123) and the category image as link in English (e.g. http://example.com/en/keyboard/xy-123). I even have tried to set the Rendering language parameter to German, but the image link is always being rendered in English.

Is this a bug, or am I doing it wrong?


texts: Create a related content block by date and taxonomy?

texts:
I have two content types, A and B. Both of the content types are tagged with terms from Taxonomy list C.

Content A and B both have a date field (start and end date).

When looking at Content A I want to see all the related content, in a block, with similar Taxonomy (from list C) and also filter by date so that if there are any overlaps it shows i.e.

End Date A > Start Date B > Start Date A or End Date A > End Date B > Start Date A

I have been able to do the first part with contextual filters, but not the second part - can anyone help please? (I am a bit of a novice so may need specifics :))

Thanks!


texts: What is exactly access arguments used for in hook_menu?

texts:
I have read the link : hook_menu

Snippet from the page

  "access callback": A function returning TRUE if the user has access
  rights to this menu item, and FALSE if not. It can also be a boolean
  constant instead of a function, and you can also use numeric values
  (will be cast to boolean). Defaults to user_access() unless a value is
  inherited from the parent menu item; only MENU_DEFAULT_LOCAL_TASK
  items can inherit access callbacks. To use the user_access() default
  callback, you must specify the permission to check as 'access
  arguments' (see below).

  "access arguments": An array of arguments to
  pass to the access callback function, with path component substitution
  as described above. If the access callback is inherited (see above),
  the access arguments will be inherited with it, unless overridden in
  the child menu item.

But Still unclear about what access arguments are actually used for ?
Are the access arguments the permissions ?


texts: Add custom validation on views exposed filter block form

texts:
I have one content type called Address. It has title, body, etc.. fields.
Initially Created view for Address.

Later client wants to add search field for this view.
So created exposed filter block for body field.

Now search block with results working fine.

But challenge is, we need MINLENGTH validation to that search field.

Added $form['#validate'][] = _custom_validate; in form_alter.

if ($my_field_length < 4) {
  form_set_error('my_field', t('Please enter minimum 3 characters.'));
}

First Question: This validation is happening on each page load but it is not triggering when we submit form (This is ajax form).
Second question: Is that any possible to stop validation or auto submit on intial page load?


texts: Alter field (multiple values) to add more items/values of another field

texts:
In my case, I use Drupal Commerce (Kickstart 2x distribution) with a images field (multiples/unlimited values).

I need to display all images of parent product AND images of their childrens (variations).

Another case are to display images of a field but if empty, I want to display images of another images field.

What's the good way for this?

Relation module
hook_field_load()
hook_query_alter()
hook_node_load()
hook_load()

Related questions:

How to create a single slideshow combining several image fields?


texts: How can I make the rendered block match its HTML source?

texts:
I have entered HTML into the body of a block with the Full HTML filter (with all filtering disabled).  I am using CKEditor with ACF completely disabled.  The editor shows me the source rendered the way I would expect, but when I save it and view the block in a node (a default, out-of-the-box Basic Page), the block no longer renders the same, various styling attributes are being ignored.  If I open the block again for editing, the source is unchanged, so I know it's not being modified after I save it.  How can I make the block rendering match its source?

Related: my goal here is to be able to enter static, arbitrary HTML and have it render.  Is there a better way to do this? (even if there is, I'd still like an answer to the main question)


texts: User redirect after changing profile information

texts:
I am having a problem trying to get the user to redirect to their profile page (user/uid) after they update their profile (user/uid/edit), I don't want them to remain on the page they just edited. I have looked high and low on drupal answers, google, and the documentation I can't get this to work.

Here is the code;

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

    global $user;
    switch ($form_id) {
         case 'uprofile_node_form':
             $form_state['redirect'] = 'user/'.$user->uid;
             break;
    }
}

I have tried everything including a submit_handler and that doesn't work. I have tried including the base_url - doesn't work either. What am I overlooking. I figure that this should work.

I read somewhere online that redirects will not work if $form_state['storage']['values'] is not empty. If this is the problem, how would I overcome it?

Thanks.


texts:
I would like to add one checkbox in Menu settings at node /node/add/{Content types}

I am not sure how to do that.
I need to use Form and Controller.

What form I need to include? This is some of them.

use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;

And after I need to implemente Implements hook_form_FORM_ID_alter().

Is my thinking ok?


texts:
On a website we use taxonomy translation (Drupal 7), it's working fine on all exposed forms from Views. But on one exposed form (the Search form) it isn't working. Inside the views configuration (Filter criteria) it shows (indexed) next to the taxonomy term that isn't translated.

I found a lot of results about taxonomy translation on Drupal Answers / Google, but the taxonomy translation IS working, but not for indexed items.


texts: Copying multiple components from another webform?

texts:
I have a bunch of webforms, threre are a lot of repeating fields just in different order or with different conditionals / labels. I want some plugin that would allow me to copy elements from existing webform to new one.

Is there such thing?


texts: How to create new type element to form API?

texts:
Drupal form API provides some built in type of element to build a form. But I want to create other type such as:

$form['mail']['#type'] = 'email';

And the output I want it to be:

<input class="input-1" type="email" id="edit-mail" name="mail" maxlength="128">

So, how can i do that?


texts: Empty value "- Select -" does not appear for select fields with states requirement

texts:
When I create a standard select box using the Drupal 7 form API, the first value (also the one selected on a fresh 'blank form') is <option selected="selected" value="">- Select -</option>. This value is not specified in the form definition and I am doing no form altering. (This is fine)

However, when I create a second select box that depends on the first using #states, it does not have any such default value. For complex forms with multiple dependencies this inconsistency is a problem.

An example form definition is as follows:

function sb_quickquote_test_form($form, &$form_state, $post=array()) {

  $fields['first_select'] = array(
    '#type'             => 'select',
    '#title'            => 'First select box',
    '#options'          => Array('First', 'Second', 'Third'),
    '#required'         => TRUE,
  );

  $fields['dependent_delect'] = array(
    '#type'             => 'select',
    '#title'            => 'Dependent select box',
    '#options'          => Array('Something', 'Another thing', 'Something else', 'Final thing'),
    '#states'           => Array(
      'visible' => Array('select[name=first_select]' => array('value' => '2')),
      'required' => Array('select[name=first_select]' => array('value' => '2')),
    ),
  );

  $fields['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $fields;
}

In this simple example, we have 2 select boxes and a submit button. The two select boxes are displayed as:

 ______________      ________________
| - Select - |v|    | Something    |v|
`--------------'    `----------------'
| - Select -   |    | Something      | <- no empty option
| First        |    | Another thing  |
| Second       |    | Something else |
| Third        |    | Final thing    |
 --------------      ----------------

(Because of the #states setting, the second select box only appears when the first select box has "Third" selected)

This inconsistency is causing problems in a situation where we are generating complex dynamic forms with inter-dependant fields.

Does anyone have any idea why the fields are being given inconsistent options and what the best approach is to work around the problem?


texts:
I am trying to install Aegir on Ubuntu.

I followed the installation instructions

sudo mysql_secure_installation
echo "deb http://debian.aegirproject.org stable main" | sudo tee -a /etc/apt/sources.list.d/aegir-stable.list
curl http://debian.aegirproject.org/key.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install aegir3

Everything got a success, but when I go to the login link that it provides me, the I get "server DNS address could not be found."

When I go to mydomain.com I get a 404 (which was working before).

Why is this happening? What am I missing?


texts:
When I try to enable a module I get

Fatal error: Call to undefined function modulename_cron() in /home/modulename.install on line 17

In modulename.install I have

function modulename_install() {
  db_query('ALTER TABLE {node_revisions} ENGINE = MYISAM');
  db_query('ALTER TABLE {node_revisions} ADD FULLTEXT `similar` (`title`, `body`)');
  modulename_cron();
}

module_cron() is definitely defined in my modulename.module file. What could cause this problem and how could I fix it?


texts:
I need a module or patch or something for a post editor that lets you upload images into the post

any help is appreciated.


texts:
I'm using the Cron Cache module to empty my cache tables especially the cache_form table who take 200Mo in 2 days ,but the probleme is that i notice that the module is not working anymore for few days ago .I'm thinking that it's the expire module maybe ??!!
Please any help ..
NB:
I launched the cron 2 times in 10 min (in 24 hours) and nothing happened on the database while i'm configurating my module to flash the cache tables every 24 hours


texts: How to build a custom block with a image field

texts: I want to build a custom block in Drupal 7 that instead of the standard title/text-format contains a single image field. It will be used on the front-page and allow a non-HTML-speaking editor to easily upload and update the big front image that will be shown there. Since there will be only one block I feel a block is more appropriate than a content type. I've built a bunch of custom blocks for Drupal 6, but they were all textfield-based, and I'm not sure how I should approach the problem now that I need a image-upload-field. Does anyone want to point me in the right direction? How do I build the image field from within hook_block_view?


texts: Need to ignore empty variable values for Computed Field when multiplying

texts:
In my entityform, different fields appear based on choices (dependencies). Two appear at once. I'm multiplying the values using a Computed field. All works if the variables have a value. I have 8 fields I want to multiply, but ignore the empty values. Can't set field defaults to 0 (wrecks multiplication) or 1 (messes with totals).

The following warning appears for each empty field; here it's "line 1" for the 1st variable/field. No warning for those that have a value.

  Warning: array_pop() expects parameter 1 to be array, null given in eval() (line 1 of /home/content/67/10793667/html/sites/all/modules/computed_field/computed_field.module(466) : eval()'d code).

How can I instruct the computed field to ignore the empty fields?

Here is my Computed Code (PHP).

$howmany = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_how_many')));
$price1 = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_reg_price1')));
$price2 = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_sale_price2')));
$entity_field[0]['value'] = $howmany*$price1*$price2;

I tried adding this after the $price2 line, but it didn't work.

if ($price2 == null) {
    $price2 = 1;
}

I tried this too, and it didn't work.

if (!empty($price2)) {
  $price2 = 1;
}
else {
  $price2 = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_sale_price2')));
}


texts:
I have implemented a service with the tag config.factory.override. In my class I check if the current user is logged in, and if so I change the system.site.page.front variable to a different page. This kind-of works, but I have a problem with cache. If the first user to visit my site is not logged in that frontpage will be used for everyone, and if a logged in user is first, that version is used for everyone.

This is my current attempt at the getCacheableMetadata:

/**
 * {@inheritdoc}
 */
public function getCacheableMetadata($name) {
  $metadata = new CacheableMetadata();

  $metadata->setCacheContexts([$this->isLoggedIn ? 'user.roles:authenticated' : 'user.roles:anonymous']);

  return $metadata;
}


texts: Values missing in $form_state inside form function but available in ajax callback

texts:
I have a custom ajax form in a custom module, the form function code is over 400 lines so it's too big to post here, but hopefully I can explain the situation clearly here.

The form has a form function mymodule_form($form, &$form_state) and also an ajax callback attached to a button mymodule_ajax_callback($form, $form_state). I put a dpm($form_state['values'], 'form state values from form function);  in mymodule_form function, and also dpm($form_state['values'], 'form state values from callback'); inside the mymodule_ajax_callback function.

Now when I change the values in the form, and press the ajax'd button, the form state values from the form function only has 1 element in the array, and that's the button that was pressed. All other values are missing. At the same time, the form state values from ajax callback function has all the form fields with the correct values. If I understood ajax forms in D7 correctly, you're meant to change the form inside the form function and only do return render($form['element']) from the ajax callback. This situation makes it impossible to do so as I can't access all the values from the form function.

There's nothing in the Recent Log Messages about ajax errors. The form has only 1 Ajax button, but it has also 1 ajax'd select dropdown which when changed, changes options for another select dropdown.

I'm currently sitting here scratching my head, ready to pull some hair out wondering what could cause such weird behavior.

I'm posting a screenshot of the dpm's for clarification:

As you can see values from form function has 1 element in array, values from ajax callback has 56 elements in array.

When I change the Ajax'd select dropdown however, the form state values from form function shows 55 elements, which is probably correct:

So it's only when I use the Ajax button this weird behavior occurs. Any help greatly appreciated. Can post the form code if needed.


texts: Adding 'AddThis' sharing functionality to a Drupal Commerce Checkout page

texts:
How can you add the 'AddThis' sharing buttons to a Drupal Commerce checkout page?

I tried adding an AddThis field to the product content type as I do for the other content types to wish I want to add this module but that doesn't seem to add it to all the pages in the Drupal Commerce checkout process.

If anyone knows how to do that that would be great. Thanks!


texts: Attachment of Taxonomy Term Description shows All descriptions on term page instead of only one

texts:
I created a View page to display a sortable table of Category | Model | Brand | Price. Each product has it's own content types that has all of these fields entered. Category is a List, Model is the title field, Brand is a term reference, and price is an integer field.

I created a page view from the data of of this Product Content type and used contextual filters to display different views of tables at the /category and the /brand level. Because I had some trouble getting two contextual filters to work on the same Page view, I created a new page view [Brand] for the contextual filter for the Brands taxonomy terms. (see question and comments here: Can you display data dynamically from a textfield in the URL and Name of Views?)

Now I created an Attachment to attach to the Brand view. I created the attachment because I would like the Term Description to be above the Brand view that displays the Product Category / Model / Price for each Brand generated by the view. The trouble is that I am getting the description of every brand printed instead of just the brand currently being displayed on the page. Does anyone know what might be causing this issue? I feel like I need a specific filter for this to work.. I've tried different configurations that produce the same result.

Below are my screenshots:

http://i.stack.imgur.com/6gTcI.png --> The attachment

http://i.stack.imgur.com/S20sQ.png --> The page view for the taxonomy term


texts:
I am new to Drupal and this forum.

My problem is that I want to reset my password in Drupal without logging onto my site, but I can only access user/password when I'm logged in.

I've searched a lot and haven't been able to find anything else.

Can anyone help me out?


texts: What is the best way to add "last_imported" field into a view for a node entity-reference field joined to migrate_map table?

texts:
I have a node which has an entity-reference field. The enitity in that field is being imported via Migration framework.
So if I call that entity fruit. MyNode has a field call fruit. Which is being migrated from an up-stream. Thus, it has a "migrate_map" table call "migrate_map_fruit".
In which it has a column call "sourceid" which can be joined to "fruit.id" and then I want to extract a field call "last_imported" and display in the view.
What would be the best way to bring it to views ?
It's quite complex so feel free to reach me if you need more clarification.


texts: How to remove a theme's default menu class from a specific menu?

texts:
I bought a Drupal 7 premium theme and thus my menus use the theme's default menu class.

How do I remove this class from one of the menus so that it would be a simple HTML list or use the native Drupal menu class?


texts: How to create a single page checkout for donations but standard cart/checkout for for other ecommerce?

texts:
I am currently using Commerce for handling selling physical products but also donations.

I would like to have a one page donation that includes the amount and entering their credit card information but still allow the standard cart/checkout process if they are doing physical products.

Is there any way of doing both because it seems that I can only pull off one or the other?

Here is an example of a single page.


texts: Feeds: How to import images using Xpath Parser for XML?

texts:
I am using the Feeds module for XML import. I have created entity type with the Image as a text field. I need to import an image from XML and have it shown on the page.
My XML is like this:

<Auditor>
      <Ref>RIP.jpg</Ref>
</Auditor>

I imported the name from XML using Xpath Parser, but I'm unable to display it on the page because of a path that is not mentioned.

How should I set absolute path or display image on the front?

Thanks in advance.


texts: Can't render node view mode pro-grammatically

texts:
I try to render an HTML data from my node view mode but unfortunately, I have some small progress.
I did some searching and modification on the others code Here.
I have this now.

$nid = 145;
$entity_type = 'node';
$view_mode = 'pdf';

$view_builder = \Drupal::service('entity.manager')->getViewBuilder($entity_type);
$storage = \Drupal::service('entity.manager')->getStorage($entity_type);
$node = $storage->load($nid);
$build = $view_builder->view($node, $view_mode);
var_dump($build);
die();

But when I run it I got this error

  TypeError: Argument 1 passed to Drupal\Core\Routing\CurrentRouteMatch::getRouteMatch() must be an instance of Symfony\Component\HttpFoundation\Request, null given, called in C:\wamp64\www\executive-coatings\docroot\core\lib\Drupal\Core\Routing\CurrentRouteMatch.php on line 127 in Drupal\Core\Routing\CurrentRouteMatch->getRouteMatch() (line 99 of core\lib\Drupal\Core\Routing\CurrentRouteMatch.php).

As I did step by step checking I got that just issue is with $build = $view_builder->view($node, $view_mode);

What is wrong with this code? Am I in the right way to render HTML data from a view mode?

MORE INFO

The Idea behind this is to get node data according to a specific view mode, then render the data to HTML format and use that HTML data in a PDF function to generate the related PDF file.

I simply use this code in one of my custom modules, that is ecc_pdf module.
as you can see I simply set a valid ID to load valid data for the test process.
My node type name is safety_report
this is my full view mode list

I use Drupal 8

PHP 7.2

For checking that I have any issue with other codes or not, I create a new basic site and apply this part of code inside a custom module but I get the same error again.

This is my new custom test module code, This is my full module code for test.mudole file.

use Drupal\node\Entity\Node;
use Drupal\taxonomy\Entity\Term;
use Drupal\views\ViewExecutable;
use Drupal\views\Views;
use Drupal\Core\Render;
$nid = 1;
$entity_type = 'node';
$view_mode = 'teaser';
$builder = \Drupal::service('entity_type.manager')->getViewBuilder($entity_type);
$storage = \Drupal::service('entity.manager')->getStorage($entity_type);
$node = $storage->load($nid);
$build = $builder->view($node, $view_mode);
$output = \Drupal::service('renderer')->render($node);
var_dump($node);

This my info file

name: ECC TEST
description: For creating the custom TEST
package: Custom
type: module
version: 1.0
core: 8.x

As I said I create just a new site, and I don't have any other file in my module, I just have .mudole and .info.yml file that I mention above.
And the Article node that I test just is Drupal default.

This is the full error that logged for me


texts: How can you sort taxonomy terms based on number of times used, in a view?

texts:
I'm creating a view that lists the top 10 most popular taxonomy terms (tags). Currently I have the view returning all the terms and I can limit the view to 10 but I can't work out how to order the terms by popularity (i.e. number of times used across all nodes).

Anyone have experience of this?


texts: What are the possible ways one can style a View (Block) in Drupal 7? I have a View outputting to a Block on a Drupal 7 site that has custom styles which I need to copy; however, I cant seem to find where they are located.


texts:
How I can implement transliterated searches?
for example if someone write in latin characters these to be converted to another coding characters?

How I can instruct drupal that latin character a corresponds to another language character?

Or how i can integrate google transliteraion api in drupal search?

Thanks


texts: How to customize a front page variant with CSS

texts: I need to do some customization on a page variant front page of a section of a website. What is the best way to do this? I am working on Drupal 6 if that helps.


texts: "New" Marker for Comments does not vanish

texts:
The "New" marker above comments does not vanish in my theme. It is basically vanilla Bartik with some tweaks.
The marker is hidden by default and inserted via JS according to this comment in comment.html.twig:

  Hide the "new" indicator by default, let a piece of JavaScript ask the
  server which comments are new for the user. Rendering the final "new"
  indicator here would break the render cache.

This seems to be working as the marker is displayed after loading. The problem is that it is always displayed even on repeated views of the article. I have investigated it for some time now. It appears that the AJAX call to /history/NID/read always returns the current timestamp, not the timestamp of the previous view. Returning the timestamp of the current request does not make a lot of sense to me.

Is my analysis correct so far? Should /history/NID/read return the last instead of the current? If that is true, what could be going wrong here?

Thanks in advance,
Eric


texts: Is it beneficial to export views and store it as a module?

texts:
So in an attempt to further optimize my app, I thought it would be wise if I store the Views in a module using the export tool.

Are there any advantages to gain by doing this?

Thanks!


texts:
When my web form is filled and submitted, I get redirected to a page that says:

  Thank you for submitting.

but theres a red warning box there that says:

  Unable to send e-mail. Contact the site administrator if the problem persists.

I think its the SMTP server, but I don't know how to fix that.


texts:
I have a problem in viewing the content of an Entity Reference in a content type.
when I add a link of the node or an Entity form the content of it appears only in admin content type view , while it does not appear in the content type view of users of other roles such as authenticated users.
I searched in the permissions of the roles but nothing is related.
What is the problem? How can I fix it?

The content type I am creating called agenda
adding new content of type agenda

The new agenda is created
in this picture I am logged in as admin
the acceptance form and members fields are two Entity References, every thing is working fine and all fields are displayed

now I am logged in as "apahauo" authinticated user
the Acceptance form disappeared and the members field showing only "spahauo" while "stadirites" disappeared.


texts: Use custom variable in html.tpl.php for critical css

texts:
I have built my current theme in my D7 site upon the Foundation theme, and with that comes a LOT of unused CSS that gives me a low score in Pagespeed Insights. I have tried different things, among others to use the Advagg module and it's submodule "Critical CSS". These modules does no good for my site unfortunately, despite repeated trials and despite safe settings etc. The screen goes blank and/or each page takes minutes to load. When I only use safe settings and critical css, the page speed score does not improve (and yes, all settings are done according to docs and I have spent many hours on trialling without luck).

So, instead I thought I would try to move this row in html.tpl.php:

    <?php print $styles; ?>
</body>

...to the bottom of the page just before the ending body tag. Then I would need to add the critical css in the head section.

    <head>
        <?php print $critical_css; ?>
...

But how can I pass a variable like $critical_css to html.tpl.php, that only contains the just necessary to show the page? Or is this not possible?


texts:
I've created a custom content type which I want to display in a view using Bootstrap's Tabs component.

I've found this tutorial of sorts, but I'm a bit lost trying to process it all (I'm very new to Drupal).

It looks like it does almost exactly what I need it to. I basically need to display the content I have in that view to be placed inside Bootstrap's Tab markup. I know the theme I'm using already has Bootstrap embedded and available, but I can't seem to figure out to make a "Bootstrap Tabs" option available in the "Style" option of my page view.

Can anyone share some pointers on where to start looking for a solution and on what I need to read up on?

EDIT:

I've been following the tutorial and was able to get somewhere with it. Right now, a Format option for Bootstrap Tabs shows up when editing the view and, when selected, it is followed by a form questioning which field should be used for navigation - as intended, I recon.

Although right after answering the form question, above the preview area, an error message shows up stating:

  Template "modules/custom/bootstrap3tabs/templates/bootstrap3tabs.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "modules/custom/bootstrap3tabs/templates/bootstrap3tabs.html.twig" in the Drupal theme registry.).

Which in turn also shows up in the view after saving.

Can anyone share some pointers on why this happens and how to fix it?


texts: Drupal 7 ubercart roles assignment ineffectual

texts: Nothing happens when I test in the sandbox with paypal standards payment and everything set up through ubercart for recurring subscriptions and feature added role assignment, when I edit product subscription roles assign on purchase to go to certain role and the payment goes through the sandbox I get redirected back to site but the role has not changed to reflect the purchase. What am I missing here?


texts:
I set Mime Mail as the sitewide default mailing system and overrode mimemail-message.tpl.php. My custom template is used correctly for e-mails like account activation, but when I send an HTML e-mail with Rules, the template isn't loaded: I simply get an unstyled HTML text.

Did I forget something (e.g. a configuration for Rules)?


texts: Can we fire database query while flagging the node?

texts:
Can we fire  database query on flagging the flag(pick_this_bid)
I want to update the database table column in which boolen value is saved true and false.

By default it shows true status in database but when someone flagged(pick_this_bid) the  status  should change to false in the database.

I want something like this on clicking flag how to achieve this?

if(status==1)
 $status=0;
 else
  $status=1;

UPDATE  `my_table`.`node` SET  `status` =  0 WHERE  ` node`.`nid`    =1059;


texts: I need to add Placeholder property to Drupal 7 login form from template.php. Not to use a module. and also want to know how to add other attributes like Required etc.


texts: Features code changes overriding automatically

texts:
I have a panels page in Features but as soon as i change the Features code, it automatically overrides the DB, this means that i don't get to see the "Overridden" state grey button, but always the normal "Default" state is shown and the changes are automatically shown on the web page.

The features should not change automatically the code, but only after i choose to override them.

Any ideas why this is happening?

I thought that was an UUID problem, but after removing the UUID module, the issue still persists.


texts:
I have a view that has a feed view. When I try to access the feed URL as an Anonymous user it does not show any items only the feed title, but when I try to access it as admin it show items, so, I'm sure it is permissions issue.

I tried to set the Access settings of the feed as shown in the screen shot:

I don't know what's wrong?!


texts: Should the "install" button on admin/modules page say "enable"?

texts:
(I'm still pretty green when it comes to drupal so I thought I'd ask here before putting in a bug report)

At the bottom of the "Extend" page (admin/modules) the button to apply the changes made to the check-boxes is labelled "install", but (to my understanding) it doesn't install anything, it merely enables (or possibly disables) the already installed modules.

I often find myself at this page after clicking the "Enable newly installed modules" link. I see the "install" button and think "but I just installed, now I want to enable".

So, would "Enable / Disable" or "Apply" be a less misleading label?

Or, am I misunderstanding the terminology, or the use of this page?


texts: Is there any alternative way to add CCK field for Drupal 6

texts:
I am adding the amount of 2xx of fields to a content type at /admin/content/node-type/product/fields, is there any alternative way such as SQL statement to add these fields?

Thanks


texts: a single field from reference entity causing memory error

texts: I have a field in my articles content type that is an entity reference to a people type. Editors can select the "author" from the list. This is all working great. We are using panels to display the article, so I have some view blocks to display some of the related information. When trying to display the author information, I get an out of memory error once I've included this one particular field. So, in narrowing it down, when creating the view, all fields from the referenced entity display fine if this field is not included. Once I add this field, the view preview gets the error as well. The strange thing is that this field is not a duplicate field from the article type. I tried changing the view format to show content instead of fields - same error. I also tried rendered entity - same error. I'm not sure what other steps I can use to track down and fix the issue with this one field.


texts:
I would like to load CSS and JS from https://static.example.com . The typical page contains:

<link rel="stylesheet" href="/sites/default/files/css/css__wBfhyL83sORKzo__AgHv4HOGuOoSbIzIaa4clq9PXs.css?pik02l" media="all" />

and contains similar entries for JS.  I would like to add https://static.example.com to the front of the href="URL" for both CSS and JS.

I'm am aware that this can be done with a contrib module.  I would like to find a hook or some other way to add this to my custom module.


texts: How to get the customer name in Commerce order confirmation e-mail?

texts: How can I get the customer name from the billing information variable in the commerce-order-receipt.twig.html template of the Drupal 8 Commerce order confirmation e-mail?


texts: Use duplicated taxonomy terms from different parent with contextual filters

texts:
I have a taxonomy that has duplicate term names with different parents; for example:

Mcdonalds with tid=39 has child term nuggets with tid=117 and also
Other with tid=43 has child term nuggets with tid=129

I have a page view that has the path: store/%/% and i use two contextual filter to get the content but the problem is that i always get the same tid from child term, doesn't change when the parent it's different, for example the sql query using store/other/nuggets:

WHERE (( (taxonomy_term_data_field_data_field_blog_category__taxonomy_term_hierarchy.parent = '43' ) AND (taxonomy_term_data_field_data_field_blog_category.tid = '129' ) )

and returns the both tid correct, but when i go to store/mcdonalds/nuggets keeps the same tid (taxonomy_term_data_field_data_field_blog_category.tid = '129' ) instead of (taxonomy_term_data_field_data_field_blog_category.tid = '117' )

So both keeps using the same tid for child term, How can i get the tid of a taxonomy term related to taxonomy parent in contextual filter, in the case of the example tid 117 for parent tid 39 and tid 129 for parent tid 43?

I'm using Drupal 7.


texts: How to hide "Add to cart" button for specific products in drupal commerce?

texts:
I am using Drupal commerce module in drupal theme.
I have added a field for product type with options "Free" or "Paid". It works fine.
Now I want to hide "Add to cart" button if product is free from product listing everywhere in website.
I am new with Drupal. I am not getting how to do it. Please guide me in it.

Thank You in advance.


texts: Reducing number of DB queries when using views, search_api and relationships

texts:
I have a view which uses search_api (and solr) to get a list of nodes, and then displays selected fields, including some from a relationship to commerce_product
This is resulting in about a thousand database queries to display about 20 nodes, which I think is inefficient.
Digging in further, it looks like search_api returns a list of nids, which are then loaded with a single invocation of entity_load (which causes several DB queries as field_attach_load loads each of the bundle's fields in turn, loading values for all nodes at once)
But when it comes to the commerce_products in the relationship, these are loaded one-by-one somewhere during the field render process, rather than all in one go. So the total number of queries is close to (number of results) x (number of fields) instead of just (number of fields) like it would be without the relationship.
(Yes, I have quite a few fields)
Is there any way I can get Views to load all of the referenced entities in one go, rather than in this inefficient one-by-one manner?


texts: How do I change a product variaton through an image field?

texts:
Using Drupal Commerce you can set fields in the product entity which can function as attribute selection fields. The visitor can use them to switch the variations of a product.

I created a field called SIZE which allows the visitor to switch the variations of a product. This works fine. Now I need to allow to change the variation by clicking in a image of the variation. See my capture to get the idea.

I create an image field and set it to 1 value, but the "Attribute field settings" area didn't show up. In this area you can check "Enable this field to function as an attribute field on Add to Cart forms."

I thought this module could help, but as far as I see it is not useful for this: https://www.drupal.org/project/commerce_fancy_attributes


texts: how to implement filter for multiple tags in single text field?

texts:
I am new to drupal and I got one site to modify which is developed in drupal 6.

I am using jQuery tags input plugin (http://xoxco.com/projects/code/tagsinput/) for input field "state" and this state field accepts multiple states in the form of tag.

In my site I have used Views module for displaying job list in which filters are used and I want to use state field for filtering jobs.

When I enter multiple states the job should get filtered according to states.
What should I do for implementing this filter?

Here is my UI