texts: Image Style Issue Doesn't Work Every Time

texts:
I posted a previous post about this, but it kind of went a different path, so in the interest of exploring another avenue I wanted to start a new topic to try and troubleshoot this a different way.

ISSUE: The site runs about 99% perfection, however, there is one issue. One of the image styles doesn't always generate when an image is selected for thumbnail.

BACKGROUND/EXPERIENCE ON SITE: I have created a website where I am accepting submissions through Webform version 7.x-3.20 on an installation of Drupal 7.32. The reason for it not being updated is due to a specific need to use Hubspot Drupal Integration 7.x.2.0-rc5. Updating breaks the HubSpot integration, so I've come to terms with the issue of security.

SUBMISSION EXPERIENCE:
 - User fills out form and attaches an image they want to display.
 - I receive an email to review it as admin for approval. I click the link in the email to travel to the submission within Drupal for approval.
 - I click "select" on the image to generate a thumbnail image and adjust any copy content that may be inappropriate.
 - I publish the page and review to ensure main image on entry page and thumbnails on overview page have been made correctly.

PROBLEM: The problem happens in step 3 above. 99% of the time images work without issue and are made into the appropriate thumbnail and entry sizes and crops. However, on occasion the image styles don't work.

WHAT I KNOW:

The uploaded images do make it to the server. I can see the image no issues what so ever before I request it be processed into image styles.
I can recreate the image styles outside of the website and upload them into their specific folders where the images that do work are placed without issue.
I have recreated the image styles in different ways and applied them to my form approval process with similar results which makes me believe it's not directly related to the image style itself.
I've increased the memory limit and max_execution times for testing purposes to a very high allowability.
It is not size specific. Many larger files go through just fine, while the occasional small file size will have this issue with the image style being generated.
It's doesn't seem to be related to the server. I've tried multiple server setups and each has eventually replicated the issue with specific images.

Thanks in advance for helping me continue to trouble shoot this issue.


texts: I have a custom Boolean field in user profile called "social reading" in my drupal installation. I want to create an action using rules module which should check if this field is marked or not. But I am not able to find the option in rules.


texts: D7 Views: Hide field if empty after being rewritten

texts:
In a node type, I have three fields: (1) methods, (2) geography, (3) keywords.
On node view, I have a views block showing these values. However, I want all of the content to appear as single field with a label. This was easy to achieve:
(a) exclude methods and geography from display, (2) rewrite keywords to display the content of methods and geography.

This works like a charm as long as any of the three fields is not empty. However, if all three fields are empty, the block still displays the label (Keywords).

How should I setup the view to hide the label if there is no data in any field?

I've been playing around with all sorts of combinations of the hide options, besides "Hide when empty" and "Hide rewriting when empty" it seems like I would need an option "Hide IF rewrite is empty".

More details reagarding the view:

Format: Unformatted list

Show: Fields

Fields

Methods: no label, exclude from display
Geography: no label, exclude from display
Keywords: label "Keywords", rewrite results: [keywords][methods][geography]


texts: How to use linkit package after uplaoding file with filedepot package?

texts:
I am using File Depot to upload files.

What I want to do is to upload some images into the filedepot folders and then make a link to that files in my posts/pages/book pages/etc. Is it possible ?

What would be even better is to be able to find the files using LinkIt. Is that possible ?


texts: Where is the the full tokens list for a site?

texts:
In the Metatag module UI it uses tokens but only shows a small list of tokens that are relative to the site information rather than the full content tokens which it can use, in D7 there was an admin token page so you can check values.

Where is this in Drupal 8?


texts:
I have a drupal8 in local system. I want to import my production environment configurations into my local. So i am running

drush cim -y

I got the following error.

Unexpected error during import with operation update for core.entity_view_display.paragraph.card.full: The "linkit" plugin does not exist. Valid plugin IDs for Drupal\Core\
Field\FormatterPluginManager are: address_country_default, address_default, address_plain, address_zone_default, bg_image_formatter, blazy, blazy_media, block_field_label, block_fiel
d, cshs_full_hierarchy, cshs_group_by_root, cshs_flexible_hierarchy, datetime_plain, datetime_custom, datetime_time_ago, datetime_default, daterange_custom, daterange_plain, daterang
e_default, entity_reference_revisions_entity_view, file_default, file_rss_enclosure, file_extension, file_filemime, file_uri, file_url_plain, file_video, file_audio, file_table, file
_size, file_link, geolocation_latlng, geolocation_token, geolocation_map, geolocation_sexagesimal, image, image_url, link, link_separate, media_thumbnail, oembed, metatag_empty_forma
tter, list_key, list_default, paragraph_summary, redirect_source, responsive_image, smart_trim, social_media_default, entity_reference_rss_category, telephone_link, text_default, tex
t_summary_or_trimmed, text_trimmed, item_image_formatter, user_name, author, video_embed_field_colorbox, video_embed_field_video, video_embed_field_thumbnail, video_embed_field_lazyl
oad, viewsreference_formatter, webform_entity_reference_entity_view, webform_entity_reference_link, webform_entity_reference_url, entity_reference_entity_view, timestamp, entity_refe
rence_entity_id, entity_reference_label, boolean, number_decimal, language, basic_string, string, timestamp_ago, uri_link, number_integer, number_unformatted, email_mailto, blazy_fil
e, blazy_video

Can anybody help me on how to resolve this?


texts:
I'm trying to figure out how many articles( nodes? ) will be displayed in a listing on our website, to use it to add classes to the elements that are rendered, so one can easily have different styling depending on the number of frontend elements. Right now there are six elements, so preprocess_node(&$variables) is called 6 times in template.php in my theme, but:  How can I obtain the number of nodes in the preprocess_page() - hook?

The nodes seems to be produced by a Promoted articles - type of listing.


texts: HTTP Basic auth on specific Drupal paths?

texts:
I want to use HTTP Basic authentication on a group of paths in my Drupal site (e.g. /folder/*). The paths are all menu callbacks that don't have actual page content.

I tried to use Secure Site but I don't see a way to specify the restricted pages. It seems to just assume that /admin is the only restricted path you would want, unless you wanted to force authentication on your whole site.

How would I go about forcing HTTP Basic auth on particular paths that don't have nodes aliased to them and that aren't admin pages?


texts: How to better distinguish answers from questions when using the Answers module?

texts:
Bare with me, I am not a programmer, and I'm using the Answers module. I would like to make the background color of the answer content type a different color to distinguish it from the question.

So that when you browse both the question and the answer(s) (which the Answers module shows below the actual question on the same page), they don't look too similar.

I know I can add the field label (of the body of each answer), but I'd like to figure this out.

Any suggestions?


texts:
I have a content type (music) with fields(image,track,title). I used a soundmanager player to display my track with its tpl.php(bar.tpl.php).

I have tried to display url of the image field inside the (bar.tpl.php) but got only (http://localhost/mysite) using this code

 <img src="<?php $file = file_load($node->field_image_boss['und'][0]['fid']);
  print file_create_url($file->uri); ?>" />


texts: How to geocode a form field on submission?

texts: I'm writing a module with form alter that should geocode a text field value to the lat\lan format upon triggering the submit function. Should I use the Geocoder module for this? Are there any sample queries to learn how to perform geocoding with that module? Thanks.


texts:
I want to modify the price of the order, but I was unable to change that if the order status is either "Shopping cart" or "Checkout".

What I did is changed the order status to "Pending", then the price can be modify. After modifying the price, I changed back the order status to "Shopping cart", then the price becomes disabled again.

When I check my cart, the price is same as with the original price, so I looked at the order again and find out that the price has been changed back into its original price.

Why is this happening? I'm not familiar yet with commerce.


texts:
Using the Nexus theme, I'm getting the following error when using the theme rotater.

"The History Plugin requires Galleria version 1.2.5 or later."

Updated and its still busted.

http://www.athleteyouniversity.com/


texts:
Using Entity Field Query, how can I use a hook to query by a calculated value? For example:

function mymodule_query_keyword_alter(QueryAlterableInterface $query) {
    $query->leftJoin('field_data_field_one', 'n', 'node.nid = n.entity_id');
    $query->leftJoin('field_data_field_two', 'l', 'node.nid = l.entity_id');
    $query->where("'n.field_one_value' * 'n.field_two_value' >= 40");
}

This shows the idea of what I want to do, but does not work.

Ideally I would also be able to sort my query by this value as well, and extend this capability to performing a geolocation query.


texts:
i want make a photo gallery with drupal and i need to:

a download button for current node picture
an embed code that allow visitor to use photo on other Websites. like this:

i have some experience with Drupal and reading PHP codes, but no experience with writing PHP codes. i tried to make a block in bottom of node picture with PHP filter and following content:

<a href="<?php t('[node:url]'); ?>" title="<?php t('[node:title]'); ?>"><img src="<?php t('[node:field_image]'); ?>">

this code not work. please help me.

many thanks :)


texts: Programmatically add a file upload field to all webforms (+more file extensions)

texts:
I have a set of >100 webforms in my projects.

I need to add an upload field to all webforms in my hook_form_alter().

I guess I need to do something like the following.

function MYMODULE_form_alter(&$form, &$form_state, $form_id) {
  if (strpos($form_id, 'webform_client_form_') === 0) {
    $form['file'] = array(
      '#type' => 'file',
      '#title' => t('File'),
      '#weight' => 50,
    );
  }
}

I need to set as on certain attributes such as:

fieldkey
max upload size
allowed file extensions

How can this be achieved?


texts: Access denied to logo link image with a non admin user

texts:
I must solve some bugs in a 'big' drupal 7 website. I have a strange behaviour, if I connect to the website as an admin the logo image appears correctly. But if I connect with a non-admin user, the logo doesn't appears, the url path go to a denied access drupal page.

Do you have any idea what module/custom-code can do that ?


texts: Attaching 'active' class to faqfield expanded question

texts: I am using the FAQ Field module my project which utilizes the jQuery Accordion UI and HTML definition lists, and I am wondering how I can attach an 'active' field to the expanded question. I would like to know so I can show/hide an up/down caret next to each of the questions based on it's active (expanded) state.  I am using Drupal 7.  Thank you.


texts: How to set static field on Display Suite

texts:
i would like to set a static field using Display Suite in Drupal 7 but don´t know how.
It´s a text snippet that won´t change so i want to place it using a field.

Can somebody help me how to do it?

Thank you very much.

Kind Regards


texts: Views Exposed filter Multiple times on a Page Or Different id for views exposed filter if added one more time

texts:
I added a views exposed filter to block and I want to show the block multiple times on the dashboard page each can have different choices. Can it possible without adding any other display?

Or Can it be possible to change the make the id unique for each occurrences of same exposed filter?

My Actual Need is :

I am using Homebox module for creating a Dashboard for user. I created a view with block display so user can add it in their Dashboard multiple times. I added the Exposed filter of taxonomy terms and I entered the choices of user in my custom table. Now user can add same block with different choices. My questions is how to manage different choices with blocks,because exposed filter have same form id on each occurrences.


texts: Where can I find complete documentation of hook_field_info?

texts:
When I looked into the API documentation page of hook_field_info, it seems to be quite complete. But I could not see the complete details of the return array ingredients.

Why cannot I find the allowed values and detailed descriptions of the following values? Did I miss any documentation page that explain them more in detail?

settings
instance_settings
default_widget
default_formatter


texts: How to add a custom field which dynamically renders different output according to certain conditions?

texts:
I am writing a module which adds a new field. Similar to the serial module, the field cannot be changed or filled anyhow when creating a new node.
I just want the field to create a different output according to certain conditions, for instance if the user has a certain role or not.

For instance, when a user visits a node of a content type which has this field enabled, check for php conditions and then output different html.
Is the user a guest or registered? If guest, output a link which says "register to do this".

It would be really cool if this would then automatically work with views? Like a view which outputs this field for every node of that content type.

Ive tried using computed field but this module computed the result once and then displays this all the time... only solution would to alter the cache db, which seems a little unsmooth to me.

I already added a field using the examples module, so this is what I got so far:

function proposal_field_field_info() {
  return array(
    // We name our field as the associative name of the array.
    'proposal_field' => array(
      'label' => t('Proposal Field'),
      'description' => t('Adds proposal feature'),
      'default_widget' => 'proposal',
      'default_formatter' => 'proposal_field_simple_text',
    ),
  );
}


texts: Custom translatable content entity appears twice when choosing the entity type to create a view

texts:
I'm Developing a custom module with custom content entities that needs to be translatable. The problem is that when they are made translatable by adding:
translatable = TRUE in the @ContentEntityType annotation, the entities appear twice in the drop down view setting options (check the image, 'Faculty' appears twice) which is really strange.

I don't mind if they show twice or more than that but the problem comes when you decide which to choose to create your view because one of the options results in only the entity label field(name) available for building the view, of course along with other unnecessary fields to my use caes such as UUID, created, changed, ..etc . However, the other option has the other fields that I added
to the entity through the Manage fields UI and those are the ones I need.

I have done what this page at drupal.org stated { if the 'translatable' annotation has value TRUE}  define a class that extends \Drupal\content_translation\ContentTranslationHandler, to translate the content.

There is no handy resource to learn how to impelement the TranslationHandeler class. So I have followed the one used in core of 'Taxanomy' entity which
basically looks like it would work with any other entity. You just need to rename it! - correct me if I'm worng! Also, by the way translation of the entity works fine even in instances where I didn't define the TranslationHandaler class and I just included 'translatable = TRUE' annotation, which also is strange!!

I have tried every thing I could to fix it and researched for hours but with no luck. The two options dissappears if you don't include translatable = TRUE in the annotation but then you can not translate the entity fields this way.

My drupal version is 8.1.0 and I have used drupal console on windows to generate the module and the entities. Then I added the extra code.

Anyone could help please!

Code for defining TranslationHandeler class

namespace Drupal\registerar_office;

use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationHandler;
use Drupal\Core\Form\FormStateInterface;

 /**
 * Defines the translation handler for faculty.
 */
class FacultyTranslationHandler extends ContentTranslationHandler {

 /**
  * {@inheritdoc}
  */
  public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
    parent::entityFormAlter($form, $form_state, $entity);
    $form['actions']['submit']['#submit'][] = array($this, 'entityFormSave');
  }

  /**
   * Form submission handler for TermTranslationHandler::entityFormAlter().
   *
   * This handles the save action.
   *
   * @see \Drupal\Core\Entity\EntityForm::build().
   */
  function entityFormSave(array $form, FormStateInterface $form_state) {
    if ($this->getSourceLangcode($form_state)) {
      $entity = $form_state->getFormObject()->getEntity();
      // We need a redirect here, otherwise we would get an access denied page,
      // since the current URL would be preserved and we would try to add a
      // translation for a language that already has a translation.
      $form_state->setRedirectUrl($entity->urlInfo('edit-form'));
    }
  }

}


texts:
I have tried the example I found on Dynamic select list in the form API (dependent dropdown list)? but I did not get it to work properly. The first list populates, but I can not fill the second one with values that are different depending on the first select.

function formtutorial_form(&$form_state) {
  // Connection settings here!!! Then two queries below.
  $stmt = $conn->prepare("SELECT productID, ProductName, oil_ID FROM tb_Products");

  if ($stmt->execute()) {
    $stmt->setFetchMode(PDO::FETCH_OBJ);
    $productlist = array();
    foreach ($stmt as $row) {
      $productlist[$row->productID] = $row->ProductName;
    }
  }

  $productIDselected = $form_state['values']['Products'];
  $stmt7 = $conn->prepare("SELECT oil_ID, OilName FROM tb_Oils WHERE oil_ID = $productIDselected ");
  if ($stmt7->execute()) {
    $stmt7->setFetchMode(PDO::FETCH_OBJ);
    $oillists = array();
    foreach ($stmt7 as $row) {
      $oillists[$row->oil_ID] = $row->OilName;
    }
  }

  $form['Products'] = array(
    '#type'=>'select',
    '#title' => t('Products'),
    '#options' => $productlist,
    '#multiple' => FALSE,
    '#attributes'=> array('size' => 0),
    '#ajax' => array(
      'callback' => '_ajaxfunction',
      'wrapper' => 'divaroundseconddropdown'
    ),
  );

  $form['Oils'] = array(
    '#type' => 'select',
    '#title' => t('Oils'),
    '#options' => $oillists,
    '#multiple' => false,
    '#prefix' => '
',
    '#suffix' => '
',
    '#productlist' => array(
      'visible' =>array(
        'input[name="productname"]' => array(
          'value' => $productlist
        ),
      ),
    ),
  );

function _ajaxfunction($form, $form_state) {
  return $form['Oils'];
}


texts: Which hook_node function should I implement to set the value for a field collection element?

texts:
Or do I have to set it somewhere else?

The context is that I am using an ajax callback function in a payment content type to set the values of a select list based on the value of another select list. The first is a select list of properties for a particular landlord, and on choosing a property the second select list is populated with all the charges related to that property. This then allows a payment to be allocated to a given charge, and so the charge is recorded in an Entity Reference field, that links that payment to the charge it was allocated to. I put this all into a fields collection as it is possible to divide a payment between various charges, for example if you are paying the service charge on a few properties that you own.

Being new to drupal and having encountered some difficulties adding the ajax callback to a element in a collection field, I chose to implement this by adding the two select lists through a call to _form_payment_node_form_alter() and  hook_node_submit() to copy the nid value of the relevant charge instance to the collection field element ['target_id'] value.

After doing so I use dpm($node) to check the value is set correctly and see that all is in order.

You can see the field_payment_charge_allocation field (my added field) has the same value as field_payment_charge_allocate['und'][0]['target_id']. Good!

I also look at the node in hook_node_insert() but by now the field collection has been replaced with the target id for the field collection instance and so I can no longer see the value through the $node variable. Instead I use

$fc = entity_load('field_collection_item',
  array($node->field_payment_allocation[LANGUAGE_NONE][0]['value']));
dpm($fc);

This is the value at insert. As you can see it has changed. ¬¬

Somewhere between these two events I lose the value I have assigned. The value that is saved is whatever value the field collection element has set through its widget. As I have set its #access parameter to FALSE this usually means no value is recorded. (I have tested it by setting a value through the widget on the add content form too, and it saves whatever value I set.)

Where in my module should I set this value so it gets saved along with the rest of the data on the form? Also, out of interest, where in the work flow is this value getting changed? How can I delve deeper into the workflow to see what goes on with related entities when manipulating the the node forms?

If you got this far, thanks for reading my long winded question.

UPDATE: I found this issue open in the field collection documentation that might be related. I will investigate.

I am currently fixing this issue by setting $_SESSION['node'] = $node in hook_submit_node() and then setting the field collection element to the value I want in hook_entity_presave()

/**
 * Implements hook_entity_presave().
 */
function CPSmodule_entity_presave($entity, $type) {
  switch ($type) {
    case 'field_collection_item':
      $node = $_SESSION['node'];
      $entity->field_payment_charge_allocate[LANGUAGE_NONE][0]['target_id'] =
        $node->ajax_lists['charge'];
      unset($_SESSION['node']);
      dpm('_entity_presave');
      dpm($entity);
  }
}

This is a very unsatisfactory fix. I would appreciate any help in understanding this issue and fixing it correctly :)


texts: Im starting a new big project with D7, so it will contains a lot of contrib / custom modules. It will be preferable to use the theme engine Twig. What are the problems that could present later? anyone tried twig with D7 and have some big trouble using some of the contrib modules or any other further issues?


texts:
How to get ONLY the list of Submenus under given menu programmatically. Say, the given menu means a main-menu item. I tried with menu_tree_page_data. But not sure if I can use it to select only the required menus.

The scenario is, I have active menu loaded using menu_get_active_trail(). So I have all the details of the main menu. Now with those details I need to get the submenus under that.


texts:
Possible Duplicate:
  How to print id of user whose profile I visit rather than id of  logged in user?

I would like to print the id of the user on his profile page? How can I do it in Drupal 7. So far I could only print logged in user id..Any advice appreciated.


texts:
Can I get some clarification as to why images aren't being generated for a certain image style in a view?

Here's my setup; I have an Article content type which allows for a main image to be uploaded. An Article Images image style is applied which crops to the focal point (Module that's installed) and generates the image for the Article node.

I also have a view block that I use on my homepage that displays the 2 most recent articles. What this does is display the title of the article, date and tag over the main image.

In my view settings for this block, I have the Image Style set to Article Homepage - 1075x400 with the Formatter set to URL to image. With a custom template, the block is displayed and what it's supposed to do is set the main image as the background image. If I leave the Image Style set to Article Images in the view, this works perfectly, however, changing it to the above mentioned Article Homepage - 1075x400 ends up generating an error as it says the image doesn't exist.

In one way, this makes sense to me since when I uploaded that image to the article node, it was uploaded only in that certain style so it wouldn't make it available in any other style, would it? Or maybe I'm not seeing this the right way or something in my template is wrong.

Any clarification as to why changing the style for my homepage view ends up displaying nothing would be great.

Below is the template for that homepage block in case my issue is coming from this. Maybe there's something I need to put in here so that any style can take effect?

  {% set bg_url = fields.field_image.content|render|striptags|trim %}
  {% if bg_url %}

  {% else %}

  {% endif %}

{{ fields.title.content }}

{{ fields.created.content }}

      {% if fields.field_tags.content|render %}

{{ fields.field_tags.content}}

      {% endif %}

Update 1:

So, I think I might be onto what's happening here. I think it comes down to me using the twig filters in my theme file. If I remove |striptags|trim it generates the image style, however, it won't actually show up in my dev site, in which I'm developing all this, due to the fact that without those other two filters, this is what ends up printing out in the style class:

style="background-image: url(

/sites/default/files/styles/articles_homepage_1075x400/public/articles/2019-05/image.jpg?h=287a81f3&amp;itok=aMmcvNDO

)"

After removing those filters in the file, letting it generate the style, then putting the other two filters back, the image does show up. I'm assuming those filters are hindering the creation for some reason. It may end up not being a problem if I leave those filters out. Sure it won't show up properly on my dev site but I'm going to assume it'll work properly on dev.

Update 2:

Removing |render|striptags|trim from my field_image ended up making this work as intended on my production website. It still remains broken on my dev site though due to it spitting out that extra code.


texts:
I'm trying to understand how to securise my custom modules to avoid php insert into custom inputs and SQL injections in my db_query.

For inputs I'm using :

$form['custom'] = array(
      '#type' => 'textfield',
      '#title' => t('Custom),
      '#description' => t('Custom'),
      '#default_value' => '',
)

I tried to insert some PHP in the input and it actually run it whereas in the documentation it saiys that using form API should escape PHP by using check_plain and the safe example given is :

$form['also_safe'] = array(
  '#type' => 'select',
  '#default_value' => 0, // FAPI will pass through check_plain(),
  '#options' => node_get_types('names'),  // FAPI will sanitize the '#options' attribute with check_plain() for select boxes.
);

So what am I doing wrong ?

Concerning my SQL query I can't succeed to use as documented :

$result = db_query('SELECT $ FROM {custom} WHERE uid= :uid", array(':uid' => $value['in_array'])).

When calling a non object value I just get an error, so doing something like that works well but doesn't escape SQL injection :

$to_user_balance = db_query("SELECT * FROM {ubercart_funds_user_funds} WHERE uid=" . $value['in_array']));

I have to precise that I'm actually learning PHP and still didn't get what objects are. Because my aim is result and not capability, if somebody can explain me quickly how to securise my queries and inputs or drive me to a clear documentation.

I already know those documentation page and didn't help :

Handle user input with care
db_query


texts: On content update email referenced users - Drupal 7 Rules module

texts:
I feel like I am almost there but I am running into a problem.

I have a contenttype called projects with some users assigned to each project node. When a project node is updated I want to send a notification email to the referenced users.

What I have now is that all users get the email as the content gets updated.

Your help is greatly appreciated!


texts:
Okay it might sound a little weird for me to ask a question about dynamic content-types seeing as that's what drupal is all about.. however I'm wondering if there is a preferred method to do a page template that will allow you to add hooks in to activate modules within the page.

for example

if I had a simple 2 column layout w/ main content and right rail next to eachother. would it be feasible to create a template that would take an argument (lets say something you can put in the description) like "$rightRail = twitter;" and then the page renders w/ a twitter module in the right rail?

I hope that makes sense. I'm running into an issue where we have a bunch of pages that look similar, except the rightrail has a very different information in terms of modules, etc... and I wanted to see what the best way to unify my template would be.

Right now the team is creating a new content type and page template for each type... and I don't like that.

thanks guys.


texts:
I just built a view to display user information.  I can see this view just fine as a root admin but when I log in as a different user, the view is restricted.

What governs view access?

Is it a compost of all the permissions involved in the data that is being viewed?
If I want to block a user from looking at a view, do I restrict some or all of the content?
Is there a way to set up a permission directly one a view?


texts: Styling views table - Toogle row class on click

texts:
I have a view which is shown as table. I would like to add a css class to entire row, once the user has clicked somewhere on the row.

With views i added '.baza-pregled-strank-row' class to each row. Below is my jquery code, which is successfully loaded, but not doing what it should, because once i click on the view-field, the class is not aded to the row. Big thanks.

(function ($) {
$('.view-field').on('click', function(e) {
      $('.baza-pregled-strank-row').toggleClass("highlight");
      e.preventDefault();
    });
}(jQuery));


texts: How to clear only the front page cache? I want to clear the front page cache when a new node is added.


texts: Displaying data by views from external API

texts:
I have made 2 db's one is of Drupal 8 and another is external, that is non-SQL(CouchDB) and to manage this DB I made an API with different endpoint(URLs) witch I can axes them by GET/POST methods. After correct request I get response
 in JSON from my API.

When I create for example a user, content(node) or something else I save some info in my Drupal database and some info in my API db (I made alteration of the forms that create content by hook_form_BASE_FORM_ID_alter and this way I create content in my external DB).

My question is how to Display a data from a views, combining information form two Data-Bases?


texts: Drupal 7 - Error on Checkout, e-Commerce

texts:
I installed a e-commerece module for my website. And enalbed all the supporting files under 'modules'. I'm able to add products and view them and can also add to the shopping cart. however when i checkout, it sends me some here..like this

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column
'exid' at row 1: INSERT INTO {ec_customer} (type, exid, uid, name) VALUES
(:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2,
:db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => anonymous
[:db_insert_placeholder_1] => 4mePOKXg5_hhSCYgVSumyWMhsej6EZ5LRLKafRfPBTA
[:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => ) in drupal_write_record()
(line 6975 of C:\xampp\htdocs\cart\includes\common.inc).

Does anyone know why is it throwing an error.


texts: How to set a rule that assigns a user to a specific Organic Group after the checkout process

texts:
I´m using rules, organic groups and drupal commerce modules.

I´ve set a rule that creates a new user after the anonymous completes the checkout process.

I want the rule to assign the user to a specific group (OG). I can´t find the way to do it.
I´ve added a screenshot of what are the available options,a nd it seems that there aren´t enough available selectors to do that.

Is there a way to add the user using php? How?
I´ve added the print screen after setting Action: Add entity to group.


texts: Wierd admin_path behaviour, does it should be like this?

texts:
I have even two questions - both are connected to hook_admin_path().

Does menu path 'user/*/edit' and 'user/*/account/edit' are the same, from admin_path perspective and was D7 designed with such functionality? I want menu item 'user/*/account/edit' to be shown on default theme.

When I try to show a menu item with path:

'user/*/account/edit'  - showed on admin theme
'user/*/account/edit1' - showed on default theme

result of path_get_admin_paths():
Array ([admin] =>
admin
admin/*
user/*/cancel
user/*/edit
user/*/edit/*
...
)

checked with:

path_is_admin('user/%user/account/edit'); // TRUE
drupal_match_path('user/%user/account/edit', 'user/*/edit'); // TRUE

2 . I tryed to change it with

function MY_MODULE_admin_paths_alter() {
  $paths = array(
    'user/*/edit' => FALSE,
    'user/*/edit/*' => FALSE,
  );
}

But result of path_get_admin_paths() is the same? No other functions call hook_admin_paths_alter(). As I understand, this function shall be the last and should change admin_path.

Any ideas about that?


texts: How to allow users to create groups with Organic Groups

texts: How do I allow users on my site to create groups. I've done the initial configuration of Organic Groups, there is no 'Create Group' button by default. I want users to be able to create groups under a Parent Group.


texts:
I created taxonomy 'Questions' and I have few questions as terms.
Users can creates 'Answers' (content type based on nodes) and those have field_question - term reference to question.

Can I retrieve all questions of user in alphabecital order of answer name?

I guess I need special join to accomplish this task.
Now I have something like this:

$query = new EntityFieldQuery();
$entities = $query->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'answer')
    ->propertyCondition('status', 1)
    ->propertyCondition('uid', $uid)
    ->fieldOrderBy('field_question', 'name') // ?? 'name' isn't correct
    ->execute();

I know that this condition couldn't work, because in table 'field_data_field_question' is no information about name of question just tid.

How can I add join to EntityFieldQuery? Or how to accomplish this task without EntityFieldQuery?


texts: How can I use LottieFiles to render animations?

texts: I created an Lotti animation and rendered it as a .json file. Is it possible to use this file in Drupal? Almost every other site builder from Squarespace to Webflow allows this file type of animation. Anyone have experience using it?


texts:
I am using the Location Module to add a location to a field on a content type
I am then using Views and Search Api to create an index and a view of this content type.
The problem I have is that I cant find any way to get the data from the location to the view. At the bottom of the search index page I can add other entities such as users that are linked to this node but not the Location this is the same for Relationships section in the view.


texts: Timestamp error when trying to view page revisions

texts:
When trying to view a node revision at <base_url>/node/<node_number>/revisions/<revision_number>/view/, I get

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

InvalidArgumentException: The timestamp must be numeric. in Drupal\Component\Datetime\DateTimePlus::createFromTimestamp() (line 200 of core/lib/Drupal/Component/Datetime/DateTimePlus.php).

I error_loged the value of that timestamp where it throws that error (in the core code) as I was digging into the problem, and it's a type NULL.

I do not fully understand the sequence of hooks that get called throughout the process of generating this preview that would cause a timestamp issue. Can someone point me in the right direction?

Thank you very much!


texts: How to get Form API #states selected value onchange?

texts:
When I'm using #states to set the visibility of a form field I'm checking an input element for its value. Is there then any way to grab the selected value the moment it's selected?

In the working sample below I'm displaying some markup when a select list's value != '_none'. It works good so far. But how do I get the markup to display the value I selected?

Background is: it's a node reference select list and I'm trying to maybe load some fields from the selected node as preview inside the markup. The moment I'm writing this I think it's a stupid idea. I'm in Ajax with #states, right? And there might be no way to call node_load() or anything the like, right?

/**
 * Implements hook_form_alter().
 */
function MY_MODULE_form_alter(&$form, &$form_state, $form_id) {

  if ($form_id == 'MY_FORM') {

    $form['my_container'] = [
      '#type'   => 'container',
      '#states' => [
        'visible' => [
          ':input[name="my_field_name[und]"]' => ['!value' => '_none'],
        ],
      ],
    ];

    $form['my_container']['markup'] = [
      '#type'   => 'markup',
      '#markup' => /* selected value here */ ,
    ];
  }
}


texts: Date display differences in node templates

texts:
In a node template, if I use the following:

{{ content.field_event_start_date }}

The correct localized date and time will be displayed.  For example:

Tuesday, February 14, 2017 @ 9:00am EDT

However, if I only want to display the time part and use the following:

{{ node.field_event_start_date.value|date("g:ia") }}

The incorrect time is displayed:

1:00pm

There appears to be a +4h offset when using the TWIG date() filter.

Drupal's Timezone is set to "America/New York".

How can I display only the time part so that it correctly displays the following?

9:00am

Also, can you please explain what conversion Drupal is performing on the time under the covers?

Thank you.


texts: Problems in displaying views in main overview of content types in case of Authenticated user

texts:
I want to replace the main overview of node with my custom view. So the data on overview page should be displayed with the fields, format, and edit link defined in custom view.

I have created a view and saved it. Then I added the view in Block--> Main content Region. I restricted that block to display in that particular content type only.

I gave permission to Authenticated User to "Edit any content" in that content type. I made all the fields to "Hidden" in Manage Display of that content type.

Now when I want to display the node page then view is displaying fine for Admin user. But when I see that node from Authenticated user log in then old fields and format are displayed. It is displaying the same format as during the default overview.

Please tell me as what I am missing here.


texts: How can I add sort criteria for search api views?

texts: I set up a view with search api data according to this, but the sort criteria available in each view are not complete. I'd like to sort on some fields (indexed) that are not showing in the list. I'm wondering if I need to use a hook to alter the query, or if there's a configuration option somewhere that I've not read about.


texts: How to sub_process a non-associative array in migration.yml

texts:
I know I can use sub_process to iterate over an associative array like

field_categories:
  plugin: sub_process
  source: remote_categories
  process:
    target_id:
      plugin: migration_lookup
      migration: my_existing_taxonomy_migration
      source: name_of_key

But I don't know how to iterate over a numeric / non-associative array. Assume the JSON data structure

{
  remote_categories: [ 'alpha', 'beta', 'gamma' ]
}

how can I pass the values as keys to migration_lookup? I.e. what would be name_of_key in the example above?


texts: The meaning of update.php pending updates

texts:
I have replaced Drupal 7 core files from version 7.10 to 7.12. Now I am running update.php and it displays 3 pending updates, e.g.:

  menu module
  7003 - Add missing custom menus to active menus list

How do I get more information what this means exactly? I checked the site with release notes for Drupal 7.12, but there is no such string (7003) in that list.


texts: Render template file for view if no result?

texts: I need to render a view's template file even if there are no results for the view.  Is this possible out of the box?  If not, any idea on how to hack it?


texts: Adaptive Theme: give the option to user to switch between fluid and fixed layout in specific nodes

texts: I would like to give the option to my users to switch between fluid and fixed layout when viewing nodes of a specific type. There is an option in the adaptive theme where you set the maximum width. Is there a way for me to bypass this and give a button to my users that will allow them to switch between fluid and fixed layout?


texts: How to bypass Drupal page cache if a certain cookie is set on a shared domain?

texts:
I have a drupal web site that lives on the same domain as another non-drupal website.For instance, The site is a.example.com. When my users logs in example.com a certain authentication cookie is set. However, when the user hit a.example.com, the user gets a cache hit. I know that hook_boot is invoked on all pages, however, how do I tell Drupal to bypass cache? Should I set a certain cookie?
I would like to now what is the proper way of doing something like this.


texts: get the list of menu items that are valid possible parents for the given menu item using menu_parent_options()

texts:
I want to get the list of parents for a given menu item. As described at api.drupal.org  https://api.drupal.org/api/drupal/modules%21menu%21menu.module/function/menu_parent_options/7
I tried but i am not able to get all the parent of a menu item. As the second argument $item to this function should be menu item i tried this code. For example

<?php
$menu_name = array('management' => 'Management');
var_dump(menu_parent_options($menu_name, menu_link_load(23)));
?>

I want to get the parent list of menu /admin/appearance/list which have mlid = 23.
But this code give output

  array (size=1)   'management:0' => string '' (length=12)

but output should give /admin/ and /admin/appearance also in output in the form of

  menuname:mlid


texts: How to make a list of all nodes of content type ABC on a site (not a sitemap)?

texts:
I have a D8 website with about 100 landing pages for a Google Ads campaign.  All of my landing pages are of content type landing page.

I want to make sure that the cache is primed for these pages because Google penalizes the site ("below average landing page experience") if it takes too long to load.

It seems like the standard approach to doing this is to run wget over your sitemap: https://swsblog.stanford.edu/blog/xml-sitemap-and-cache-priming

But, the landing pages aren't in my sitemap because they are too similar to each other.  So, what should I do to get a list of the URLs of all of my landing pages?


texts: Replacing the updated module in drupal 7 without effecting the database from previous module?

texts:
I have seen that whenever we apply patch to a module, without reinstalling the module, new updates of the module won't be reflected.
The problem is reinstalling the module will truncate the module related tables in the database. Is there any other way, so that we can replace the updated module without effecting the data from previous module?

Thank you in advance.


texts: How to create entity reference field from custom entity to specific content type

texts:
I'm on Drupal 8, using BaseFieldDefinition::create('entity_reference') on my custom entity type to add entity reference field;

I also use this ->setSetting('target_type', 'node') to get nodes but this gives me all nodes of any content type;

Is there any way or possibility to filter these nodes to specific content type?

Here is the code for my field:

$fields['project_id'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Project'))
      ->setDescription(t('The project ID, transaction was created for.'))
      ->setSetting('target_type', 'node')
      ->setSetting('handler', 'default')
      ->setTargetEntityTypeId('project')
      ->setDisplayOptions('view', array(
        'label'  => 'hidden',
        'type'   => 'project',
        'weight' => 0,
      ))
      ->setDisplayOptions('form', array(
        'type'     => 'entity_reference_autocomplete',
        'weight'   => 5,
        'settings' => array(
          'match_operator'    => 'CONTAINS',
          'size'              => '60',
          'autocomplete_type' => 'tags',
          'placeholder'       => '',
        ),
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

I want this field to be referenced to Content Type called project and not all types of nodes.


texts: Test extending BrowserTestBase failed in hook_entity_bundle_field_info_alter

texts:
My module implements the following hook:
function my_moduke_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) {
  if ($entity_type->id() == 'node' && $bundle == 'page') {
    $fields['field_my_field']->addConstraint('MyConstraint', []);
  }
}

field_my_field does exists, and everything runs fine, except when I am trying to run a test.

Drupal\Tests\txs8\Functional\BasicTestCase::testMyTest
Undefined index: field_my_field

The error is caused by my_moduke_entity_bundle_field_info_alter().
This error is triggered when the test is running parent::setUp(); >> installDrupal() >> $this->installModulesFromClassProperty($container); at the very beginning.


texts:
When attempting to update a Drupal 7 site through the UI or Drush, I get Error: Call to undefined function json_decode() in home/xxxxx/drush/includes/output.inc, line 403 , code: 255)

The server is running PHP 7.3 with json enabled - I've verified this with phpinfo(). I'm at a loss here, and even if I apply updates by ftp, I still can't run database updates. Shared hosting without root access.

PHP 7.3.13
Drush 5.9
Drupal 7.x


texts: Add user to Organic group after commerce product order with rules

texts:
I would appreciate any help, I have been searching for a solution for over a week now.

I have tried this tutorial https://drupalcommerce.org/blog/10809/selling-organic-groups-using-drupal-commerce but unfortunately the first component can't be completed because of an error message of data type not matching. Several people have complained about this but I'm yet to find a solution.

I also tried http://s1l.org/selling-access-organic-groups-drupal-commerce but the loop in the component doesn't give me the field that is in the tutorial.

I have also tried the Commerce License module with the Commerce License OG module. It expects the group to exist before the product is created. You are to select the group from a list of groups when creating the product. This doesn't match my use case. My groups are created after a product has been created.


texts: Can I load a Node and its Term details using one function?

texts:
I'm trying to load a set of nodes in my module but the dump of the node array only shows the Term's as Id numbers. It appears I then have to use Term_load to get the titles and fields from these terms. so I'm currently doing

$node = Node_load_mulitple($nids)
foreach $node
Taxonomy_term_load($node->taxid)

thats obviously not semantically correct but hopefully you get the idea, is this really what I need to do, it seems long winded?


texts:
I have defined an action and want to trigger it from a hook.

We do not want to use the Rules module, because it is still buggy with Drupal 8. So, we cannot use rules_invoke_component().

What is the correct way to trigger an action? Do I need to construct a new Action object? Do I need a service? Is there documentation on that anywhere?


texts: EntityDrupalWrapper->value() causes infinite recursion on user login?

texts:
I have a few instances on my site where I perform actions on User Login.

I create an EntityMetadataWrapper like so:

global $user;
$uw = entity_metadata_wrapper('user', $user);

And then I go to retrieve values like this:

$special_value = $uw->field_special_value->value()

For some reason, this particular line will cause an infinite recursion and crash my site.

Does anyone know what I'm doing wrong here? I am calling one of these from a Rules event and another one from hook_user_login, but it seems like no matter what, I get this recursive error.

This ONLY seems to happen in hook_user_login, all of my other value() calls to Entity Metadata Wrappers seem to work fine.

Note; these are both Entity References -- one references a Taxonomy Term and the other references a custom Entity.


texts:
Is this possible?

I'm using the jQuery touch swipe module but it doesnt seem to work. The form I have is a 3 part form, with the next button allowing to go to the next page. I want to replace the next with a "swipe" to go back and forth to the pages. Is this possible?

jQuery Touch Swipe doesnt come with much in terms of documentation or installation.


texts: Theme function ignored until cache flushed multiple times

texts:
I'm using the ShareThis module to power my sharing links on a Drupal 7 site, but I don't think my question is specific to this module.

I want to modify the link that's shared and sharethis provides a theme_sharethis() function where I can override the output.  I have mytheme_sharethis() in my template.php file where I modify the output as required.  On my dev box (where I have disable caching) this works fine.

We're using Memcache and Varnish modules for pretty heavy site caching.

Quite often, when new content is created (and in some cases older content is viewed) my theme function, which changes the urls, is ignored.  It gives the default share this links instead of my custom url patterns from the theme function.  It does this for both logged in and logged out users.

If I clear caches multiple times, eventually it recognizes the theme function and gives the proper link.  Obviously I want it to use the correct link the first time!

I suppose my question starts by asking which cache (Drupal, Memcache, Varnish) this is likely occurring in (I think I know the answer, but want to confirm). The obvious next question is how I get it to recognize my theme function every time without clearing the caches first.


texts: Override Taxonomy Term display with columns showing nodes for each content type

texts:
the example is I have 3 node types Brands, Products and Offers asociatted with a vocabulary.
I need to override the taxonomy term display to show the taxonomy term header and then 3 columns with each content type. And the best would be to show fluid columns in order to hide some, for example, when this category has no offers tagged,

I get it work using a display suite layout and adding 3 custom fields, one block views per column for each content type and with a contextual filter depending on the current URL.

But, after my nice columns, is showing also all the default taxonomy layout. ¿How to hide it?

Example:

Taxonomy header info
Brand1 | Product1 | Offer1
Brand2 | Produtc2 | ----
etc... and also default taxonomy node listing ....
Brand1
Brand2
Product1
Procuct2
Offer1
... that I want to hide.

thanks
Gustavo


texts:
I am currently in the proses of making my first multilingual Drupal site. Using the i18n module I have been able to get separate menus and their respective pages.

My problem is that the content on the home page, with the theme that I'm using is created/edited via a page.tpl.php file. Do I need to duplicate this file and have one for each language? If so how to I go about this?

This is the site: http://www.lac-de-montbel.com/

Thanks in advance.


texts:
I've created a view for a group of nodes, what I want to do is output the image just for the first result rather than all of them.

Currently I'm using CSS to hide all except the first but that isn't ideal.


texts: How do I display some no results text in a view if the views results are aggregated?

texts: I have created a view block that displays the number of users a separate user has flagged. I did this by using the "Use aggregation" option in the advanced drop down. I have a UID field that I have grouped by count, and in the no results configuration I have written "0". For some reason when I go and print out my view, if there are no results, it won't display anything and I am wondering why.


texts:
We're using a theme based off Adaptive Theme, but even dropping columns below the main content still has undesired rendering outcome. When region-sidebar-first drops below content-inner there is a problem -- since the link colors contained within sidebar first and the body background color are both white.

What I'd like to have happen is that for mobile devices or when the browser size is under a certain width, I'd like to remove region-sidebar-first and region-sidebar-second and move the menu into another field that into another collapisable region to function as a 'mobile menu'.

Question: Could context handle this? Is there a mobile to handle such logic?

Current our setting appear as follows


texts:
I have a website where I write some web development articles in it, in the blog page, I have set a slideshow with Views because the most of the slideshow modules are useless (it's my personal opinion, I was needing that the slideshow shows the image the title of the article with its caption, there were no slideshow modules that can do that), I used a forked version of Responsly slideshow (it's not the big deal but I liked it because it's really simple), unfortunatelly the slideshow looks pretty bad on mobile devices, I used Browscap to hide the slideshow on mobile devices and works great, but, Browscap doesn't seem to hide blocks on google chrome for android, I still don't have time to work on the slideshow, so, is there something I can do to solve this problem??

NOTE: I don't know the version of google chrome for android that I'm using, my cellphone is a galaxy S (international version) with cyanogenmod 9, I am not sure if it's a bug or if it's my phone.


texts: How to create Page variant Selection rule "if URL contains"?

texts:
I want my variant to apply to all pages if the URL contains a certain string, eg: "cars".

So the cars variant should apply to cars, cars/toyota, cars/toyota/camry, etc.

Is there a way to use a wild card (cars/*?)?

I can't find any documentation on this.

Thanks


texts:
I have taken over a Drupal 7 site which used to be on a different server and has now moved to ours. I have discovered that on lots of Pages, there are images which point to the wrong server name, the name being hard coded on the page. To save me having to load up each page to test (there are 1000's of them), I thought I could search the database for the value I wish to change. I can see page information is stored in the node table but thats just the page title, created at, type etc. Which table is the text on the page stored in?
I have checked the settings.php file and the correct server name is in there.  If I edit a page, I can see the html for the images that don't show on the page point to a completely different server


texts: How do I get the active theme path in a view?

texts:
I need the active theme path in a view to use it in a field rewrite to display that particular image from my theme images folder.

How can I achieve this?


texts: Why does the Multifield module not show an "Add" option?

texts:
After downloading the Multifield module, I enabled it from the module section.

After that I went to Structure -> Multifields, to create a new Multifield. But there is no "Add" button, as shown in this image:

Any suggestions about what I'm missing?


texts: how to open custom form in popup onclick in menu link drupal

texts:
I made a custom form in drupal. I just want to open that form on popup form when user click on menu.

Here is my code

function acoma_extra_divide_element_horizontaly($form, &$form_state) {
  $form['description'] = array(
    '#type' => 'item',
    '#title' => t('At which height should the element be divided? (distance
    from cupboard floor)'),
  );

  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Divide draw up horizontally'),
    '#suffix' => 'cm',
  );

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

  return $form;
}

Menu code is:

Divide element horizontally

Divide element vertically

Reset element

I just want when use click on menu this form loads in popup. I used the popup module.

Any help would be appreciated.


texts: How can I filter an index view using REST?

texts:
I have a custom content type called 'Regions', which simply has a title field. Example values are: Asia, North America, Ocenia, etc.

I've set up a view for this list and a REST export for it, so /regions gives me a simple list:

[{"title":"Asia"},{"title":"North America"},{"title":"South America"},{"title":"Ocenia"}]

I want to filter the results, so I added a contextual filter on the title field, making /regions/Asia show only Asia:

[{"title":"Asia"}]

How do I implement a wildcard search? Something like as should match Asia and amer should match both North America and South America. I'd like to do something like /regions?title=Asia

I referred to this guide on setting up contextual filters, but the following doesn't seem to work for me:

  This query works as a SQL LIKE statement so you can send just a piece of the name and Views will try to find all records LIKE that argument, example, I have a brand called Land Rover but if I just send Land as an argument it will work http://dev-cars-api.pantheonsite.io/api/cars/Land

The URL in the quote is no longer online, so I can't check if it actually works. For me, only entering a full, matching item title works. I can't even specify a title with spaces, so /regions/North+America is also blank for me.

My Drupal version is 8.4, running on PHP 7.1.


texts: How to determine taxonomy vocabularies related to a specific content type in Drupal 8?

texts:
could anyone help me please, how to get the vocabularies to a given content type? For example in older Drupal cores there was a taxonomy_get_vocabuleries($type) function(https://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/function/taxonomy_get_vocabularies/6), but I didn't find anythink similar solution in D8.

Thanks a lot!


texts: how to set complete site background to a color or image?

texts:
I used this:
wrapper    { background-color:yellow; }
but I want really everything in the background to get colored. how to?
Code above just makes the wrapper background change.


texts: How do you force Drupal login to encrypt the credentials

texts:
To make the Drupal login as secure as possible, we don't want to send the login credentials as clear text, but want to somehow encrypt the credentials or the entire request.

Ideally the solution should both for the actual login page, but also if the user logs in via the login block on any page.


texts: How to delete a view programatically in D7?

texts:
How to delete a view programatically?

It's crazy I can't find proper answer for such a simple question.


texts: Automatically change field when another field value is selected

texts:
I have a content type called Jobs.

This include a field contact which is user reference.

I have another content type called Job application.

This includes a node reference based on Jobs and field contact which is user reference.

I want when a user selects a job in the node reference select list on the job application form to automatically change the contact field in that form which the value that exists in the contact field for the relevant job selected.

Example:
Job: Educator
contact: Michael

On Job application upon selected the job "educator" the user reference field should automatically take the value Michael.

Any ideas on how to solve this? Would Rules work and if so how? If through programming, is there a module that allows for injecting code for content types?

Preferably I am looking for a solution that does not involve programming.


texts: Domain relationship module for drupal 7?

texts:
I want to create parent/child relationship in domain access module.
My use case is:

Parent Domain:
->child Domain

When I add a node to the child Domain it should also be automatically created on the parent Domain with an administrator approval required on the parent domain.

Means when I created a node on child domain it should be published and visible to the users on the child domain but it should not be visible to the user on the parent domain unless the administrator approve it.

I looked at the domain relationship module but it is only for drupal 6. Is there any alternative for domain relationship module for drupal 7?


texts: How can I custom sort a views display containing multiple content types to list the newest item from each content type sequentially?

texts:
I have a Views block display where I've collected content items from 3 different content types, filtered by a shared Taxonomy term. My sort criteria currently is "Post date (desc)" and "Type (asc)". I have the Pager displayed and a limit of 6 items to a page.

The current results are:

Page 1
First Newest item from content type 1
Second Newest item from content type 1
Third Newest item from content type 1
Fourth Newest item from content type 1
First Newest item from content type 2
Second Newest item from content type 2

Page 2
First Newest item from content type 3
Second Newest item from content type 3
Third Newest item from content type 3
Fourth Newest item from content type 3
Fifth Newest item from content type 3
Sixth Newest item from content type 3

Page 3
Etc.

The desired results are:

Page 1
First Newest item from content type 1
First Newest item from content type 2
First Newest item from content type 3
Second Newest item from content type 1
Second Newest item from content type 2
Second Newest item from content type 3

Page 2
Third Newest item from content type 1
Third Newest item from content type 2
Third Newest item from content type 3
Fourth Newest item from content type 1
Fourth Newest item from content type 2
Fourth Newest item from content type 3

Page 3
Etc.

Is this something that requires a custom module with hook_views_query_alter? If so could someone help me out with how I should build the expression in my module?


texts: Question field in the user registration process

texts:
I am wondering if there is a module which would enable asking users why they want to join a site - i have a very small forum and want to avoid spam bots.
I am using captcha and require administrative approval for a new user but I would like to have a field which asks "why would you like to join this forum?" and have that display somewhere that I can see it before enabling the account.
Does anyone have any advice?
Thanks,
Amy


texts: How do I add default header and footer regions to my site?

texts:
i have added regions in my theme.info file. now i want to add default header and footer with logo in all the pages of my site.This is my page.html.twig

    {{ page.header }}

  {{ page.primary_menu }}
  {{ page.secondary_menu }}

  {{ page.breadcrumb }}

  {{ page.highlighted }}

  {{ page.help }}

    {# link is in html.html.twig #}

      {{ page.content }}

{# /.layout-content #}

    {% if page.sidebar_first %}

        {{ page.sidebar_first }}

    {% endif %}

    {% if page.sidebar_second %}

        {{ page.sidebar_second }}

    {% endif %}

  {% if page.footer %}

      {{ page.footer }}

  {% endif %}

{# /.layout-container #}

I have placed files region--header.html.twig and region--footer.html.twig .Please help me how to place logos and other contents in header and footer


texts: How to use mssql as database for my site running on redhat linux

texts: My D6 site is running on linux and I'm using Postgresql as database. but now I want to change mssql as database on windows. how I do that?


texts: Does extending a class include the namespace of the extended class?

texts:
For the following example, does ColourSprayTrap:timer() collide with the timer() function that exists in the weapons module?
More generally, does a namespace need to be re-declared for a class that extends a class with a namespace?

If I have a function declared somewhere in the code.

/* In weapons module. */
function timer() { /* Function definition. */ }

I have a class with a namespace.

/* In traps module */
namespace Traps;

class Trap { /* Some class definition. */ }

I extend that class.

class ColourSprayTrap extends Trap {
/* Start of class defnition. */
  public function timer($time) {
    /* Function defnition. */
  }
/* Rest of class defnition. */


texts: How to find the origin of variable in Drupal

texts:
Maybe this a compound question, please bear with me: I need to find out why the meta tags are not being printed on the homepage of a theme. The problem is that in html.tpl.php I've got this line: <?php print $head; ?>.

In other pages, the meta tags are being printed ok, but not on the homepage. When I look at the page--front.tpl.php it doesn't include any header info or markup (only the markup from the menu downwards and I can't figure out:

Why the difference and;
Where is the $head being defined.

And yes, the content of the homepage does have tags added to it.

Can anyone point me in the right direction?


texts:
Looking for a way to add my own date formatter in view. Actualy have the "default" and "Time ago" one, but I want to had another one to display date has FB do in the notification feed :

For today notification : Today, 09:33

For Yesterday notification : Yesterday, 10:36

For this week notification (except today and yesterday) : Mon. 06:34

All other notification : 09/12/17, 15:59

Is this possible ? Or maybe in an other way than add something in view module ?

Working on Drupal 8.2.0 version.


texts: Identifying Community Modules vs. Custom Modules

texts:
Is there a list of Drupal Community modules that's easily query-able by the module's name/folder-name?

Context: I've inherited a web application built in Drupal.  This application has around 30 modules in

sites/all/modules

I'd like to identify which modules the previous team developed on their own vs. which modules the previous team downloaded from the community modules listing.

So, I'm looking for a list of community modules I could check the module identifier (as opposed it's free form name) against in an automated way.  This seems easier than manually search for 30 different modules.

Happy to hear other solutions for my problem.


texts:
I need to setup a view for a parent which shows the result of his child. The result is a content type which has a user reference field to each student who owns the result.

Each students' profile has a user reference field to his /her parent username. I.m using profile 2 to setup parent and children account differently.

By using contextual filter and relationships, I can easily show the fields of the result to each student who owns the result but since parents' account are different, I really don't know how to show contents linked to individual student to show in their parent account.


texts: What is the recommended way for handling a multilingual service?

texts:
I'm using the Services module together with a multilingual backend (field translation). My endpoint is v1. What I would like to have is <domain>/v1/fr/....

Is this possible without having a redirect?
What is the recommended way for handling multilingual services?


texts: How to clone a entity with its attached fields?

texts:
I am trying to create a entity with few bundles. I have used EntityDefaultUIController as admin UI callback. This provides me with few default functions such as clone, import and export. The problem is when I try to clone or export the entity. It does not export or clone the fields attached to it. Has anyone faced similar issues. I traced back the issue to entity_ui_get_form function which does not have any function related to getting the field information. How could I clone entity with its fields attached to it?

Kindly help me figure this out.


texts: How to code multiple values field in Views PHP?

texts:
I need help setting up ViewsPHP to evaluate 3 pieces of data? (I barely know any PHP)

ViewFields

I have a View with three embedded Viewfields:

Node count
$row->view
[views_field_view_view]

Time ago (1 unit)
$row->view_1
[views_field_view_view_1]

Success rate
$row->view_2
[views_field_view_view_2]

Value code

In the Value Code text area I want to call all the values. I currently have:

return $data;

Output code

In the Output Code I want to do something like this:

<?php
if ($row->view >= 5 AND $row->view_1 >= 5 AND $row->view_2 >= 80) {
    echo "Amazing person";
}
elseif ($row->view >= 3 AND $row->view_1 >= 3 AND $row->view_2 >= 70) {
    echo "Good person";
}
elseif ($row->view >= 1 AND $row->view_2 >= 60) {
    echo "Interesting person";
}
else {
    echo "Content needed";
}
?>

It's only outputting "Content needed" so what have I done wrong?

EDIT: Updating to 7.x-2.x-dev makes this work.


texts: How can a module detect when the "access denied" page is output?

texts:
How is it possible for a module to detect when Drupal is outputting the "access denied" page?
I know how to do it with Drupal 6; I need to know how to do it with Drupal 7.


texts:
I've got a logintoboggan (http://drupal.org/project/logintoboggan/) module and my login is an email adress, so I dont want to have a "Name: " field on my profile edit page.

But when i just call in my theme preprocess page:

$vars['form']['account']['name']['#required'] = FALSE;

or unset() the field I've got an error:

  Username field is required.

How can I disable validation of this field? Thanks!


texts: Why don't links use https:// when I access the site using that protocol?

texts:
The Problem

Accessing my site over https (the only protocol allowed) I get the content, but none of the CSS, images etc.

Drupal is creating pages in response to https requests that include http links to these resources, but it should be using https.

What I've done

I have copied a site to a dev server. The site loads and basically works fine - I can log in etc. It's just that all the links drupal generates are http. The site I've copied it from also runs over https. The site does not exist on http (it would just get a Forbidden error). I've drush cc all.

So Apache's working - I can access the site. .htaccess is working (clean urls work, for example).

I'm using SNI to access the site because the server has other vhosts too, but I'm only accessing the site using the latest Firefox (and as it's a dev site and I'm the only dev, nobody else will use it).

I've done this dozens of times and am quite stumped! Why does Drupal not notice that the request came over https?

The fix

Turns out that .htaccess has this to say:

/* Base URL (optional).

If Drupal is generating incorrect URLs on your site, which could
be in HTML headers (links to CSS and JS files) or visible links on pages
(such as in menus), uncomment the Base URL statement below (remove the
leading hash sign) and fill in the absolute URL to your Drupal installation.

Sure enough, putting $base_url = 'https://example.com'; fixed it.

But why is this necessary?


texts: how to show node title when mouseover on image in the node by drupal views?

texts:
I have a content type in which there is a cck image field and now I have listed the images with the node title as a block by views.

Now I want to show the node title when user mouseovers the image. I think I can implement it by views itself but I don't know how to do it?.

Can anyone help?


texts:
Hi I am a newbie and want to Get Functionality from view module in the form of grid in which i want to show some fields and a main title after clicking on title user will be directed to full post. Can anyone help me how to get this functionality.
In other word i want to change the order of displaying data to end user created by the view module.


texts: How do I postpone an already postponed deletion

texts:
I made a site in which users can publish content and also postpone the deletion time. Now I want the users to be able to postpone a deletion that have been already been postponed. So I want to consider the remaining time do so.

How can reach this goal?


texts: How to use Services to create new node with Entity Reference field?

texts:
I am able to create a new node with body field, but when I try to set the value for my entity reference field, I get

  {"form_errors":{"field_drawing][und":"An illegal choice has been
  detected. Please contact the site administrator."}}

I am sending a structure similar to the working body field, but with 'target_id' instead of 'value':

'field_drawing' = {
    'und' = [
        0 = {
            'target_id' = 123
        }
    ]
}

123 is the nid of an existing node. What would cause an 'illegal choice' response?


texts:
My stylesheet is mentioned in my .info file, but it's not adding it to the page source and using it. The only style I have in Styles.css is body {background:#444}. I've tried clearing the site's cache as well as my browser's. CSS compression is off. Any ideas?

It's a theme I made from scratch.

info file:

name = PBmedia 14
description = The Site Theme
core = 7.x
engine = phptemplate

; Regions
; --------------------------------
regions[header] = Header
regions[content] = Content
regions[footer] = Footer

; Stylesheets
; --------------------------------
stylesheets[all] [] = html5reset-1.6.1.css
stylesheets[all] [] = styles.css

html.tpl.php

<!DOCTYPE html />

<head profile="<?php print $grddl_profile; ?>">
  <?php print $head; ?>
  <title><?php print $head_title; ?></title>
  <?php print $styles; ?>
  <?php print $scripts; ?>

<body class="<?php print $classes; ?>" <?php print $attributes;?>>

    <?php print t('Skip to main content'); ?>

  <?php print $page_top; ?>
  <?php print $page; ?>
  <?php print $page_bottom; ?>

page.tpl.php

  <?php if ($main_menu): ?>

    <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t(''))); ?>

  <?php endif; ?>

  <?php print render($page['header']); ?>

<?php print $messages; ?>

    <?php print render($title_prefix); ?>
    <?php if ($title): ?>
<?php print $title; ?>
<?php endif; ?>
    <?php print render($title_suffix); ?>
    <?php if ($tabs): ?>
<?php print render($tabs); ?>
<?php endif; ?>
    <?php print render($page['help']); ?>
    <?php if ($action_links): ?>
<?php print render($action_links); ?>
<?php endif; ?>
    <?php print render($page['content']); ?>
    <?php print $feed_icons; ?>

  <?php print render($page['footer']); ?>


texts: Member for - how Drupal 7 calculaties and formats duration?

texts:
Drupal 7 has ability to show since how long someone is member, like this:

  Member for 2 months 21 hours

What date field it uses to save the registration date/time?
How it calculates and displays this duration? And can't we use same module / method to calculate duration from our date (in node) and display in our views?

I am really in need of this functionality of calculating of duration, I am using views Calc and subtracting end-date from start-date and dividing it with number of seconds in day to get number of days between two days. but not satisfy besides don't know why can't subtract now() from a given date field in views calculations.


texts: How to render user picture from page.html.twig file

texts:
I am using

node.Owner

To print out things like user name, for instance to print the first name out (which is a custom field) it is simply.

{{ node.Owner.field_first.value }}

However if I try to do the same for the user picture I get an error. I have tried

{{ node.Owner.user_picture.value }}
{{ node.Owner.user_picture}}
{{ node.Owner.user_picture.0.value }}
{{ node.Owner.user_picture.content }}

None of these work ?


texts: Get all the text fields type and alter value after save

texts:
I'm trying to alter the value of entity text fields upon node save, even the custom-made fields

so far I've managed to do that with the title and default body field but not with a custom field, I'm trying to target any field that might be a text field, here's my code:

function MODULENAME_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
  $replacement_pattern = array("/a/", "/b/");
  $replacement = array("c", "d");

  /* Check whether it's a node */
  if ($entity instanceof \Drupal\node\NodeInterface) {
    // Node title
    $nodeTitle = $entity->getTitle();
    $entity->setTitle(preg_replace($replacement_pattern, $replacement , $nodeTitle));

    // Body main
    if(!empty($entity->body->value)) {
      $entity->body->value = preg_replace($replacement_pattern, $replacement , $entity->body->value);
    }

    // Body Summary
    if(!empty($entity->body->summary)) {
      $entity->body->summary = preg_replace($replacement_pattern, $replacement , $entity->body->summary);
    }
  }
}


texts: Proper way to cache custom entities with Entitycache?

texts:
I am trying to figure out how to cache custom entities with Entitycache module. As I know Entitycache module doesn't support custom entites created with Entity API, that's why I'm doing like this:

created cache table for own entity: cache_entity_carroza_user

created own controller, extent EntityCacheDefaultEntityController, implemented EntityAPIControllerInterface:

class CarrozaEntityController extends EntityCacheDefaultEntityController implements EntityAPIControllerInterface {
  ...
}

implemented hook_entity_info, specified entity controller:

$return = array(
  'carroza_user' => array(
    'label' => t('Carroza User'),
    'controller class' => 'CarrozaUserEntityController',
....

if(module_exists('entitycache')) {
  $return['carroza_user']['field cache'] = FALSE;
  $return['carroza_user']['entity cache'] = TRUE;
}

created CarrozaUserEntityController:

class CarrozaUserEntityController extends CarrozaEntityController {
  public function __construct($entityType) {
    parent::__construct($entityType);
  }

  public function resetCache(array $ids = NULL) {
    EntityCacheControllerHelper::resetEntityCache($this, $ids);
    parent::resetCache($ids);
  }

  public function load($ids = array(), $conditions = array()) {
    return EntityCacheControllerHelper::entityCacheLoad($this, $ids, $conditions);
  }

  public function create(array $values = array()) {
    $values += array(
      'carroza_uid' => '',
      'is_new' => TRUE,
      ...
    );

    $carroza_user = parent::create($values);
    return $carroza_user;
  }

  public function save($carroza_user, DatabaseTransaction $transaction = NULL) {
    return parent::save($carroza_user, $transaction);
  }
}

I'm doing everything Entitycache documentation says, but can't see any records in cache_entity_carroza_user table. Am I missing something else?


texts: How to call jQuery functions from my form with Ajax?

texts:
There is an ajax callback which occurs on change of a field in my drupal 8 form.  This populates a wrapper with information from the server.  however I also want to excecute a jquery command to make the visibility of another field be visible after that .  How can this be done?

I tried this  $form['ajax-wrapper']['#attributes'] = array('visibility'=>'initial');

but that doesnt have any effect I need to be able to run this jquery command or this javascript but dont know how to trigger it after the ajax

document.getElementById( 'ajax-wrapper' ).style.visibility = 'initial';

           $("#ajax-wrapper").show();


texts: How to update jquery version without hacking or updating the core?

texts:
I am trying to upgrade my the core/jquery library from 3.2 to 3.4.1 in the core.
How can I update the assets/vendor/jquery/jquery.min.js defined in core.libraries.yml to a further jquery version?
I can not currently update my drupal to v8.9, which comes with v3.5 of jQuery.
I am using drupal 8.6
So far I have tried looking at How to update to jQuery v1.11.1? but the recommended module doesn't seem to be available for drupal 8 and above.


texts:
I would like to put all my xmlrpc functions in a separate inc file and the problem is, how would we tell drupal it is in another file.  Right now, my hook_xmlrpc in my module file looks like this:

function mymodule_xmlrpc() {

  $methods['mymodule.get_myfunction'] = 'xmls_mymodule_get_myfunction';
  return $methods;
}

xmls_mymodule_get_myfunction resides in mymodule.xml-rpc.inc file.  How do we let drupal know that in this hook?


texts: Why Authenticated user not able to submit webform and only admin can submit?

texts:
I am creating a webform with just two fields and displaying it on modal popup with Ajax submit. But the issue I am facing is, this webform can only be submitted by Administer role user not by authenticated user. For authenticated user form will display but when they click on submit it will show a Ajax popup error.

I checked in webform configurations access settings and permissions settings also. But I didn't find out a solution. Can anyone help in this regard.

Edit: I guess its a modal popup issue. Because when I directly access a webform for authenticated user, I can able to submit a form successfully. Since this webform I am displaying this in a modal popup while submitting I am getting Ajax error for authenticated user.


texts: Wrong date field format on mobile iOS / Android

texts:
I created a form with Drupal's FAPI. The form includes two date fields. It works fine on desktop browser.

But on mobile (iOS and Android), the datepicker doesn’t show up. It is the native date selector which shows up.

The issue is that the native date selector doesn’t seem to apply the date format (in my case : '#date_date_format' => 'd/m/Y')

I see 2 possible solutions :

With JS, force the date format
Force the date picker to show up (i’ve seen this on other website
i’ve made but in wasn’t Drupal FAPI.

How do you handle this problem ?

Here is my code and a screen shot of the issue :

    $form['date_debut'] = array(
        '#type' => 'date',
        '#title' => $this->t('Date de début'),
        '#type' => 'date_popup',
        '#date_date_format' => 'd/m/Y',
        '#description' => t('Cliquez dans le champ et sélectionnez une date de début de congé dans le calendrier'),
        '#required' => TRUE
    );


texts: Merge two drupal views with different base types ('user' and 'node')

texts:
Is it possible to merge two views, one based on users and one on nodes?

The purpose of this is to create a directory of contacts, however some of the listings will be site users and some will not be - they will be created by admins.

It has crossed my mind to just use a content type that users can create; the downside of this is that if they update their details they'd have to update their node too...


texts: How to create a glossary page in Drupal 7?

texts:
I tried to create glossary page like this. I've used Glossary module version 7.x-1.x-dev.

But i couldn't make it work. How to create glossary page in Drupal 7?


texts: Contextual information on custom Access Denied page

texts:
I'm trying to implement my own access denied page, and I'd like to get some information about the context of the access being denied... for example, if the user is on a specific node type page, I'd like to still display a short snippet of that node before the access denied message, so the user knows he's at least in the right part of my site.

However, I can't use menu_get_object(), as arg(0) simply returns 'access denied' in my page callback. Is there any way of passing in the path information for an access denied page? See my code below:

<?php
/**
 * Implements hook_menu().
 */
function custom_menu() {
  $items['access-denied'] = array(
    'title' => 'Access Denied',
    'page callback' => 'custom_access_denied',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}
?>

And in my page callback:

<?php
/**
 * Access Denied page.
 */
function fn_custom_access_denied() {
  global $user;
  $html = '';

  // Display access denied message and login form for anonymous users.
  if (!$user->uid) {
    $html .= '
' . t('The content you are trying to access is protected. Please log in or create an account to view the page.') . '
';
    $html .= drupal_render(drupal_get_form('user_login'));
    drupal_set_title('Login Required');
  }

  // Display access denied message for logged-in users.
  if ($user->uid) {
    $html .= '
' . t('The content you are trying to access is protected.') . '
';
    drupal_set_title('Private Content');
  }

  return $html;
}
?>


texts: Make a separate list of selected content

texts: Hi I am very new to Drupal. I want to make a restricted list of contents to show in a view. By default a view of certain content type brings all of the contents in it which I don't want. How can I accomplish this?


texts: I deleted /devel_themer folder now my website reports an error

texts:
devel_themer folder of my website that was in public_html had about 500MB size so I deleted this folder. now when I log in to administrative account it reports this error :

Fatal error: Maximum execution time of 30 seconds exceeded in /home/my_web_site/public_html/sites/all/modules/devel_themer/devel_themer.module on line 342

now what shall I do ?


texts:
I have created a content type, and while adding content under this content type I wanted to provide author, the facility to save this content as draft which he later can edit and publish, ideally, a button with "Save Draft" besides "Publish" button. Is there any drupal module that provides such functionality. I have gone through "Save Draft" module, but I don't understands it exact functionality, it is just providing a button with label, what exactly is is doing is not clear to me. Please help me if I am missing something.

Thanks for your time.


texts:
I'm trying to create a view that will display a number of nodes sorted by their parent terms.

For instance, if my terms have the following hierarchy:

- Fruit
--Apple
--Banana
--Orange
-Vegetable
--Broccoli
--Carrot
--Beet

I would ideally like to get two 'headings', one for Fruit, one for Vegetables and then list nodes with any sub-term in those sections.

I have tried using view relationships and contextual filters but I just feel lost. What should I do?

Thank you!


texts: Check whether multiple images are uploaded to a field?

texts: Is there a way to check whether or not more than one image is uploaded to a field? I'm working on a custom node template and want a conditional to do x if only one image and y if more than 1.


texts: Display output from custom module in a panel

texts: How would I output data from a custom module to be displayed in a panel pane?


texts: How to override single function of theme's template.php using sub-theme?

texts:
Target: Drupal 7 Sub-Theme Development
I don't want to override whole template.php file. I just want to override single function of template.php file.


texts: How to add contact text field to drupal content type

texts:
I am trying to create a business directory. I have created a content type with the following fields:

I would like to add another field for public users to be able to type a message and send to the business owner. When I add content, I like to enter the email address of the business owner. When people type a message and send, it should send an email to the business owner with a predefined email subject. Users should not see the subject field. How can I achieve it?


texts: Google Analytics configuration setting for Drupal multisite (domain and submain)

texts:
I am working on a Drupal mulsite project (using single database) and using Google Analytics module for this.

I have follow the below steps for GA configuration:

Created a domain name example1.com and a sub-domain name example2.com.
Create an account on GA and create property for both of this domain name in GA account. Both property give me two different Tracking ID (same as below screenshot).

Into the configuration setting of GA from drupal admin section I have added Web Property ID of example1.com and into domain setting added both the domain name example1.com and example2.com into the section of List of top-level domains (a same as attached screenshot).

Now this configuration is only working for emample1.com, not for example2.com. So can anyone please tell me how can I use Web Property ID of domain exmaple2.php to get the result?


texts: Can I create surveys with unique URLs for each recipient?

texts:
Does anybody know if there's a module that can support unique URLs for survey participants?

To clarify, what I mean is, I'd like to send out letters/ documentation to people in a particular geographic area. I'd like to encourage them to complete a survey, but for each recipient of the letter I'd like to assign a unique URL for their survey, which can then be used by me to marry them up to the data I already hold about them.

So, for example:

Person A receives a letter and is given a survey URL of www.mysite.com/ab123
Person B receives a letter and is given a survey URL of www.mysite.com/eg462
Person C receives a letter and is given a survey URL of www.mysite.com/qt368

and so on.

For a number of reasons, this method is better for my data collection purposes, rather than asking participants to include an assigned ID number or their own details.


texts: Show fields from diffrent content types in same view?

texts:
Im using Drupal 7.x Merci, views, panels, chaos tools, rules, etc. I am working on a equipment checkout system, and I have a view that lists all the reservations made. In that view I would like to not only show the fields from the Content Type:Reservation, but also the picture from the Content Type:Customer.  I know that I need some kind of reference field so that I get the correct picture next to the correct reservation, so they have several fields in common, Customer Name and L#. I would prefer to use L# but i'm not sure what reference I need to use (entity reference, node reference, field reference) I already have the view built displaying the reservations. Any help would be great, there are lots of questions around about this but I haven't found one that touches on this.

Thanks in advance :)


texts: Group view by term without listing terms multiple times

texts:
I have a view of nodes where the nodes have terms that I want to group them by, but I want to list each term only once and have any node that has multiple terms, listed under each appropriate group. What I have been able to do is group the view by term, but if a node has multiple terms, I get a group that has both terms listed. For example, this is the results I'm getting currently:

Term 1
node1node2
Term 2
node3node4
Term 1, Term2
node5

I need it to look like:

Term 1
node1node2node5
Term 2
node3node4node5

Is there an easier way to accomplish this besides this: Grouping a View by Taxonomy term with multiple values without listing the term more than once

This seems like the same problem I'm having, but I'm not experienced enough to understand this solution.


texts: Taxonomy terms with numeric names and views filtering within range

texts:
I have a very large taxonomy vocabulary with numeric taxonomy term names like: 10123,10124,10125,... etc. My node have a min value field and max value field. Both fields are taxonomy referenced fields with this vocabulary.
How I can create views filter to find a nodes, where exposed filter value is between these two fields?

Example 1.

Node field min: Taxonomy term with name "10500"
Node field max:Taxonomy term with name "11000"
Exposed filter value: 10800

This is TRUE, so this node must be in views result.

Example 1.

Node field min: Taxonomy term with name "10500"
Node field max: Taxonomy term with name "11000"
Exposed filter value: 11500

This is FALSE, so this node should not be in views result.

Exposed filter value can be as taxonomy term autocomplete widget.

Any ideas, how it can realize?

I'm looking a solution in _views_query_alter, but I still can not understand is this right way?..


texts: what is drupal 6's version of hook_user_cancel for drupal7?

texts: I'm trying to execute some custom code in drupal 6 after i ban/block a user.  What would be the appropriate way to do this?  I tried using hook_user specifically looking for an 'update' $op when I block a user, but no 'update' operation seems to get passed into my hook, only 'load' gets passed.  I guess the equivalent of this in Drupal 7 would be hook_user_cancel.


texts: After upgrading, the autoloader is not working

texts:
Recently, I updated from 8.1.8 to 8.1.10 (via composer update). In my local environment (running scotchbox, PHP 5.6.14), it runs fine. When deployed to the staging server (running CentOS 6.7, PHP 5.5.17), the site returns a 500 and writes the following to error_log:

  PHP Fatal error:  Class 'Drupal\Core\Site\Settings' not found in /home/[site]/public_html/drupal/core/lib/Drupal/Core/DrupalKernel.php on line 964

I copied basically everything except the /sites/ directory, so I don't think I'm missing anything.

I tried restarting httpd to no avail.

It seems like a problem with the autoloader and possibly due to the PHP version mismatch. There are many layers between autoload.php and the DrupalKernel.php bootstrap process. I'm at a loss as to what's going on here. Any help would be appreciated.


texts: Drupal theme version and drupal engine version compatibility

texts:
I purchased a theme some time ago that specifies
Drupal Compatibility:   7.x
Drupal Engine:  7.22

I am unclear how the Compatibility and engine versions correlate ...beginner :)

I would like to deploy this theme to a website and the host provides Drupal Engine 7.39.  Should the theme work for this version of the drupal engine?

Thanks


texts: How to create content type programatically

texts:
how to create content type programatically and attach field api fields to it? hook_node_info() will not work for me since i want to create my node type and its instance in a single method (for testing purposes), so kindly suggest a solution other than hook_node_info().
Thanks


texts: Should a splash page linking to other multisite instances also be a multisite instance or a bare HTML page?

texts:
This is the situation:

Global domain: www.domain.com (exists of one page, with links to other 3 subdomains)
Sub domain 1: sub1.domain.com (full website)
Sub domain 2: sub2.domain.com (full website)
Sub domain 3: sub3.domain.com (full website)

My question:

Is it overkill to also create a site for the global domain? It will only have one page (frontpage). Or what is the best practice to accomplish this? The global domain is just a landingpage where you can make a choice between the 3 subsites.


texts: Users can't access Advanced Poll nodes (permissions issue)

texts:
I have Access Control control installed and I thought I had permissions figured out. I can create a new page or article and grant or deny access to Anonymous (or other users) by changing the settings on Access Control tab.

However, I've installed the Advanced Poll module and I might be stuck. Advanced Poll created a special content type. To add a new poll, one does Content | Add Content | Advanced Poll This is fine and works. However, since it does not have an Access Control tab, I'm unable to give access to either Anonymous or Authenticated Users.

Permissions for Advanced Poll are:

Vote on Polls - Anonymous and Authenticated allowed
Cancel or Change own votes - Anonymous and Authenticated allowed

Permissions for Node are:

View Published Content: Anonymous and Authenticated allowed

Per the log files it is failing on node access (e.g. node/6 - Access Denied) I'm able to hit the poll page as I've allowed access to the page, but the content does not display (403 Access Denied).

Does this mean that I cannot used Advanced Poll since I've chosen to use Access Control? Or is there some other way that I might be able to let this content thru to the right users?


texts:
I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:

series1|Series 1 Name
series2|Series 2 Name

correspond to the images names and the tokenized field definition is as in:

<img class="product-series" src="/path/to/image/[node:field-product:field-series].png"/>

However what I got after replacement is the label ("Series 1 Name"), instead of the key. Is there a way to force the key replacement? (Yes I know I could drop the Label part, but this would not be admin friendly)


texts: How can I programmatically validate that an user has uploaded an image in CCK?

texts:
I have an image field defined using CCK.  I need to detect or validate that the image has been uploaded.  Is it possible?

Thanks to all.