texts:
i have a form inside an .inc file. That form i'm calling it inside a new form i'm making, using form_load_include, so far is working but its rendering the external form outside the new form. this is the code that does that:

<?php
// start form to create projects
function project_creator_form($form, &$form_state) {
    global $user;
    $uuid = $user->uid;

  form_load_include($form_state, 'inc', 'lc_core', 'location'); //here i call the form
  $renderable = drupal_get_form('location_form', $form_state);
  $location = render($renderable);
  print $location; //here i print the included form

  $form['u_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Identificador de Usuario'),
    '#size' => '6',
    '#attributes' => array('readonly' => 'readonly'),
    '#default_value' => $uuid,
    '#description' => "Este es su identificador de usuario, (no se puede modificar)",
    );

    $form['p_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Nombre de Proyecto'),
    '#required' => TRUE,
    '#description' => "Introduzca el nombre del proyecto.",
    );

    $form['p_type'] = array(
    '#type' => 'select',
    '#title' => t('Seleccione tipo de proyecto'),
    '#options' => array(
      'Obra Nueva' => t('Obra Nueva'),
      'Adecuación' => t('Adecuación'),
      'Remodelacion' => t('Remodelación'),
      'Ampliación' => t('Ampliación'),
      'Refuerzo estructural' => t('Refuerzo estructural'),
      'Mantenimientos' => t('Mantenimientos'),
  ),
    '#required' => TRUE,
    '#description' => t('Seleccione el tipo de intervención a relizar.'),
    );

    $form['p_area'] = array(
    '#type' => 'textfield',
    '#title' => t('Area del proyecto (m2)'),
    '#required' => TRUE,
    '#description' => "Ingrese la cantidad de metros cuadrados (m2) del proyecto.",
    '#size' => '6',
    );

  $form['p_desc'] = array(
    '#type' => 'textarea',
    '#title' => t('Descripción'),
    '#description' => "Describa de que se trata el proyecto a ejecutar, puede especificar algunos detalles e información que considere necesaria.",
    '#rows' =>4,
    '#resizable' => FALSE,
    '#required' => TRUE,
    );

    $form['buttons'] = array(
    '#type' => 'submit',
    '#value' => t('Guardar proyecto'),
    );
  return $form;

}

function project_creator_form_submit($form, &$form_state) {

    db_set_active('civilproconstru'); //OPEN alter DATABASE.
    db_insert('project_info')
        ->fields(array(
        'u_id' => $form_state['values']['u_id'],
        'p_name' => $form_state['values']['p_name'],
        'p_type' => $form_state['values']['p_type'],
        'p_area' => $form_state['values']['p_area'],
        'p_ctry' => $form_state['values']['p_ctry'],
        'p_dept' => $form_state['values']['p_dept'],
        'p_city' => $form_state['values']['p_city'],
        'p_desc' => $form_state['values']['p_desc'],

        ))->execute();
$p_name=$form_state['values']['p_name'];
$loglink = l("Ver Proyectos", 'admin/lista_de_proyectos');
$msg= "El proyecto $p_name ha sido indexado, continue ingresando información del proyecto en $loglink o puede seguir indexando nuevos proyectos.";
drupal_set_message($msg);

db_set_active(); //CLOSE alter DATABASE.
}

And this is the output i'm getting:

Despite i'm printing inside the function that is creating the form drupal it's rendering outside of it...

HOW CAN I FIX THIS???? thanks for the help!...


texts:
How do I change the Ubercart catalog taxonomy URLs in Drupal 8? When I view my catalog, I have URLs like catalog/1 and catalog/2. How do I change them into catalog/taxonomy-term-name?

(I can't find in view settings something like Convert term name to ID.)


texts: Using theme_username() with no link to user page?

texts:
I use this theme function to show the username of user:

 theme('username', array('account' => user_load($record->uid)))),

It works fine but the username is also a link to the user page. I just need to the username with no link at all.

I read the doc at:

http://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_username/7

and I see that there is the argument link_options to handle this, then I guessed it was a bolean value and tried with (but not working):

theme('username', array('account' => user_load($record->uid), 'link_options' => 0))),


texts:
I am working a lot with views and panels to figure this out but i cant.

When user register account i want for him to be able to make his own profile visible to everyone.
Profile is 1 page user can create with custom content type (maybe there is something better to use?) with info from taxonomy vocabulary, random text, a gallery and a calendar.
Since there is lot of info to write in i want to separate this in few steps.
So i would like to divide page in few regions that look same for all users. Gallery on left side, taxonomy terms and random text in middle, calendar on right side or in block. Each region editable by user who made it. All info on that specific page must be only from user that created it (only userA pictures, userA calendar, userA random text on. All on 1 page).

I worked a lot with panels and views but i have no idea how to make all of this in a way that all info created by 1 user is on 1 page, viewable by everyone on that page.

I managed to use views to collect info from all users in 1 field/block/page so i know some basics. Also used panel to divide for example /home in more regions to.

Cheers!


texts: Creating a file object from a file already in public:// (drupal 7)

texts: I am currently writing a module that will unzip a .zip file after it has been uploaded.  Once this file is unzipped I want to search through it and find certain types of files and create content types that have file or image fields that reference these files, but in order to populate the image and file fields I need to create a file object.  How could I do this without having to duplicate the files that have already been uploaded and unzipped?


texts: How do you programmatically create a flag in drupal 6? I wish to capture this in code so that I can stage flags between different environments. The current stable release of flag does not support features.


texts: I am building a custom module to grab data from an XML feed, however some of the data comes in badly formatted and I would like to change some of it around (for example put line breaks after certain words). Where would be the most Drupaly place to put the code that does this? In the module's .inc file? Preprocess it in template.php? Or put it in a field template file?


texts: Views: Exposed filter If anonymous. Filter by user field if authenticated

texts:
I have created two 'Postal code' (text) fields: one in a content type (Event) and another in the user account. I have also created a view showing Events. Now I would like to do the following:

When a user go to the events view:
  If the user is anonnymous a exposed filter must be show.
  If the user is authenticated, show only events with the postal code of the user.


texts: Add javascript to multiple specific urls

texts:
I'm trying to add some javascript to my template.php file on a Drupal 7 site. I'd like the javascript to load on a specific set of pages, based on the url. For example, I'd like the script to load on:

mysite.com/blog/page1

mysite.com/blog/page2

but not on:

mysite.com

or
mysite.com/blog

or
mysite.com/about

I'm using

function mytheme_preprocess_html(&$variables) {
  $theme_path = path_to_theme();
  $path = drupal_get_path_alias();
  if($path == 'blog/page1') {
      drupal_add_js($theme_path . '/js/example.js');
    }
}

to load the script on that specific page, but is there any way to use a url argument or wildcard or something so that all internal blog pages (i.e. blog/page1, blog/page2, blog/page3) will load the script?

Thanks!


texts:
We have installed and enabled:

Webform 7.x-4.0-alpha6
Webform Localization 7.x-4.x-dev
Internationalization 7.x-1.7

We have created several webforms (in English).

When I look admin/config/regional/translate/translate and select "Limit search to" to "Webform Localization", I see an empty list of strings to be translated.

This way we are unable to translate our webforms. Please help.


texts: Is it possible to run a Drupal 7 on 2 domains?

texts:
I'm not sure is it about the server or Drupal. Anyway, my Drupal was installed inside the directory "/public_html" folder. We are pointing "mysiteA.com" and "mysiteB.com" into this directory.

Both urls look the same but only "mysiteB.com" is able to login. And "mysiteA.com" is showing "access denied" after submit the login form. The question is, Drupal is showing "mysiteB.com" domain inside the "configuration > Site information". Is there a way to change it to be "mysiteA.com" or both(not sure is it possible)?


texts: Processing forms together for a tree of related entities

texts:
I have EntityA which has one or more EntityB's which have one or more EntityC's. EntityB references values of EntityA and EntityC references values of EntityB. My current plan is to have an id field of EntityB reference the id of EntityA and the same for EntityC referencing EntityB. Normal one-to-many relationships, possibly with foreign keys defined so mysql will enforce referential integrity.

I am trying to use the Subform module to build the lists of required forms inside the edit form for EntityA. EntityA builds the settings for a new EntityB into an object and passes that to EntityB's form via Subform '#subform_arguments'.

My question is about how to save EntityB and EntityC forms. Should I save EntityB in the submit function for EntityA or try to communicate EntityA's id to the EntityB submit function and have it save its own entity? If the save logic for EntityB goes in the submit function for EntityA's form, how do I retrieve the subform values to save?


texts: How to change relative path in hyperlinks?

texts:
I have developed site on localhost in XAMPP, in the folder C:\xampp\htdocs\drupLC
Then everything uploaded to the server.
And now all (or many of them) hyperlinks looks like

example.com/drupLC/user
example.com/drupLC/admin (etc).

How can I get rid of drupLC from all hyperlinks? Because my site is not usable.


texts: hook_preprocess_page for mobile detection

texts:
I am attempting to set a variable $is_mobile that I can use in my page.tpl.php function.

function mytheme_preprocess_page(&$vars)
{
    require_once(libraries_get_path('mobile_detect').'/Mobile_Detect.php');
    $detect = new Mobile_Detect();
    $is_mobile = $detect->isMobile() or $detect->isTablet();
    $vars['is_mobile'] = $is_mobile;
}

It seems the result is cached and whatever the first hit will be used.

My overall goal is to create a dynamic menu for mobile and desktop. (One for each)

What is the best way to approach to this?


texts: Is it possible to map a xml-field to the node language selection field in drupal with Feeds and XPath?

texts:
So, I've put together an XML import with the Feeds module and the Feeds XPath Parser plugin. I've got everything set up and working and the eventdata from my XML is importing nicely to my content type in the main language of the website.

But, now I would like to import the eventdata in multiple languages. I've got a tag in the XML that contains the language but it seems I can't map the languagetag to the language selection field on my nodes with XPath.

I could create a new field to hold the language in my content type I guess but that feels like an odd solution.

Any ideas?

Thanks


texts: How to do Question and answers with email notification in drupal 7

texts: To make question and answers for users, I found Answers or Question/Answer modules can be used. But these are only for flow of making questions and answers. If any user (Role: customer) asks question in that site, then that question should sent to the other users (Role: Support). Any suggestions?


texts: Add/Edit Taxonomy Terms directly from add content form

texts:
I've hunted around for a while trying to find a solution to what I believe is a common user interface in the world of data entry but appears to be missing from Drupal.

What I want to be able to do is add/del/edit taxonomy terms for a given content type directly from the Add Content page where the terms show as a multiple select. This is often done with a multi-select box and a simple + - icon next to the multi-select that would bring up an ajax form to manipulate the taxonomy terms and then refresh the multi-select box when the ajax dialog is closed.

For example, say I have a content type for keeping track of books. Fields for Title, ISBN, etc, and a multi-select taxonomy field for book genre (drama, educational, horor, children's, etc) Ideally I want the user to be able to add genre's without having to leave the add book form to do it. I know it can be done with freetagging but then you open up the taxonomy to duplicates and misspellings and other garbage. The multiselect gives a firmer set of choices first and then allows for editing once the user has browsed the list to make sure what they want to add isn't in there already. I would settle for just adding terms from that screen but edit and delete would be nice too.

Taxonomy Other module is ALMOST what I'm looking for, except it doesn't support multi-selects. Are there other modules out there that do this? What about CCK? Any options for using CCK to achieve the same result? I'm using Drupal 6.


texts: Drush and database credentials from external sources

texts:
For some specific automation reasons, I use the following snippet in settings.php rather than defining db credentials directly in it.

$databases = array(
  'default' => array(
    'default' => array(
      'database' => $_SERVER['DB_NAME'],
      'username' => ini_get('mysql.default_user'),
      'password' => ini_get('mysql.default_password'),
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

And when I try to use drush, it won't pick up database credentials. How can I give the right database credentials to Drush? Can I define something in drushrc files per project?

The following is what I get from drush status.

  Drupal version         :  7.22
      Site URI               :  http://default
      Database driver        :  mysql
      Database hostname      :  localhost
      Database username      :
      Database name:
      Default theme          :  garland
      Administration theme   :  garland
      PHP configuration      :  /etc/php5/cli/php.ini
      Drush version          :  5.4
      Drush configuration    :
      Drupal root            :  /home/oep/www/dev/docroot
      Site path              :  sites/default
      File directory path    :  sites/default/files


texts: Which permission is associated with variable_set()?

texts: It seems that only site administrators can use variable_set(). If this is truly the case, is there a special permission that grants variable_set() function to site administrators?


texts: How to make view to group by only one field?

texts:
I have a view with multiple fields and the fields have multiple values, so I get many duplicates in results.
When I try to use distinct, nothing happens, because select distinct does not affect on multiple values. I have predictable, but non desired result.

When aggregation is disabled I don't have any "groupby" directives in resulting SQL.

When I enable aggregation, I see in resulting SQL the following:

GROUP BY field_data_field_tour_short_name_node_entity_type,
field_data_field_tour_short_name_field_tour_short_name_value, node_title,
nid_1, field_data_field_arr_dates_node_entity_type,
field_data_field_arr_dates_field_arr_dates_value,
field_data_field_tour_duration_node_entity_type,
field_data_field_tour_duration_field_tour_duration_tid,
field_data_field_tour_minimal_price_node_entity_type,
field_data_field_tour_minimal_price_field_tour_minimal_price

So, as you can see, I have ALL the fields in my view.

When I disable aggregation and try to use hook_views_query alter

$query->add_field('node', 'nid', 'nid', array('function' => 'groupby'));
$query->add_groupby('node.nid');

I get the following:

GROUP BY node.nid, field_data_field_tour_short_name_node_entity_type,
field_data_field_arr_dates_node_entity_type,
field_data_field_tour_duration_node_entity_type,
field_data_field_tour_minimal_price_node_entity_type

As you can see, I get less fields, but not one.

But I need simply:

GROUP BY node.nid

How can I get grouping by only on field instead of many?

UPDATE: I found the following strings in views_plugin_query_default.inc

$groupby = array_unique(array_merge($this->groupby, $non_aggregates));
  foreach ($groupby as $field) {
    $query->groupBy($field);
  }

So views for some reason add other fields to groupby if groupby is present.
How to avoid this adding? I could change the file, but this is not proper way.


texts:
This is what I'm trying to achieve.

1) The website has a gallery page which is made from one node, so each time uploading new images to the gallery, you just edit this one node.

2) EVA is attached to the node page, so images are rendered via Views using EVA on that node page.

3) It all works great and everything. But it needs this feature that some of those images needs to be featured at the home page with a slideshow. So to achieve all that we can use Views and etc. But how do I filter out which images to show? All images cannot be shown.

4) So when uploading images to the image_field it would be nice if you could somehow select (I was thinking tick/untick boxes for each item in the image field) which ones to show in the homepage slideshow.

5) To be more exact, I was thinking maybe you could somehow assign some taxonomy vocab called 'Featured' which would have terms 'Yes' and 'No'. So you tick 'Yes' to all images you want to be shown in the slideshow and then just apply those filters via Views.

But I cannot figure out how to do that part where you assign terms to image field items without writing custom modules, not a PHP guru, sadly. Also any other alternatives are welcome.

UPDATE: I came up with a nasty workaround by using image field Alt or Title fields for filtering out via Views, it does the job, but from SEO point-of-view this is wrong. I put 'featured' value in Alt field for images I want to show up on the homepage slideshow, but that's wrong from SEO position, because Alt field should contain unique titles for each images for search engines to read it. Tagging them all as 'featured' is misleading.

So that's what I'm looking for, would be nice if you could add tick boxes next to Alt and Title fields. I tried image_field_caption module, it adds custom textarea field next to Alt and Title, but has no Views support, and again, you need to write 'feature' for each image instead of ticking it.

All this makes more sense now though.

Cheers


texts: how to alter view query to run over translated content done with lingotek D7 module?

texts:
I have a Multilanguage site done over Lingotek D7 module, has enabled search_api, search_api_autocomplete and solr. While typing text in autocomplete, query runs over original node (uploaded in x language) and I need to run it over the translated content when site is viewed in another language.

I have tried this solution without luck.
Search Api Autocomplete doesnt filter by language

please point me (I hope with some code) how I can alter (view?) query?


texts: Replace summary/description with another field in Views RSS output

texts:
I have a view for an RSS feed which uses the node output (only option it seems when RSS style is selected) so I cant choose custom fields. But, as the body field is 'text and summary' the RSS view uses that summary for the 'description' field but I'd like to use another field for that element in the feed.

Does that make sense?

An option is to just create another field-based view and my own templates to create an RSS output, but it just seems like such a trivial change to require so much work.

Would love to hear some thoughts.

Thanks in advance.


texts:
I cannot figure out how I can be able to search the fields(set as a new content type) in the Group module.

For example, I created Groups(Group-Shop, Group-Salon, etc) under Group-Type-A with 3 fields containing:

Name: J-Shop
Type of Shop: Motor Shop
Address: Chicago (uses geolocation)

After I added more data, I wanted to be able to search an item (Motor) and ALL related results should have shown up on the map (address of each items).

I've tried using a view with filter group content, but of course it would only search for related results (text) and clicking on the item/name would point me to the detailed info. I was looking to filtering/searching via Address/Geolocation of each group.


texts:
I'm not sure if this is possible in drupal 7, but I think I may have seen something like this happen before.  Let's say i added a content and you can see it at the url http://mysite.com/my-article.  In the content area, I'm displaying a block that's made by a custom module.  Right now, I have no problems going to a url like http://mysite.com/my-article?var1=hello, and then having my module responsible for creating the block to print $_GET['var1'].

However, the only change I would like to make is to have friendly urls.  I would prefer the url to be http://mysite.com/my-article/hello, then I would output the same content in my module block.   Is this easily do-able?


texts:
I want to change my site-wide email address. To do this, I changed the settings on admin/config/system/site-information. However, when I send an email from rules, it still uses the old email address.

How can I get the new email address to be picked up?


texts: drupal 7 views horizontal align not working in grid?

texts:
First time ever had this problem with views not rendering images to horizontal align in grid.

I have the Views module version 7.x-3.5 installed on Drupal 7.18.

I actually realized it is aligning for immediate view of links, but not within the view after clicking a link. How do I make all images horizontal align?


texts:
I want to create a separate html.tpl.php for user pages and user edit pages like html--user.tpl.php and html--user--edit.tpl.php.

For nodes I have added:

if (isset($node) && $node->nid) {
  $vars['theme_hook_suggestions'][] = 'html__' . $node->type;
}

in template.php.

Is there a way to do this for user pages as well?


texts: Customize admin content type page design

texts:
i have created template file for my contenttype wallpaper but i don't know how to get form design in that page.

for example

my content type name is wallpaper, so i create template file for page--node--add--wallpaper.tpl.php in that page how to get title,body etc ..

(ie)node add to page design.

Thanks for advance


texts: Disable email alerts when modules are out of date

texts: How can I disable Drupal's email alerts when modules or core are out of date?


texts: How can I list all the pages of a Drupal site in csv format?

texts:
My goal is to get a .csv file list of the titles/urls for all "pages" in a Drupal site, including all Views, panel pages, and nodes, etc.

Potential incomplete solutions:

Using the xmlsitemap module to generates xml then convert it to .csv format. This gets content types and menu links, but not views pages or panel pages or other cases. The downside here is that it only outputs the urls. It'd be nice to also have the titles.
Querying menu_links or menu_router tables. These list all the drupal paths, but not node paths or anything that requires the variable substitutions, ie "node/%".

I'm curious if there is a more straight forward way to do this. Any thoughts?


texts: Execute Drupal Feeds Import Programatically - Where to put code

texts:
I found this code for executing feeds importers programatically:

<?php

// Define the id (machine name) of the importer you want to use.
$importer_id = 'my_feeds_importer';

// Load the Feeds Source object.
$source = feeds_source($importer_id);

// Override configurations... (more on that in a moment)

// Execute the import.
$source->startImport();

?>

I'm just not sure where this code is supposed to go (I'm still pretty green when it comes to Drupal!).


texts: Querying entities taking an insane amount of time

texts:
Is the entity system in D7 not very well optimized? I am trying to iterate through 1500 entities using EntityFieldQuery(), and I had to extend my execution time to 300 seconds in order for the iteration to complete. I am getting 100% cpu usage just looping through each one.

$query = new EntityFieldQuery();
$query->entityCondition('entity_type','student');
$query->fieldCondition('field_student_deleted','value',0);
$result = $query->execute();

foreach ($result['student'] as $student) {
  $data = entity_load_single('student',$student->id);
  krumo($data);
}

Getting the 300 second response with or without krumo. I know that fields in entities have to be connected with JOINS, which are a performance hit as it is. Is there any reliable way to do what I am trying to do? It seems silly that an SQL database can handle hundreds of thousands of queries at a time but the system gets bogged down trying to process 1500 records.

Note: I could load the data all at once (rather than one entity load at a time), but I am not sure if there's any difference in performance between running entity_load_single with a single entity ID vs entity_load with multiple IDs. under the hook, entity_load just runs entity_load_single in iteration to obtain the data. The indexes on the entities are all created using the entity construction kit. It's a UI designed entity not a programmatic one.


texts:
I'm using facet inside my site and everything works fine.
But I can't display current selected facet inside a node.
I'm explain better.
A user choose from facet menu a birth day and an adress. When he see results and click on a node (I'm using view to display view results and the view has a title with 'link to its entity") what I'd want that he continue to see the facet so he can change his search.
An option is might be to using Ajax and see node type inside the search page. Is it the right way? How can I do it? Thanks in advice


texts:
I am displaying a list of Views blocks on the user page.

I want to create a menu/list of links on the sidebar of the page, and when I click the link "Block 1" it shows only the "Block 1". When I click "Block 2" it shows the block 2 and so on... All the other blocks must be hidden.

I could create several pages with the views and could link to those pages, but the thing is: I need to be in the user page, because the views have filters related to the user URL. So it has to be all in the same page.

What is the best way to do this?

Please see the picture explaining how I want the page.


texts: How do you remove product from shopping cart?

texts:
I have three product variations: Postpaid, Prepaid, and Accessories. I can't seem to figure out why when I add a product with the Accessories product variation, I'm unable to remove it from the Shopping Cart. However with the Postpaid and Prepaid product variation I am able to. Also, previously someone took care of the store, and I can't get support anymore.

I double checked the workflow Rules, and can't seem to find the options. I know it's not a view issue, because it shows the remove link with the Postpaid product variation.

My only work around is to add a new product through the Postpaid and Prepaid product variation, but I don't really want to do this because it's messy.

Please see screenshot below.


texts: how to do a list navigation into a node content

texts:
I have a content type with some custom text fields. when the node displays I'd like to show it like this:

node-title

field-1 (link)
field-2 (link)
field-3 (link)

field-1-content

field-2-content

field-3-content

this is for a new site, so I'd like to do that on Drupal 8 (with bootstrap theme).


texts: Taxonomy hierarchy in filter block of views isotope?

texts:
How can I set the filter block to show a hierarchical taxonomy? As far as I can see there is only a flat list being built by default. How can I change this and apply the hierarchy of a taxonomy?

This is the link of the module, of course do not answer if you do not know what is views isotope Module.


texts:
I feel like I have tried messing with every setting I can find but I simple cannot make my search_api search view return any results based on taxonomy names.

I want to be able to search based on a custom taxonomy and search on the fulltext field of the name.

I am using the built in database.
I have added the taxonomy term database sources.
I have added a relationship for the taxonomy term on
my custom views
In the fulltext search on the view the taxonomy name field is selected to be searched
In the index I have added the custom taxonomy I want included.
I have set it to fulltext and boosted in to 5.0

What else am I suppose to do?

Does anyone know of any guide or any information that explains how to make this work? It has been a month I still cannot get this module to return content that has associated taxonomy terms.

Is there any modules that do this? It should be a standard use case...


texts: Filtering part of a multi-value field in a specific view

texts:
I have an entity with fields that allow an unlimited number of values.

In a view, I would like to display a subset of those values that match a particular condition (eg. numbers less than n, dates in the past, etc.)

From investigation, it seems that a field formatter plugin is not a good way to solve this. Sure, I can extend DateTimeFormatterBase and override ::viewElements(FieldItemListInterface $items) to apply my condition, but at the price of being able to choose an actual field formatter. The custom plugin would have to take over the rendering too.

On the other hand, the Field plugin in views has some very limited options for limiting multiple values (by picking an offset and a count), but that doesn't seem extendable with a custom plugin.

Am I going to have to hook into the view after query execution to strip out the values that don't match the condition, or is there a cleaner way using the plugin API?

Edit: I suppose I could create a field formatter plugin that contains an option for selecting an actual formatter, and then passes the values that should be displayed on to it. This seems very roundabout, though. And this logic would have to be reimplemented for each field type!


texts: FieldCollection/PLUpload - Recurring error when uploading images on PROD - "No file by that name exists"

texts:
TL;DR Pantheon's distributed file system can't handle modules that refer to the temp file system across multiple requests, which messes up the Plupload module. What alternatives are there?
The error occurs when users upload images to the site using PLUpload, and it only occurs in the LIVE environment.  Our discussions with pantheon support indicate that this is likely something to do with our code not playing nicely with the load balancing in the live environment.  At this point though, we're pretty stumped on how to proceed.  I was hoping someone here may have encountered it and could provide some insight on how to proceed.
In case the screenshots do not share correctly, I have included a link to a google doc
Here's an example of the error message.

Some notes:

We uploaded 5 images here.  2 were rejected as you see in the pink
notification below.  The number of failed images appears to be
entirely random - sometimes all will work.  Sometimes just 1,
sometimes none.
We have tried changing the path
from temporary:// to public:// - this error appears to occur
regardless of where the temp space is pointed. Only occurs in the
live environment due to the load balancing in use with our hosting provider
Cloud-based hosting, so we do not have access to make changes to the load balancer.

Steps we've taken:

Insert watchdog in file.inc where we see this error
Enable dblog and try to reproduce the error you see above.
Identify the failure point in the debug log.  Here's what we see:

Watchdog is showing that the file in question does not exist
We check the SFTP, and it's definitely there.

In our discussions with the hosting provider, here's what we learned:

This is likely a fringe case that the load balancer doesn't have the ability to handle.
It sounds like the module is making a number of requests with the assumption that they can share a tmp directory.
and this comment:

Do you know if the PLUpload file issues multiple HTTP requests (via AJAX maybe?) when doing the uploads? If so, it may be that it's assuming that the temporary filesystem is shared between all requests.
This is a common flaw in a lot of contributed modules or plugins: they assume that there's only one place the code is executing, and that the "temp" filesystem space is available consistently across N requests.
This isn't what temporary filesystems are really for, but in a legacy single machine architecture it will rarely cause failures. Once you are distributed that assumption will fail quite reliably.

Now for the part that has us stumped:

It seems that PLupload might not be our best approach.  If we want to get it to work, we'd have to figure out how it's handling temporary file requests.
Our site was originally built with PLupload and Field Collection working together.  I'm curious if there's other modules we can look into that will allow us to get the functionality of both within the confines of the hosting environment.


texts: Multiple Price for same product in commerce kickstart?

texts:
I have installed Commerce kickstart. I have add the products.
Now my client asked Same product have two different prices. User will choose the price and pay it.

I am trying Commerce Donate module also.This module price for every product.

I need to change the price value for every product.


texts: View ignores unchecked "require this relationship"

texts:
I am building a view in Drupal 8 that calls for two relationships:

Nodes referenced by the current node (relationship required)
A single node referenced by the above reference node (relationship not required)

Although that second relationship isn't required, my view is still filtering out all nodes where that second relationship is null. Is anyone else having this problem?


texts: default_content import error field content_translation_source is unknown

texts:
I've exported a custom block content using default content module, when trying to import, I'm getting error

[ERROR] Field content_translation_source is unknown.

I've all 4 language modules enabled.


texts: Request parser best practices for Services 3.x

texts:
When you create a service endpoint you can enable various request parsers (application/json, application/x-www-form-urlencoded, multipart/form-data...) How should I decide whether to send the request using JSON vs form-data?

Most of the "node create" examples I've seen do something like this (I think this uses form-data):

    //create a node
    $node_data = array(
                      "title"=>"DHC Tool 01",
                      "type"=>"item",

                      "status"=>false, //ensure unpublished
                      "language" => "und", //lanugage neutral
                      "field_webpage"=>array(
                                              "und"=>array(
                                                            0=>array("url"=>"http://berkeley.edu",)
                                                           )
                                             )

                     );

  // Use JSON
  // $node_data = '{"title":"Tool Unpublished 10","type":"item","status":false,"language":"und","field_webpage":{"und":[{"url":"http:\/\/berkeley.edu"}]}}';
    $options['data'] = http_build_query($node_data, '', '&');
    $response = drupal_http_request($base_url . '/node', $options);

Is there any advantage to sending the node create request using JSON?

How would the above code be modified to use JSON?

Thanks!


texts: how to access custom function in twig template file

texts:
I've write small custom function in my .theme file. Is it possible to call that function in twig template files?

I would like to fetch description value for a field in views template file, so can we add a function like function getFieldDescription($field) and access in views template file ?

Ex: https://www.drupal.org/node/2486991 has url() function, which we can use in any twig template file.


texts: Get paragraph field in a specific text format

texts:
I have a landing page with a list of paragraphs. I'm trying to render the main body paragraph field as a summary to use in a metatag in the header.
$basic_content_block->get('field_content')->first()->getValue();
Returns:
[
    'value' => "
Some rich text here. "basic_html"
]

How can I return this field as a teaser view, or more appropriately, a summary of just the text?


texts: Display custom URLs for individual tabs of quick tab

texts:
I need to display seperate URL(Deep linking) for individual tabs in a quick tab. I found a javascript fix in this link . The URL that is displayed has the quicktab name and tab number. It looks something like /test-quicktab-page?qt-test_quicktab=2. I need a more meaningful url to be displayed. For example /test-quicktab-page/world
or /test-quicktab-page/local . How can this be done?

I tried creating a URL alias but that didn't help.


texts: Disable or remove permissions for Scald page display

texts:
It appears to me that Scald does not have a permission allowing you to set who can view the "page view" of the atom /atom/ATOMID.

Is there some way to restrict access to this page or revoke permissions from roles?


texts:
First some introduction:

The hook is working in other pages or direct urls.
The only situation where is not working is in the find content page, "admin/content".

When the user clicks on edit link, drupal loads the node edit page, but we need to redirect that edit page to our own edit page. That's why we use the code in the hook.

THE PROBLEM:

When the user clicks on edit, he or she is redirected to the same page again (Find content). Intead of going to the my_module edit page. I Don't know why it's happening this. Any help is welcome :)

The Code:

function my_module_init() {

    // redirect drupal edit page to our own module edit page.
    if (preg_match('/^node\/(\d+)\/edit$/', current_path(), $matches)) {
      $code = _my_module_check_code($matches[1]); //check if the nid is of the content type we need
      if ($code) {
        return drupal_goto('my_module/' . $code . '/edit');
      }
      // If the code is not from the content type we need, we do nothing
      // just leave drupal work it's way
    }

}


texts: How can I add styles attribute to Global Custom field markup?

texts:
I have created a view to display my articles and I would like the article thumbnails to be used as background.
So I added the different fields I've hidden.

I added a relationship to the image field to get the thumbnail URI. Then I added the following code in the custom global field.

{{ field_categorie }}

{{ title }}

{{ created }}

But on display, the style is ignored.

Instead of
, I have
.

How can I make Views to print the style attribute to let me put a dynamic background image URI?


texts:
I've got a content type with a field who contains a default value. In this default value there is an image and I would like to change the source of this image to all the existing contents.

from  to

How can apply this to the existing contents?

Thanks in advance.


texts: In commerce funds where is the fund getting deposited?

texts: In commerce funds module there is an option to deposit funds. When clicked on this link it takes you to the payment gateway where you can enter the amount you want to deposit. My question is where is this amount getting deposited? I can see the account balance (point on the website) of the user getting increased by the deposited amount but is there a bank account where the deposited money is transferred to?


texts: Print profile2 fields in user-profile.tpl.php

texts:
Been trying to print the profile2 fields in the user-profile.tpl.
The fields are of type: taxonomy reference field and link field.

The documentation provided in drupal doesn't work.

Workarounds provided in the profile2 issue queue here and here either prints the current users value in every profile or renders it twice.

It'll really great if someone can help me with this. Thanks for your time.

In user-profile.tpl the below renders the fields twice, once within the div and other without it from "print render($user_profile);"

    <div class="athlete-info">
    <?php $user_uid = $elements['#account']->uid;
    $profile = profile2_load_by_user($user_uid, 'athlete');

     print drupal_render(field_view_field('profile2', $profile, 'field_name', 'value'));
     print drupal_render(field_view_field('profile2', $profile, 'field_twitter','value'));
     print drupal_render(field_view_field('profile2', $profile, 'field_facebook', 'value'));
     print drupal_render(field_view_field('profile2', $profile, 'field_role', 'value'));
     ?>
     </div>

But this causes an error page on other user roles who don't have to fill up the athlete profile type. :(

EDIT: I am using the profile 2 module to create a profile called athlete with few extra fields like field_facebook,field_twitter and assign them to users of a particular role.


texts: User menu page visible to the author user (uid)

texts:
The view module has a great function when set a menu tab with contextual filter user:uid, so the user that is author of that node will be able to see the content. Lets say for an example the flag module has a view bookmarks, so when a user choose some node to follow/flag it will be available in his user/%/bookmarks.

How can I do this with custom code?
I have my code here as a test:

<?php
function mymodule_menu() {

    $items = array();

    $items['user/%/add-news'] = array(
        'title' => 'Hello World',
        'page callback' => 'mymodule_user_news',
        'page arguments' => array(1),
        'access arguments' => array('access content'),
    );

    return $items;
}

function mymodule_user_news() {
        return 'Hello world';
}

This "Hello World" everybody can see it. Of course, because I'm using
'access arguments' => array('access content'),

How can I set this page to be visible only for user author?

I'm planning to add here a form, so the user can fill the form and send it to the administrator of the website.

Oh, by the way when I set a link only visible to the author user I use this
 echo l(t("Profile edit"), 'user/' . $GLOBALS['user']->uid . '/edit');

How can I use the $GLOBALS['user']->uid in a module?


texts: How to import multiple values in a text field with Feeds module?

texts:
In my content type, I have a text field that allow an illimited number of values.

How do I configure Feeds to import multiple datas in this kind of field?


texts: Is it better to create a taxonomy term using the 'create' method of the base Entity class or the entity storage manager?

texts:
I've seen multiple ways to programmatically create entities.

In this case I'm creating a taxonomy term. One is using this method

$term = \Drupal\taxonomy\Entity\Term::create([
  'name' => $name,
  'vid' => $vocabulary,
])->save();

Where I'm using the base entity class's public static create function. Another way to perform the action is using an entity storage manager. Like so:

$term = [
  'name'     => $name,
  'vid'      => $vocabulary,
];

$term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->create($term);

I looked up the 'create' function of the base Entity class and it seems to just be implementing what appears in the second example I provided. Is there a better practice between the two? Or does it not matter?

UPDATE: Also is there a difference between what the two return? Unless I'm doing things wrong I noticed that the top method returned an int which I'm assuming is the term id.


texts: Is it possible to display more than one node in a page?

texts:
I am trying to display two nodes in Drupalgap.

//page_callback
function tung_intro_page() {
  var display_page = '' + '

';
  display_page += '

' + '';
  return display_page;
}

function tung_intro_pageshow() {
//  drupalgap_alert('My pageshow event has been called!');
 try{
        var nid = 13;
        node_load(nid, {
        success:function(node){
         var title = node.title;
         var content = node.content;
         //var whole = html(title) + html(content);
         $('#' + 'my_node_' + nid).html(content).trigger('create');
          }
        });
        nid = 3;
        node_load(nid, {
        success:function(node){
         var title = node.title;
         var content = node.content;
         $('#' + 'my_node_' + nid).html(content).trigger('create');
          }
        });
  }
  catch (error) { console.log('tung_intro_pageshow - ' + error); }
}

This only shows the content of the last node. How can I show both the nodes?


texts: Problem with restricted download links (hook_file_download)

texts:
On my site I have a bunch of files that require logged-in user for download access.
Well that's not about just display access, I also want to avoid passing download links around.

Having read about the performance implications of using private file system, I decided I cannot afford it so I thought I'd write a small module to control the download.

The code looks like the following:

/**
 * Implements hook_permission().
 */
function docwatch_permission() {
  return array(
    'docwatch download restricted documents' => array(
      'title'       => t('Download restricted documents.'),
      'description' => t('Download technical documents from secured directory.'),
    ),
  );
}

/**
 * Implements hook_file_download
 */
function docwatch_file_download($uri) {
  if (strpos(file_uri_target($uri), 'secure/docs') !== 0) {
    if (!user_access('docwatch download restricted documents')) {
      // Access to the file is denied.
      return -1;
    }
    else {
      return array('Content-Type' => file_get_mimetype($uri));
    }
  }
}

And I'm using this debug code to inspect what Drupal "thinks" of the link to the file it displays:

function MYTHEME_file_link(&$variables){
  $file = $variables['file'];
  $uri = $file->uri;

  if (strpos(file_uri_target($uri), 'secure/docs') !== 0) { // <-- part of the secure dir path
    if (!user_access('docwatch download restricted documents')) {
      drupal_add_js("console.log('no access')", 'inline');
      // Access to the file is denied.
      // return -1;
    }
    else {
      drupal_add_js("console.log('ok to download')", 'inline');
      // return array('Content-Type' => file_get_mimetype($uri));
    }
  } else {
    drupal_add_js("console.log('from unsecured')", 'inline');
  }
}

I then open a page where the link is displayed in two browsers, one with a logged-in status for that role, and the other - plainly anonymous. The console properly reports that difference, yet - despite that the anonymous browser is permitted to download the direct link to the document.

What am I doing wrong?


texts: Show a dynamic text depending on the day

texts:
I'd like my Drupal website to show at the right top something like:

  ____ day (eg. Medicine day)

and fill __________ dynamically depending on the current day.

I will create a new content type DayType or something like that, with two fields:

Title
Date

My question is:

How can I show in __________ the title depending on the current day?

I could do that with a View, but what I don't know is how to show it on the right-top, and not apparently in a block or just in a new page.


texts: how to block internal Drupal paths for anonymous users?

texts:
Is it possible to block internal Drupal paths for anonymous users and leave only paths generated by pathauto? For example:

block path: /taxonomy/term/5
leave path: /products/books

In google webmaster tools for my site, all taxonomy pages have an issue called "Pages with duplicate title tags" and google is showing both paths for each term, which is a problem. How to block the internal Drupal path for anonymous users?

By the way, apart from this, some taxonomy terms are purely for config and their paths should be blocked not because googlebot has a problem but generally, those paths make no sense for non-admins and should never be accessed directly via url.


texts: How to make all render caches update on a configuration override?

texts:
Short version:

I am using a configuration override to override the site name. Changes are reflected in the HTML title, but not in the system branding block. Drupal keeps serving this block from the render cache.

Long version:

I am using a configuration override service that implements ConfigFactoryOverrideInterface, which overrides configs on demand. Slightly simplified, it looks like this:

class MyConfigOverride implements ConfigFactoryOverrideInterface {

  /**
   * {@inheritdoc}
   */
  public function loadOverrides($names) {
    $overrides = [];

    if ($override_required) {
      if (in_array('system.site', $names)) {
        $overrides['system.site']['name'] = 'My name';
      }
    }
    return $overrides;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheSuffix() {
    return 'MyConfigOverride';
  }

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

    if ($name === 'system.site') {
      $my_entity = MyEntity::Load(1);
      if ($override_required && !empty($my_entity)) {
        // Append entity cache metadata (cache tags and context).
        $metadata->addCacheableDependency($my_entity);
      }
    }
    return $metadata;
  }

  /**
   * {@inheritdoc}
   */
  public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
    return NULL;
  }

}

However, as soon as this override kicks in, the render cache for the System branding block does not get updated with the new site name. This is because the SystemBrandingBlock class does implement getCacheTags() in which it merges the system.site cache tags (see below), but it does not implement getCacheContexts() (which my module uses since I serve a variation of the page).

/**
 * {@inheritdoc}
 */
public function getCacheTags() {
  return Cache::mergeTags(
    parent::getCacheTags(),
    $this->configFactory->get('system.site')->getCacheTags()
  );

}

I have tried to overcome this by adding additional 'empty' cache metadata to my class for the cases where the override does not apply.

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

    if ($name === 'system.site') {
      $my_entity = MyEntity::Load(1);
      if ($override_required && !empty($my_entity)) {
        // Append entity cache metadata.
        $metadata->addCacheableDependency($my_entity);
      }
      else {
        // Append 'empty' cache metadata.
        $metadata->addCacheContexts(['mycachecontext']);
        $metadata->addCacheTags(['myentity', 'myentity:0']);
      }
    }
    return $metadata;
  }

Since the block does not inherit the cache contexts of system.site and I do not update or otherwise invalidate any of the provided cache tags ('myentity', 'myentity:0'), the render cache still persists. I can append cache context to the system branding block in a hook_block_build_BASE_BLOCK_ID_alter implementation, but I'd prefer not to implement such specific exceptions as they will never cover all situations.

I am somewhat hoping for a hook to update all renderable elements (blocks?) and append cache contexts to those that inherit cache tags provided by system.site. But I am open to alternative solutions as well.

How can I make any block or other entity in the render cache, that is depending on the system.site config aware of the config override?


texts: How to quickly configure allowed content for panelizer?

texts:
I am developing a site which will have about 15 content types such as news, events, course etc. I need to configure allowed only specific content for panelizer. When I go to allowed content option there are tons of checkboxes which I have no problem in configuring. The problem is even though they have to be same for all content types (15 total) I have to manually repeat this task for about 15 different content types.

So is there any way this can be automated?


texts: TWIG if/else to filter through templates

texts:
I am trying to write a TWIG else/if statement that loops through four different templates based on the number of customers are chosen from a list. So if a designer chooses 1 customer a certain template is used to create that view, and if they choose 3 customers a different template is used.

{% if content.field_featured_customers|length == 1 %}
{% include "node--customer--featured-full.hmtl.twig" with content.field_featured_customers %}
{% elseif content.field_featured_customers|length == 2 %}
{% include "node--customer--featured-split.html.twig" with content.field_featured_customers %}
{% elseif content.field_featured_customers|length == 3 %}
{% include "node--customer--featured-3block.html.twig" with content.field_featured_customers %}
{% else %}
{% include "node--customer--featured-carousel.html.twig" with content.field_featured_customers %}
{% endif %}

This is what I have tried so far, but nothing is rendered. I have created templates for all of the different views I am trying to display. Here is an example for the featured-full.html.twig

{{ content.field_logo }}

{{ content.field_comapny_name }}

{{ content.field_description }}

Learn More

Am I doing something wrong in the if/else statement, do I need to create different views, or is there something in the theme that I need to include?


texts: How to access fields value in views-view--[viewid]--[view-display-id].html.twig template

texts:
I'm trying to customize a View in Drupal 8 where I display a Bootstrap Carousel.
What I've managed to do so far was the right template name, by specifying the viewid and view-display-id.
The view name is homepage-carousel and the view display id is block 1, therefore the template name views-view--homepage-carousel-block-1.html.twig or views-view--homepage-carousel.html.twig.

Now I need to show the content of the fields of a specific Content Type. I've tried with {{ fields.title }}, but it doesn't work. I've also tried to change the template name in views-view-fields--homepage-carousel-block-1.html.twig, but the system doesn't recognize it, so it displays the default view.

Here is the code:

{{ fields.title }}

          {{ fields.field_carousel_subtitle }}

How can I show the fields from this kind of view template?

UPDATE
I've tried to rename the template as suggested JeremyM4n, I've flushed all the cache, but it still doesn't work. The view is displayed as default, namely how it is set up in the /admin/structure/views/view/ section.

I haven't mentioned it yet, so I specify it here: the format of this view is Bootstrap Carousel

UDPATE 2

I managed to find a solution by by overriding the views-bootstrap-carousel.html.twig template in view_bootstrap module. In my case, the name of the template is the following: views-bootstrap-carousel--homepage-carousel--block-1.html.twig

Here is the code:

  {# Show indicators if set in view. #}
  {%  if indicators %}

      {% for key, row in rows %}
          {% set indicator_classes = [loop.first ? 'active'] %}

      {% endfor %}

  {% endif %}

  {# Carousel body. #}

    {% for row in rows %}
      {% set row_classes = ['item', loop.first ? 'active'] %}

          {{ row.image }}
          {% if row.title or row.description %}
            {%  if use_caption %}

            {% endif %}
              {% if row.title %}

{{ row.title }}

              {% endif %}
              {% if row.description %}

{{ row.description }}

              {% endif %}
              {{ row.field_carousel_button_text }}
            {%  if use_caption %}

            {% endif %}
          {% endif %}

    {% endfor %}

  {# Controls #}
  {% if navigation %}

      {{ 'Previous'|t }}

      {{ 'Next'|t }}

  {% endif %}


texts: Add a custom body class to node edit/create page

texts:
In D8 how could I add a body class to a node create or edit page in a custom theme?

Am thinking there should be a way of doing this via the preprocess_html function in my theme file.

Please note that I'm trying to add a class to the body of a node create or edit page, not a normal node page. This is a very specific thing I'm trying to do which is not met by any previous answers.

I'm hoping that there is some variable within the preprocess_html function that can target these pages.


texts:
I want to try override a class. I manage to replicate the description here;
https://www.hs2solutions.com/blog/drupal-how-override-core-drupal-8-service

However, I want to override the NodeViewBuilder class. How can I find out what definition to use?

Is there any documentation about how definitions works?


texts: How to Make Group Content Private if Group is Public and Approval Required?

texts:
I am using OG 7.x-1.4 version. If a Group is Public & Approval required then Group Content Created Under that group is by default becoming public when i use Group Content Visibility field and select "use group defaults" option.

I think if Group is Public & No Approval required then Group Content Should be public, otherwise access should be restricted to only Group Members.

My Question is, how to set Group Content Visibility field to  Private by default if Group is Public & Approval Required ? One option is using Hook_node_presave !

Any better solution to set default Group Content Visibility based on Group Settings ?


texts: Change display of teaser based on content type of page in which it is displayed

texts:
So I know you can define how to display a teaser for different content types using if($teaser) in node--content_type.tpl but how can I add logic to render the teaser in different formats depending on the content type of the page in which it is being displayed?

I want to do this

if($teaser && CONTENT_TYPE_OF_PAGE_THAT_TEASER_IS_DISPLAYED_ON == content_type)

within node--content_type.tpl is there a way to go about this?

For example I have teasers of content type blog. But I want these teasers to display different when they are on a page of content-type:blog, to when they are displayed on a page of content-type:level_3.

Thanks for your time


texts: Sending email notifications to all editors the content's editorial section on content state change

texts:
I am using Using Workbench for content moderation and Workbench Access for access control.

Is it possible to use the rules integration to send an email to all of those users who are in a content node's editorial access control?

The screenshot shows what I've currently got, which is sending the notification to one particular email address on state change to Needs review.


texts:
I have googled and found a few articles:

http://nossdutytask.com/drupal_config/step_by_step_enable_view_post_access_counter_on_drupal

Only I don't want to show the counter as a block but as a field in a VIEW. I followed the above article but when I add fields to my view I cannot find any stat or counter or anything.

Is this possible without writing a custom module or tweaking my template.php and populating this value programmatically?


texts: how to export nodes and their referencing entities

texts:
I have a site which has some content types which have custom entities which refer to them.

The exact example we are using is https://drupal.org/project/registration.  We have event nodes which have registrations. I need to export all the nodes and the entities which reference them. The Node Export module works fine for nodes but misses these entities. And of course, besides for actually exporting them, we need to maintain the node/registration relationship.

What is the best way of doing this?


texts:
I have made a few admin items for our site and we would like to collapse them into a series of nested menu options.  I've found all our menu items, and changed the path to be nested properly.  I've flushed cache, and some of the menu items get nested, others done.

One thing about this is that the 'root' for menu is in a feature module, and most of the other children for this root are in a custom module.

In an attempt to get this working, on my local instance, I disabled the custom module, which in turn disabled the feature module that holds the root.  After re-enabling the feature module, then the custom module, the menu structure I am looking for appeared.  However, I'm not too keen on disabling/re-enabling modules on a prod site to get an admin menu working.

I also tried going into devel/php and executing menu_rebuild();.  There was no change in the menu before or after flushing the cache.

Is there a way to rearrange my admin menu more appropriately?


texts: Taxonomy Parent Term page with Child Terms and their description + teasers (with condition)

texts:
I'm working on a website with several vocabularies. Two of them are build like this :

Parent Term

Child term#1

Child term#2

Child term#3

Only one parent and some children.

I have two Content Type, each uses one of these two vocabulary. When I create a node I can set only one term (the reference field is a drop-down list).

For the first vocabulary I'd like to show on the Parent Term page all of his Child Terms with their Description and Teasers that are related to them :

h1 (Parent Term)
h2 Child Term#1 + Term description + Teasers
h2 Child Term#2 + Term description + Teasers
h2 Child Term#3 + Term description + Teasers

For the second vocabulary I'd like to show the same thing one the Parent Term page but with a specific filter. If the Child Term possesses a boolean field set on FALSE then the teasers are not showing and a link to the Child Term page appears :

h1 (Parent Term)
h2 Child Term#1 (boolean TRUE) + Term description + Teasers
h2 Child Term#2 (boolean TRUE) + Term description + Teasers
h2 Child Term#3 (boolean FALSE) + Term description + link to Child Term#3 page

I know some basics with Views, Page Manager and Panels and I think this is a pretty basic configuration but for some reasons I don't understand how to do it…

Thanks


texts: How to use HTML entities in links in Drupal 8?

texts:
I have a client who prefers some links to have the » symbol at the end. This is typically produced with the » HTML character entity.

In Drupal 7, you would do something like this:

l('Go there &raquo;', 'node/1', array('html' => TRUE));

But how do you do it in Drupal 8? The following won't work because of new sanitization rules:

$node->toLink('Go there &raquo;', 'canonical', ['html' => TRUE]);

They want the raquo in the link, not as a suffix.


texts: How can I set variables only once per block?

texts:
I have a block module that displays some data taken from XML. That module has multiple  (approx. 7) blocks, each of which displays a different "view" of the same XML. Each block can be positioned independently on the page, but all of the blocks are displayed at once and all of the blocks use the same data.

Since the XML parsing code runs inside the block_view() hook, it runs once for every block.

My problem is that the XML parsing is expensive in terms of time (not hugely so, but easily >95% of the total module runtime), and this is a page that I want to run as fast as possible.

How can I move the XML parsing out of the block_view() hook and run it once per page view? Is there another hook that will let me set some global variables or something like that?

function my_module_block_info() {
    $blocks[0]['info'] = t("My Module: block one");
    $blocks[1]['info'] = t("My Module: block two");
    $blocks[2]['info'] = t("My Module: block three");
    ...etc (~7 blocks total)...
    return $blocks;
}

function my_module_block_view($delta = '') {
    $parsed_stuff = parse_some_xml();
    switch ($delta) {
        case 0:
            $block['subject'] = t('Blah');
            $block['content'] = block_0_html($parsed_stuff);
            break;
        case 1:
            $block['subject'] = t('Yada');
            $block['content'] = block_1_html($parsed_stuff);
            break;
        case 2:
            $block['subject'] = t('Etc');
            $block['content'] = block_2_html($parsed_stuff);
            break;
        ...etc (~7 blocks total)...
    }
    return $block;
}


texts:
I am using the Image and the Galleryformatter module. I am getting these two errors on configure media page:

Warning: Division by zero in theme_image_style_preview() (line XXX of /.../modules/image/image.admin.inc).

Warning: array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line XXX of /.../modules/image/image.admin.inc).


texts:
How to add new group permissions? describes how add new group permissions when using the Drupal 7 version of the module.
function [mymodule]_group_permission() {
  return array(
    'schedule publishing of nodes' => array(
      'title' => t('Schedule content publication'),
      'description' => t('Allows users to set a start and end time for content publication'),
    ),
    'view scheduled content' => array(
      'title' => t('View scheduled content list'),
      'description' => t('Allows users to see all content which is scheduled.'),
    ),
  );
}

This does not appear to be the case in Drupal 8.
How can I add my own custom permissions to the group permissions screen, in Drupal 8?


texts:
Answer to my question was found here: Show all child nodes of a taxonomy term D7.

But I'm not able to understand the use case of the second option: "Content: Has taxonomy term ID depth modifier" as in the figure.


texts:
In Drupal 6, queries are issued with db_query(). Using %-modifiers, query arguments are substituted into the query after being filtered. Strings %s (and only strings) are ultimately run through mysqli_real_escape_string() (using db_escape_string()).

Looking at the php docs for mysqli_real_escape_string(), I see the following security warning:

  The character set must be set either at the server level, or with the API function mysqli_set_charset() for it to affect mysqli_real_escape_string().

The answer to another question about mysql_real_escape_string / SQL Injection explains that:

  Another way to get yourself into hot water using
  mysql_real_escape_string is when you set the database connection
  encoding using the wrong method. You should do this:

  mysql_set_charset('utf8', $link);

  You can also do this though:

  mysql_query("SET NAMES 'utf8'", $link);

  The problem is that the latter
  bypasses the mysql_ API, which still thinks you're talking to the
  database using latin1 (or something else). [...] This can be used for
  injection attacks in certain multibyte string situations.

Drupal does not call mysqli_set_charset(), and instead issues the query 'SET NAMES utf8'. This can be seen in db_connect().

In order to properly protect Drupal 6 against SQL Injection, does the charset need to be set at the server level?


texts: User role referencing when they might not exist

texts:
I'm making a Drupal 7 site that has an event content type. There are two user roles: venues and speakers, and both can create events. I need a way for both to be referenced in the node (with auto-complete), but keeping in mind that they won't necessarily have an account on my site.

Example 1: The venue "Big Conference Center" creates a new event called "Cool Conference 2012". Their speaker is John Doe, so they enter his name in a text box, it finds him using user role Speaker auto-complete, and he is referenced. If you go to John's user page now, it lists Cool Conference 2012 as an event he is speaking at.

Example 2: The same venue creates another event. This time the speaker is Jane Anon, who doesn't have an account on the site. The auto-complete returned nothing, so Jane Anon is stored in plain text in that field. When Jane Anon joins the site two weeks later, she is presented with a list of events that match her name, and she can select which ones are hers. Then, the plain text changes to a reference.

Examples 1 and 2 should work the same if it's the speaker who is creating the events and the venue who is referenced.


texts: Unable to render block in twig after updating Twig Tweak module

texts:
I update the Twig Tweak module to version 8.x-2.x. After this update I can't render my disabled blocks anymore?

Before I used {{ drupal_block('myblockname') }} to render my block in the twig template.

Now I try to use {{ drupal_entity('block','myblockname', check_access=false) }}. But I don't see my blocks in the frontend?


texts:
I have a view that display a list of nodes of a content type that has a date field.
I'm trying to add a sort criteria based on this data field, I can select it but hust after that I get returned to the main views screen, without the data sort.

I know that data fields are sortable so where can I have more informations about "why" this field is not added to sort criteria?


texts:
I have created a custom form in form field following code is there.

 $form['display_result'] = array(
   '#title' => 'Result' ,
   '#type' => 'textarea',
   '#value' => !empty($dval) ? $dval : null,
   '#default values' => '',
 )

Problem is $dval is array which includes following code:

    stdClass Object
(
    [to] => Tove
    [from] => Jani
    [heading] => Reminder
    [body] => Don't forget me this weekend!
)

I am getting following warning:

  Warning: htmlspecialchars() expects parameter 1 to be string, object given in check_plain() (line 1571 of /var/www/html/D7/includes/bootstrap.inc)


texts:
In our environment, we make changes to a drupal site that are then replicated to an outside webserver. We do not want people to be able to log into the drupal site from the outside. I want to remove whatever file /user and /admin resolves to but I can't find any information on this. In wordpress, you delete the wp-admin folder. Is there anything like this with Drupal? Turning off the "Allow login" setting will not work for us.

Note- We cannot make any changes that are saved in the database. Changing Drupal settings will not work. There's got to be a login file on the server we can delete.


texts: Nodes unpublished by SQL query are accessible to anonymous user

texts:
This issue is in context of node type product, which means nodes are products here.

Scenario 1 (Desired behaviour):

I've logged in as Admin
I've Unpublished Node: 12345
After logged out (or in another browser where I'm not logged in), if I try to access that node, I see "Access denied" message

Scenario 2 (Undesired behaviour):

I'm not logged in Drupal front end or admin
I'm using a script which executes SQL queries in node and node_revision tables to update status field to 0 to Unpublish the node
After that, if I try to access that node in browser without logged in, I see article image(s) and title: product description with pink background but not the rest of the article content.

In permission, Unpublished nodes are not accessible by anonymous users.
Basically I'm new in Drupal and wants to publish/unpublish nodes in bulk (could be in 5-10k) from CSV file.

Can anybody help to fix this issue? I don't want pink background and partially accessibility to the node. It should show "Access denied" message when Unpublished.


texts: Drupal 7 Create a new account for an anonymous order only for commerce license orders

texts:
With Drupal 7 using Rules 7.27, I've installed and set up Drupal Commerce with no real problems.

The rule ‘Create a new account for an anonymous order’ works well but I need to add a condition that only executes the action of creating a new account only if the product being ordered is a Commerce License. Commerce License is an entity so I tried both of the following conditions, but they prevent the Rules actions from triggering:

Entity is of type: Parameter: Entity: [site:current-cart-order], Entity type: Commerce License

Entity is of type: Parameter: Entity: [commerce-order], Entity type: Commerce License

It's apparent I don't have a full grasp of how to tell the Rule that the order processed is not just any old order but a specific order type. I would be fine with identifying it with any criteria possible, like product/order name, but it seems that I've hit a blockage in understanding the whole Commerce universe in relation to Rules.

Does anyone have any idea what conditions to specify to tell the actions only to fire if the order is for a commerce license?


texts: Content Field Type For Video, Images and Text

texts:
I'm trying to decide what the best method would be for creating a new Content Type who's field type would allow me the flexibility to use ANY type of content inside of it. Almost like a blank HTML container. I'd like the flexibility to manipulate the content in that space to a video, rotating image, static image or text based on my needs. Would there be an appropriate field type to manage all of this?

Or would the appropriate answer be to create three separate content types that live one after the other in the area that I want them to be, then have them hide if no content is visible in them?

Apologies if this question has been answered in the community to date, but I've yet to come across a straight answer.

Thanks in advance!


texts: Converted CSS/HTML theme to D7, .js files ignores integrated jQuery and works only with jQuery imported via .info

texts:
I got a basic static CSS/HTML theme which is using some .js like jcarousellite.js and it has a jquery file together which is jquery-1.4.2.min.js

So I import that jcarousellite.js via theme's .info:

scripts[] = js/jcarousellite.js

Then there is some inline script which goes with that template, so I pasted that to my html.tpl.php

    $(function() {
         $(".carousel").jCarouselLite({
                    btnNext: ".next",
                    btnPrev: ".prev"
         });
});

Now, to make it all work, it needs jQuery. So since D7 loads jQuery by default from its core (and it does load it and current version is 1.4.4 that comes with Drupal 7.21) I understand that the jquery-1.4.2.min.js which comes together with static template is not needed right? So I do not add it to my .info and after flushing caches and everything, it loads my jcarousellite.js and it loads inline .js, but it doesn't work.

If I load that jquery-1.4.2.min.js via .info then all .js is working on the website. So what I am missing? How to make it work without importing that older jquery library via .info and using the jQuery from Drupal's core? Now both and core jQuery and that custom jQuery libraries are loaded at same time.


texts: Load all/multiple fields from entity of certain type

texts:
I'm quite new to Drupal so bear with me here.
I've created an entity using Drupal Console, specifically using drupal generate:entity:content. Which works perfectly. Kudos to the Drupal console guys.
This specific entity will deal with adding some meta tags on specific URLs thru the site.
It has several fields that need to be completed: url, keywords(if any), one open graph tag, and a tag value.
After looking through this question I've decided that using hook_page_attachments is the way to go for me.
The logic for adding the tags is quite simple:

Get the entity.

$entity = \Drupal::entityTypeManager()->getStorage('meta_tag_entity')

Grab the current url.
Loop through the entity url fields and check if any matches the current url.
If it does, simply add the tags.

And that's it.

The problem boils down this.
After I've loaded the entity ($entity = \Drupal::entityTypeManager()->getStorage('meta_tag_entity')) I have no idea how to grab all the url fields.
I've looked over this question but it's not quite what I'm looking for.


texts: Create configuration storage programmattically for list_string

texts:
On a paragraph type, I have a field I want to migrate to a new field of type "list_string". To do that in the deployment and like our automatic deployment begin by an update of the database follow by importation of configurations, I want to create the new field programmatically before to do the migration in another hook_update.

I'm using the example of this article https://www.metaltoad.com/blog/programmatically-importing-drupal-8-field-configurations which is perfect except I have a problem because my new field is of type list_string. My configuration for field.storage is:

langcode: fr
status: true
dependencies:
  module:
    - options
    - paragraphs
id: paragraph.field_types_link
field_name: field_types_link
entity_type: paragraph
type: list_string
settings:
  allowed_values:
    -
      value: anchor
      label: Ancre
    -
      value: internal
      label: Interne
    -
      value: external
      label: Externe
  allowed_values_function: ''
module: options
locked: false
cardinality: 1
translatable: true
indexes: {  }
persist_with_no_fields: false
custom_storage: false

When I create my new field based on my configuration file like that:

$field_storage_link = \Drupal::service('config.storage.sync')->read('field.storage.paragraph.field_types_link');

\Drupal::entityTypeManager()->getStorage('field_storage_config')
  ->create($field_storage_link)
  ->save();

I have this error.

  [error]  The configuration property settings.allowed_values.0.label.0 doesn't exist.

If I remove the list of allowed_values, it works and I can add my field to paragraphes bundles but in this case, I'm not able to do my migration properly because the allowed_values of my field are empty and I don't know how to update it programmatically. Someone can explain what's is the problem in my code and how to fix it?


texts: The node from one content type doesn't appears in Nodequeue

texts:
I'm using Drupal 7 and nodequeue module with Royalslider.All other content types are working fine but only one content type which is named as Real Estate Listing doesn't show it properly.

Here's even it's available in queue list:

and here's how it's displaying in slider:

All of other content type nodes it displays all queues as:

But for Real Estate content type node it displays only 2 queues as:

What can be wrong?

Thanks in Advance!


texts:
I'm trying to use Raphaël with a Drupal 8 website. I'm wondering if there's a step I'm missing, or maybe some other issue, as it doesn't seem to work. I suspect I'm just missing a step in using extra javascript on the site.

For reference, I'm using a version of the raphael code - found at justgage.com. I placed the primary js (justgage.js) in my "js" folder and added it to the js folder in my custom theme, and linked to it in my libraries.yml as a global resource.

Then I created a block, added to the home page, and dropped the code from one of the examples that comes with the zip file. (custom-value-renderer.html) Unfortunately, the gauge doesn't appear.

I thought it would be that simple, but nope. I also tried with the justgage.js added right to the page.

To add detail, I've added the below to a full html field of a content type:

That's it. I placed the js from JustGauge to the js folder inside my custom theme, and then modified the mytheme.libraries.yml to include this:

global-js:
      js:
        js/raphael-2.1.4.min.js: {}
        js/justgage.js: {}
      dependencies:
        - core/jquery

Then I connected the library, in mytheme.info.yml adding:

libraries:
 - cyberscout/global-css
 - cyberscout/global-js

I think that's all I need. I don't need to add any functions in Drupal 8, like in 7 - it's a global. And, again, I tested by adding a little alert('hello world') to the two scripts referenced in library and navigated to the page. They gave me the alert. I also tried putting the two scripts (raphaël and justgage) directly on the page twig. This made some difference. The code doesn't work, but at least I see part of the svg appearing. But - this is a wrong and slow way of doing this. It confuses me too, becuase the 'hello world' add-in worked, doing it the correct way.

maybe there's some requirement I need to add? I did reference this page of instructions and don't see that I'm missing anything: https://www.drupal.org/docs/8/theming/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme


texts: User photo gallery that another user can view

texts:
I'm looking to give my user the ability to to have a personal photo gallery that when another user clicks on their profile they can see said gallery?

I know i can create a content type and view, but not sure where to go from there as far as only exposing the necessary photos for a specific user to another. basically a dumb-ed down version of what Facebook has as far as photos.


texts: Using MSSQL ROW_NUMBER() (or any window function) in D7 dynamic query with addExpression()

texts:
I have a query with a bunch of joins, conditions, etc that uses ROW_NUMBER() OVER(PARTITION BY ... ORDER BY ...) to group the results so that I can filter them further on the resulting row number:

SELECT * FROM (
  SELECT
    X.id,
    Y.whatever,
    Z.blah,
    ...,
    ROW_NUMBER() OVER(PARTITION BY X.id ORDER BY Y.whatever) roWNum
  FROM
    X JOIN Y ON ... JOIN Z ON ...
) Q
WHERE Q.rowNum = 1

This works perfectly in T-SQL, but when I try to implement it with a Drupal 7 dynamic query, it's no good. I do the following:

$query = db_select('Table1', 'X')->condition(...);
$query->innerJoin('Table2', 'Y', ...);
$query->innerJoin('Table3', 'Z', ...);
$query->addField('X', 'id', 'myID');
$query->addField('Y', 'whatever', 'foo');
...
$query->addExpression('ROW_NUMBER() OVER(PARTITION BY X.id ORDER BY Y.whatever)', 'rowNum');

$outerQuery =
db_select($query, 'Q')
->fields('Q', array('rowNum', ...))
->condition('Q.rowNum', 1);

Drupal changes it to THIS in the actual query, which I print to the screen using dpq():

SELECT
  Q.id, ..., cross_rowNum.cross_sqlsrv AS rowNum
FROM (
  SELECT
    X.id,
    Y.whatever,
    Z.blah
  FROM
    X JOIN Y ON ... JOIN Z ON ...
    CROSS APPLY (SELECT ROW_NUMBER() OVER(PARTITION BY X.id ORDER BY Y.whatever) cross_sqlsrv) cross_rowNum
) Q
WHERE rowNum = 1

which of course is totally useless to me, because SELECT ROW_NUMBER() by itself, without the FROM clause, always just returns 1!

Is there a way I can force Drupal to do what I want, i.e. select the ROW_NUMBER() from the tables specified in my FROM clause, instead of creating its own useless SELECT out of nothing - or should I forget about using a dynamic query and just hardcode the entire thing with db_query()?!


texts: Re-authenticate a user with X-CSRF-Token

texts:
I am writing an Android application that consumes the Drupal 8 REST features. I have managed to write REST resources and make API calls with the android app to these resources with success.
My question is about the login and sessions. When the users logs in for the first time we get X-CSRF-Token, which has an expiration date. I also use this token to authenticate myself when making calls to the REST resources.
Does Drupal has a REST feature that refreshes the token without having to enter the user credentials again?
The idea is to have an app on which you log in only once until the users logs out manually.


texts: Using Webform as an Application for membership/user roles

texts:
I'd like to implement the following on a Drupal site:

Anonymous site visitor (Joe) submits a membership application with various custom fields
Admin (Jane) reviews membership application
Jane approves Joe's application and creates new user account
Joe gets notice of approval and login information

Possible solutions:

A Webform (But how can the data from the webform be easily transferred into a user account?)
Profile2 with Admin approval necessary. (The problem with this one is we don't want it to feel to the user like they are creating an account on the site, but applying for the membership.)
Create a Membership content type that an anonymous user can fill out (?)

I feel like I'm overlooking something obvious.

I can't use the core user registration with additional fields because there are 3 different types of memberships. And users should be able to change from 1 membership to another (upon approval).


texts:
In the past (Drupal 6), I used a function to put some values in a template file.

This function was something like function_name('templates/my_template.tpl.php', array('key1' => 'my value', 'key2' => 'my other value')); which returned HTML code.

Is there this function in Drupal 7?
How can I use it?


texts:
I'm using https://www.drupal.org/project/restful module. I can sort base entity using annotation:

/**
 * Class Things__1_0
 * @package Drupal\restful_thing\Plugin\resource\node\thing
 *
 * @Resource(
 *   name = "things:1.0",
 *   resource = "things",
 *   label = "things",
 *   description = "Export the things with all authentication providers.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "course"
 *     },
 *     "sort" = {
 *       "field_weight": "ASC"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */

But when it comes to relationship, the related data isn't ordered the way I need.

Inside public_fields():

$public_fields['modules'] = array(
  'property' => 'field_modules',
  'resource' => array(
    'name' => 'modules',
    'fullView' => TRUE,
    'majorVersion' => 1,
    'minorVersion' => 0,
    'dataProvider' => array( //here I'm trying to override dataProvider values
      'sort' => array(
        'field_weight' => 'ASC'
      )
    )
  )
);

Is there any way to sort related data?

---edit---

I've also placed "sort" inside the annotation of the modules plugin, but It doesn't have effect too.


texts: What does "storage" mean in relation to Mini Panels?

texts:
I am working on a site that uses Mini Panels.  In the Mini Panels List I see a column called "STORAGE".  The column contains the values, overridden, default, and normal (which is the storage for a Mini Panel I just created).

What does "storage" mean in relation to Mini Panels and what do each of the storage values (overridden,  default, and normal) mean?

One of the reasons I am asking this is because I have a Feature that is stuck in the Overridden state and the default and overriden diff shows:

DEFAULT                                     OVERRIDES
PANELS_MINI
Line 335                                    Line 335
  'renderer' => 'standard',                 'renderer' => 'standard',
- 'storage_id' => 'article_header',
- 'storage_type' => 'panels_mini',

So, my next question is: What is a storage type of "panels_mini" and how is it related to the three other types of storage mentioned above?

Thanks


texts: How to ask for user confirmation when submitting a form using FAPI

texts:
What I want is suppose a user enters same data twice in two rows then I want to show her an error/warning and now if she chooses to press submit again then I'd process and accept the form.

How to do it?


texts: Is $page only an array important for theming purposes?

texts:
I know Wordpress theming, but I am a beginner with Drupal theming. Drupal render array totally confuses me.

Do all modules put their content in the $page array?
Is $page only an array that is important for theming purpose? If the answer is no, then what kind of renderable arrays are available in Drupal for advanced theming?


texts: Do All Drupal themes support subtheming?

texts:
I heard that only some themes can have a subtheme.
Is this true?


texts: Pages don't update, clearing cache doesn't help

texts: I have a site on Drupal 6. A week ago I've update some content and the changes are visible when I'm logged in, but when opening the site as an anonymous user, I still get the old content. I've tried it on multiple computers and multiple browsers and I've flushed all caches. It seems that the site's content is cached somewhere... What can I do about it?


texts: Filtering Drupal 6 View based on multiple content types

texts:
This is a repost of the following: https://stackoverflow.com/questions/16489525/filtering-drupal-6-view-based-on-multiple-content-types

I have a drupal 6 installation, and am trying to limit a view with Filters.  I've tried everything I can think of, and can't seem to get it to work.  Here is the situation.

I have a project, and that project has several pages, and those pages have several sub-pages

PROJECT
---------->Page
------------------>subpage

I want to filter out the results based on the following criteria:

Recently Modified of subpage is "YES" (working)
Project of a page is not a specific project NID (working)
Checkbox inside content type project is not checked (not working, values are "no"
for "Don't ignore" and "yes" for "Ignore"

So, using Filters, I'd like to see if the project is checked, and if it is, ignore all pages and subpages of that project.  I hope this makes sense.

Please see the link for images.  Until I have 10 rep, I can't post them here.

(Page) Content: Project has been removed.  It is just Content: Project


texts: Multi-page wizard webform that posts to external URL?

texts:
I've got a multi-page wizard webform whose results I need to post to a specific URL. I see in the webform settings that you can set a Custom POST url. However, this appears to break the muti-page behavior. After setting this option the button that normally takes me from the first page of my webform to the second page instead posts to the given URL.

The option also appears to break the post-submission page that I've set in the webform settings. Any suggestions on how to remedy these issues?


texts: Append an  tag to entity field view hook

texts:
On a field of field type = LINK and widget = LINK, I want to add an  tag on the rendered output.

The reason is to be able to add a class, not to the whole  tag output, but to append a FontAwesome icon.

Hook_page_alter, of course shows all of the rendered HTML. I really don't want to mess with that.

I tried hook_entity_view_alter. That works in a clumsy fashion but two problems:

1) It only affects the output from the node displayed via a view
2) It appends the  tag in new  after the displayed link.

It appends the  tag in new  after the displayed link.


texts: How to display a author picture in comment form?

texts:
As the title, I try to display a user picture IN comment form. But I'm not familiar with Form function. Below is my code and I don't know how to do next?

function btmentry_form_comment_form_alter(&$form, &$form_state) {
global $user;
$user_picture = user_load($user->picture);

//What should I do next?

}

My purpose is style my comment form as Facebook.
Thanks.


texts: Intermittent Access Denied errors for anonymous users

texts:
I'm running into seemingly random Access Denied errors that occasionally come up on most (but not always all) node pages for anonymous and low-level users (anyone without the "Bypass content access control" permission).

I've rebuilt permissions a few times, which fixes it for awhile too, but the behavior returns.
I've scoured user permissions and don't think there's anything incorrect in there.
We are not using any contrib node access modules.

Clearing the site caches fixes this, but it comes back after awhile, so I suspect this is cache-related. We use Redis.

This is a pretty new Drupal 8 site that used the Lightning install profile. We use Panels/Panelizer for layouts. We have a bit of custom code in place (a few form alters, a few blocks, a few redirects, nothing particularly complex - but it's certainly possible there's something off in there).

Anyone seen this before or have troubleshooting suggestions?


texts:
I have multipage webform. I want to compute the value of the component (Hidden -type) which is on the second page based on the data submitted on the first page.

I'm using hook_form_alter and added my client_submit handler:

function mymodule_client_submit(&$form, &$form_state)

I can read there submitted data from the first page and I can do the calculation. But I cannot set the value of the component from the second page. I can see the structure of the form in $form or $form_state parameter. But I do not know how to set the value of the component from the second page as it was not submitted yet.


texts: Change date formate in drupal admin tables (log, content listing, edit pages, etc)

texts:
I've looked everywhere but can't find out how to change the date format in the admin/content/ table and the recent log table.

Current it is displayed as '09/05/2014 - 00:18'' but I just wanted to make it YYYY-mm-dd - hh:mm'

What's the best way to make this happen?


texts: Git Workflow Acquia Cloud and Acquia Dev desktop

texts:
I use Acquia Cloud and installed Drupal 8 and cloned this (origin) locally using Acquia Dev desktop.

To use Dev Desktop I think I'm able to develop the Front-end design
faster, instead of committing the changes every time and push them
to Acquia Cloud to see them in the browser. Am I right?
And will my client also be able to commit his code from his local branch
to the Acquia Cloud repo?


texts: Is $site_name , $logo ,$site_slogan are part of render array $page?

texts: is $site_name , $logo  ,$site_slogan variables values are store in render array $page? or they are independent from $page? if they are independent.then list of variables that have same nature?


texts: "Fields pending deletion" stopping module unistall - how to delete manually?

texts:
I'm getting a "Fields pending deletion" error when trying to uninstall the Dynamic Entity Reference module. I also cannot disable the module as the tick is greyed out (unless I'm missing how to disable modules in Drupal 8).

I've run cron and cleared the caches many, many times and have checked /admin/reports/fields but there is no mention there of any fields using this module.

I have found suggestions for Drupal 7 saying to delete the fields from the field_config database table but this table does not exist in Drupal 8. Is there any way to get rid of these zombie fields? They must be stored somewhere!

Please don't tell me to use Drush, I wish I could, believe you me, but I don't have shell access, just sftp and phpmyadmin.


texts: How do I define a Drupal variable using phpmyadmin?

texts:
According to this issue, I need to drupal_weight_select_max to 1000 in my Drupal installation. It suggests several methods:

Use Drush (Not an option for me as it's on shared hosting)
Define it in a module (Beyond my skillset)
Define it in settings.php (which seems to break my site. i.e. site doesn't load and I get WSOD)

If this can be done in phpmyadmin, can you please tell me in plain english, step-by-step how I can do this?


texts: How to show thumbnail preview in node display for uploaded video in file field

texts:
I am using a file field and media module in a custom content type to upload video files. The videos play fine.  The preview image for each video is a gray box.
How can I display a preview image or thumbnail for each video in place of the gray box in the node display?

Update: the preview image does not have to be auto-generated from the video; I would be OK with adding an field for an image to upload along with the video.


texts: Don't remove the record from Apache Solr

texts:
I have a custom module, which delete the records in DB based on Cron using node_delete_multiple.

For search reason, I don't want to remove the record from Apache Solr when node_delete_multiple function triggers.

We could exclude certain individual nodes using hook_apachesolr_exclude being Index. Am looking to exclude nodes not to remove from index, apachesolr_don't_delete_node_from_index().


texts: Attach an image gallery carousel to nodes

texts:
I want to attach an image gallery to a node, showing the images in a carousel view so that only a few thumbnails are shown and clicking on them opens a ColorBox overlay.

I have a gallery content type that contains all images in a field, and in an article the gallery is referenced using an entity reference field.

I found the Gallery Formatter module which does nearly want I want. But I don't want to display the large image on the page, only the carousel showing thumbnails. To get the full size image one should click on one of the thumbnails.

So I need a field formatter that can display the contents of an image field as a carousel. Any ideas on how I can achieve this?


texts: How to stopping spam when using Print_mail (submodule of Print)?

texts:
I am using the Printer, email and PDF versions module to be able to email and print articles. This module allows you to send an email to anyone. The issue is, that this feature opens it up for spamming.

Is there a way to stop that or can you suggest another module?


texts: View bulk operation not respecting user permissions

texts:
Created two content type Type-A and Type-B
Created user role "Editor"
Editor have access to delete only Type-A nodes but not Type-B nodes
Created Views landing page of these nodes with bulk operation.

If I login as editor and check Views landing page bulk operation, Editor can even delete Type-B nodes, which is a strange behavior.
Ideally Editor should not see "Delete" option for Type-B nodes. Only for Type-A nodes he should see the delete options in views bulk operation dropdown.


texts: Submit handler: Prevent other handlers from running in certain circumstances only

texts:
I'm creating a custom module which adds a submit handler to a form.  The idea is that it checks whether a hidden "honeytrap" field has been filled in.

If the field has been filled in, a success message is shown, but the form content is not e-mailed.  If the field has not been filled in, the form is submitted as normal.

I don't want to use a form validator here (so this answer on DSE is unfortunately no use).  I want the spam robot to think that the form has been submitted, so that it doesn't try again and learn about my special field.

At present, I have the following code:

function par_report_repair_form_webform_client_form_26_alter(&$form, &$form_state, $form_id)
{
    array_unshift($form['#submit'], 'honeytrap_submit_handler');
}

function honeytrap_submit_handler($form, $form_state)
{
    // what goes here?
}

I'm not clear what to put in my submit handler.  I'd like the following behaviour:

If the honeytrap field has been filled in, display a "success" message but don't allow any additional handlers to run
If the honeytrap field hasn't been filled in, continue as normal.

Any suggestions?  I've tried simply setting $form['#submit'] to be an empty array, but that didn't help.