texts: How can I save multiple (checkboxes) values in a configuration entity?

texts:
I have a standard config entity in Drupal 8.
I'm trying to save multiple values in the form of checkboxes.
The form itself looks like this:

As you can see it's nothing too special about it.
If I try to save it, the following exception occurs:
InvalidArgumentException: The configuration property user_role.anonymous doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 74 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

Drupal\Core\Config\StorableConfigBase->castValue('user_role.anonymous', 'anonymous') (Line: 211)
Drupal\Core\Config\StorableConfigBase->castValue('user_role', Array) (Line: 212)
Drupal\Core\Config\Config->save() (Line: 280)
Drupal\Core\Config\Entity\ConfigEntityStorage->doSave('pl_n_6467f20669ddf097337c47aab87e3c', Object) (Line: 392)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 259)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 364)
Drupal\Core\Entity\Entity->save() (Line: 637)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 130)
Drupal\pl_notifications\Form\PLNotificationsConfigurationForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder->processForm('p_l_notifications_configuration_add_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('p_l_notifications_configuration_add_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Which makes perfect sense since I haven't defined that field in the ConfigEntityType.
However, I can't define it since there may be other roles added later on or rather some other roles removed.


texts: How to organize content via taxonomy, blocks, panels, views?

texts:
I am new to Drupal. I have a guitar lessons site that I want to convert to drupal. Guitar lessons are a container that contain exercises, and lessons are categorized - I set up taxonomy). Exercises contain text, and media: audio, video, an image or two. Main image (tab) will automatically be displayed, audio will have link, and video would appear in tab, as would secondary image (fretboard diagram). So the media could be imagined as having its own mini horizontal panel or something below the image. Some audio/video will be designated as accessible to registered users only. On left there would be block that lists exercises in the current lesson. In lesson page there would be navigation (next exercise, etc, as well as a show all exercises option).

Not sure how to create this container-exercises relationship. And since I want people to be able search on exercises by themselves, apart from a lesson, I need a way for exercises to not only be attached to a lesson, but to be categorized and accessed on their own. I suspect taxonomy is the key here.

I have been reading about Panels as a way to control layout without editing themes. Also read about Views and understand the query function they play as well as perhaps display of results. So I understand these will be key. I have set up the exercise content type, adding custom fields. But now I am at a dead end. I don't know the process flow to make Drupal display the content the way I am seeing it in my head. And I don't know to what extent the tools will get the job done vs me having to code. I know PHP very well, CSS so-so, and Javascript so-so. I am trying to avoid coding if possible, except for minor tweaks. From building my site in postnuke some years back and doing an insane amount of coding, I know I don't want to repeat that!

Any tips on how you would go about this design with taxonomy, panels and views (or other tools) will be very appreciated. I would even be willing to hire someone to help me get started (apology if that is against the posting rules!).


texts: How can you add a template for a custom confirmation page URL?

texts:
I want to show custom message on confirmation page (on custom URL).
I created a custom URL in *.routing.yml file and added a method in controller class that returns an array :

return [
  '#theme' => 'mycustom_confirmation',
  '#test_var' => 'Test Value',
];

Next, in *.module file,

I added hook_theme function to return below array:

    'mycustom_confirmation' => [
          'variables' => ['mycustom_var' => NULL, 'webform' => NULL, 'source_entity' => NULL, 'webform_submission' => NULL],
        ]

I added template_preprocess_mycustom_confirmation function to add my customized variables.

Then I created a template file: mycustom-confirmation.html.twig file where I consume the customized variables to show custom message.

After all that, when I landed to confirmation URL (that I set in to admin/structure/webform/manage/webinar_training_request_1/settings/confirmation page) after webform submission , I dont see any message. I dont understand what I missed in module.


texts: Create an Availability calendar/table in Views

texts:
I am trying to create a calendar table in Views to display availability states for multiple product rows, e.g. for a car rental site.
I have spent the evening researching modules that might be suitable, namely availability calendars (which I am familiar with) and a bunch of views plugins, even considered modifying rooms or uc_hotel modules to suit.. I haven't found anything that fits the bill exactly, but that's what I expected, so I'm looking for some recommendations or a solution. I have attached an illustration of what I am trying to achieve. Any help or pointers much appreciated.


texts: Set different pricing attributes for each product

texts:
here is the thing:
 On my drupal commerce site I added a term reference field 'sizes' to line item, and make it to be an attribute on 'add to cart' form.
 Also I added a field collection in to my product, wich has two fields: Margin(price) and size(term reference). So when I add some product I can choose a size and some extra margin to price.
 What I want to do is when user add product to cart he chose some size, this size would compare with a size in field collection and the price for this item will update relatively to margin field collection field.
 Anyone have any idea how can I do this?
 Thanks


texts: user register hook form alter not reaching

texts:
I am trying to request more information from users when they register for my site.  I put a set-message in and it's not eve appearing nor any changes in the user register form.

I cant seem to find anything online to work, any help would be greatly appreciated.  Thanks!

 <?php
       function hook_form_alter(&$form, &$form_state, $form_id){

         drupal_set_messge($form_id);

         if ($form_id == "user_register_form") {
              $form['account']['name']['#title'] = t('Full name');

              $form['city'] = array(
                '#type' => 'textfield',
                '#title' => t('City'),
                '#size' => 15,
                '#required' => TRUE,
              );

              $form['state'] = array(
                '#type' => 'textfield',
                '#title' => t('State'),
                '#size' => 15,
                '#required' => TRUE,
               );

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

          }

     }

    function hook_form_alter_submit($form, &$form_state) {

       $city = $form_state['values']['city'];
       $state = $form_state['values']['state'];
    }

 ?>


texts: Drupal 7 Apache Solr Search module custom ordering of results

texts:
I've been stuck on how, if its even possible to meet a certain search criteria that's been set. This is it:

The user enters keyword "george" Search rules: Top to Bottom sorting

A. All advanced profiles with “George” in title

B. All basic profiles with “George” in title

C. All advanced profiles with “George” in body text

d. All basic profiles with “George” in body text

The basic/advance option comes from a boolean value set in the node.

So its sorting within sorting or conditional boosting. Any help would be much appreciated. Thanks


texts:
I have user login block on custom page, I try:

if ($form_id == 'user_login_block') {

    $form['#redirect'] = '/';//or <front>

}

But I am redirecting always to the same page.


texts: How to fix rules which unable to evaluate action?

texts:
I have created two rules to act on some events related to commerce products.
The first is to act on reference node delete event, to remove the product upon node delete.
the second is to delete the node upon expiration event using node_expire
When running the cron to make expired event to be happen no actions executed except if I disabled the first rule
I have tried rules components and rule sets as that two rules have conditions and actions in common But nothing changed.
Edit:
I did some debugging and found that warning and error messages

[warning]
WD rules: Unable to load commerce_product with id "102"
WD rules: Unable to evaluate action entity_fetch.
WD rules: Unable to get variable entity_fetched, it is not defined.
[error]
WD rules: Unable to evaluate action entity_delete.


texts: Custom CCK Currency exposed filter for available currencies

texts:
I am trying to set the available currencies programatically like this:

function mymodule_form_alter(&$form, $form_state, $form_id) {
    /** Modify exposed filter views */
    if ($form_id == 'views_exposed_form') {
        $form['field_1hour_currency']['#type'] = 'select';
        $form['field_1hour_currency']['#options'] = array('EUR','USD');
    }
}

But I get An illegal choice has been detected. Please contact the site administrator. error in the view.

How can I set a select list of available currencies in the views exposed filter for a CCK currency field?

Thank you

(using D6, Views 2 and latest CCK Currency)


texts:
I have added some extra fields in User entity like address, twitter account e.t.c. The requirement is that each user should be able to choose whether his profile will be completely public to other users or some fields should be hidden. The user does not get to choose which ones are hidden or not, he only chooses via a select menu (term reference) what his profile view should be: "Complete" (all fields visible), "Partial" (some predefined fields are hidden) or "Basic Info" (only name and pic).

My question is, what is the best practice to implement the three different profile views according to the user choice? My thoughts so far:

via the respective template using if statements to display or not some fields
via custom display modes, but I don't know how to delegate to another mode conditionally when view_mode is already set to "full"

Any other suggestions are welcome. Thanks in advance.


texts: Deleted files for node are being included in view for services

texts:
We are using the services module to provide a JSON feed for our internal portal to pick up our articles. The page view that provides all files for each node uses the File Usage: Content relationship. We just noticed that even files that have been deleted from the node are still being listed.

The query that views shows (when I take that same view and set as a block)

SELECT file_managed.uri AS file_managed_uri, file_managed.fid AS fid, file_managed.filemime AS file_managed_filemime, users_file_managed.mail AS users_file_managed_mail, 'file' AS field_data_field_caption_file_entity_type, 'file' AS field_data_field_file_image_alt_text_file_entity_type, 'file' AS field_data_field_file_image_title_text_file_entity_type
FROM
{file_managed} file_managed
LEFT JOIN {file_usage} file_usage ON file_managed.fid = file_usage.fid
INNER JOIN {node} node_file_usage ON file_usage.id = node_file_usage.nid AND file_usage.type = 'node'
LEFT JOIN {users} users_file_managed ON file_managed.uid = users_file_managed.uid
WHERE (( (node_file_usage.nid = '') ))

The nid is provided as a parameter.

How can I get it to not include files that were removed from the node?


texts: How to display a block on only the listed pages using wildcard and excluding subpages?

texts:
I have a block I'm displaying using block setting's "Only the listed pages". I'm using a wild card asterisk to show the block on any pages following about-us/. For example: about-us/*

The problem is I ONLY want pages immediately after about-us/ to show.
For example about-us/faq would show the block but about-us/faq/content should NOT show the block.

I tried about-us/*/ but that had no effect.

Any suggestions?


texts:
i am using drupal 6 and services 6.3x module but i am unable to use this module completely.
I have enabled rest server module also.
I added a new service and added resources to it.
I added node resource to it and i am able to fetch all the nodes in json format

what i am not able to understand is :-

The exact uri or may be the procedure to call getTree method in taxonomy_vocabulary resource
How to acccess all the methods (CRUD) functions under every resource enabled
The url -> mydomain.com/service/rest/node.json works for me but how can i access the getTree method ??

I am stuck on this like forever i have even posted jobs on the drupal site but i guess there are very rare people who have knowledge about this.

Edit :-

Live link is http://delvelogic.com/merchant/drupal-6.22/services/rest/taxonomy_vocabulary

The following is the java code i am using :-

    DefaultHttpClient httpClient = new DefaultHttpClient();
    HttpResponse response = null;
    HttpPost postMethod = new HttpPost("http://delvelogic.com/merchant/drupal-6.22/rest/taxonomy_vocabulary/getTree.json");
    postMethod.addHeader("Content-type", "application/x-www-form-urlencoded");
    postMethod.addHeader("Accept","application/json");
  //  postMethod.addHeader("Authorization", "basic " + Base64.encodeBytes(("admin"+":"+"admin123").getBytes()));
 //   httpClient.getCredentialsProvider().setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT));

     List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
     nameValuePairs.add(new BasicNameValuePair("vid", ""+1));
     nameValuePairs.add(new BasicNameValuePair("parent", ""+1));
     nameValuePairs.add(new BasicNameValuePair("maxdepth",""+1));
    // nameValuePairs.add(new BasicNameValuePair())
    try{
     postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));
     response = httpClient.execute(postMethod);

     InputStream input = response.getEntity().getContent();
      BufferedReader rd = new BufferedReader(new InputStreamReader(input),input.toString().length());
     String line;
     StringBuilder sb =  new StringBuilder();
     while ((line = rd.readLine()) != null) {
            sb.append(line);
     }
     rd.close();
     uploadresponse = sb.toString();

     Log.d("Response", ""+uploadresponse);
    }catch (Exception e) {
        // TODO: handle exception
        e.printStackTrace();
    }

Also if there is any firefox add on so that i can actually see the method working ??

Edit Again :-

I have found this add on restclient to work on firefox

i choose the method as post
in the url i typed http://delvelogic.com/merchant/drupal-6.22/services/rest/taxonomy_vocabulary/getTree

added header :-

Content-type : application/x-www-form-urlencoded

Accept : application/json

request body :-

&vid=1&parent=1&maxdepth=1

it gives me 404 not found with no vocabulary with id 1 found
Thanks in advance


texts: How can I configure CKEditor to show content in 'plain text editor'?

texts:
I would like to configure my CKEditor to show content that I edit in plain text editor by default as I have some widgets on my site (e.g. Twitter) that get removed by CKEditor's rendering to rich text - how can I avoid that?

Thanks!


texts:
I've been wrestling with this since yesterday and have reinstalled drush 3 times, rebooted, restarted mysql(mariaDB) and a few other things but nothing works. I'm trying to update my core from 7.14 to 7.32 and really want to do it with drush instead of manually. The only thing I think might be causing this is that I am on Debian and my sites directory is a symlink from /usr/share/drupal/sites to /etc/drupal/7/sites or that I have drush installed for root only(composer and drush files in /root)

When I try and update the core with:

drush up drupal

I get back:

Update information last refreshed: Fri, 10/24/2014 - 15:01

Name    Installed Version  Proposed version  Message

drupal  Unknown            Unknown           Specified project not found

No code updates available.

Tried clearing my drush cache to no avail and when I check for releases with drush rl it manages to successfully lists the 7.32:

Project  Release  Date         Status

drupal   7.x-dev  2014-Oct-19  Development

drupal   7.32     2014-Oct-15  Supported, Recommended, Security

I maintain a few Drupal sites with drush and have never had this problem before but this is my only server with Debian so maybe that has something to do with it. I've read a lot of the threads about issues resembling this going back all the way to 2011 but nothing seems to fix my issue.

If anyone can help then thanks and if not I guess I'll have to manually upgrade the core.


texts:
When I create a new view with only a block and use a contextual filter to generate an archive view for articles like 2016 (4), 2015 (8) etc. I get the following error when loading the page where the block is included:
InvalidArgumentException: You cannot create a URL to a display without routes. in Drupal\views\ViewExecutable->getUrl() (line 1926 of core\modules\views\src\ViewExecutable.php).

When I add a page to the view the error disappears, but all the years are linked to the same URL of the view page, like 2016 (4) -> /archive, 2015 (8) -> archive


texts: Hot to pass an argument to #ajax['path']

texts:
I have a form with a radio buttons (inside div#edit-field-nomination-und). I need to call a following AJAX callback:

function _onfit_ajax_get_term_description_callback($term) {
  return array(
    '#type' => 'ajax',
    '#commands' => array(
      ajax_command_html('#nomination-desc', $term->description)));
}

function onfit_menu() {
  // ...
  $items['ajax/onfit/taxonomy/term/%taxonomy_term/description'] = array(
    'title' => 'Get taxonomy term description by AJAX',
    'page callback' => '_onfit_ajax_get_term_description_callback',
    'page arguments' => array(4),
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
    'delivery callback' => 'ajax_deliver',
  );
  return $items;
}

Here is an attachment code (I dislike it and I want to use #ajax['path']):

Drupal.behaviors.onfitExampleBehavior = {
  attach : function(context, settings) {
    $('#edit-field-nomination-und input', context)
        .once('edit-field-nomination-und', function() {
          var url = '/ajax/onfit/taxonomy/term/' + $(this).val() + '/description'
          new Drupal.ajax('nomination-desc-wrapper', $(this), { url: url, event: 'change' });
        });
  }
};

Is it possible to attach AJAX callback to a radio buttons by the means of hook_form_alter? I don't want to use #ajax['callback'], because the entire form will be send during each AJAX call. I think #ajax['path'] must be a more lightweighted. But the problem is that I don't understand how to pass a selected radio item id to a #ajax['path'].


texts: Create a RSS feed of file attachments to a particular node

texts:
I am looking to create a RSS feed of file attachments, filtered by the node they are attached to.

for instance the feed URL would be:

node/253/rss-attachments.xml

where 253 is the node ID in question. Using views 3 + drupal 7 I am able use 'files' as a base table, and create a list of files with a contextual filter of node ID, however upon adding the RSS display it complains saying:

  Style RSS Feed requires a row style but the row plugin is invalid.

I have the feeling that a custom row style plugin is required here. Does anyone have any ideas as to what options exist now for solving this issue?

Thanks


texts: Altering widget produces error, "Class name must be a valid object or a string"

texts:
I'm using hook_field_widget_properties_alter to successfully set the widget type of some fields to 'options_select', but when trying to set others to entityreference_autocomplete, I get the error, "Class name must be a valid object or a string in mysite\includes\common.inc". Here's the code:

/*implementation of hook form alter*/
function mymodule_overrides_field_widget_properties_alter(&$widget, $context){
  // set widget type to options_select for field_expertisetags and og_group_ref
     $widget['module'] = 'entityreference';
     $widget['type'] = 'entityreference_autocomplete_tags';
}

Any thoughts as to the cause?


texts: How can I use Twig Tweak to show a token in a Webform template in Drupal 8

texts:
I have a Webform form (formerly the YAMLForm module) on which I need to show the title of the form. The template I am using is based on page.html.twig (because of twig debug suggestion) page--webform--stories-submission.html.twig.

According to the tokens listed in both in the form creation area and in admin/help/token, I have several tokens available including [webform:title], [webform:url], and [webform:id] to name a few.

When I use

    {{ drupal_token('webform:title') }}

on my template, all that prints out on the page is [webform:title].

Just to make sure I'm doing it right, I put all of the following smack into the middle of my template:

    {{ drupal_token('current-date:long') }}
    {{ drupal_token('site:name') }}
    {{ drupal_token('webform:title') }}
    {{ drupal_token('webform:id') }}

I get this in return:

Wednesday, January 18, 2017 - 09:00 ECLKC [webform:title] [webform:id]

The first two prove that Twig Tweak is a wonderful thing, and the second two prove that I'm still not doing it right.

Can anyone recommend a next step for me?

If I can't get Tweak working, I guess I might need to preprocess myself a variable? Kint says that my title is right there as a page variable:

'page' => array(25)
~
  '#title' => string(29) "Submit your Head Start Story!"

In that case, I think I would need to follow this advice:  How do I add a variable for a Twig template in my preprocess function?

To sum up:

Can I get Twig Tweak to show my title for me?
If not, should I use that advice about adding a variable to my template preprocess?


texts: print title and contents on a custom tpl.php template?

texts:
im making a custom theme for drupal, and im having a hard time trying to understand how to adapt one of my themes to drupal 7.

Right now im having an issue because i need to set some classes on all the blocks of a sidebar. i decided to make a block--sidebar.tpl.php file and there i set all the structure of the blocks.

So far so good but now, the block shows up, but im unable to get the title and contents of the block correctly. How can i achieve this?, thank you.


texts: What is the acceptable method for importing addresses via feeds?

texts:
I have a list of businesses that I need to import and naturally they all have addresses. However the field address on my content type is not targetable during mapping, but all the other fields are. I did some google searching and because address field is not a core feature and part of a contrib module, I cannot do this?
Is there a way around this? I can't manually input all these businesses, it would take far too long! What is the appropriate way to tackle this?


texts:
I have just started to learn Drupal. So, I apologize to ask such a silly question here.

I wanted to create multi sites in Drupal. I have unlimited access to create Subdomains, Parked Domains, Addon Domains, Email Accounts and All SQl Databases with my hosting provider.

I wanted to create total 4 websites.

One that I have already created just to play and learn drupal with just Basic Structure and layout.

Rest of the three websites should have same layout and theme but different layout and theme then what I have already created called Basic Structure.

So, theses three purposes should have Same Theme and Same layout with Different Databses with Same User Names and Password.

One for Development purposes,
One for Staging purpose and
One for Clients Editing purpose (where client can play with our mock-up website for their content editing purpose).

I have read lots of reviews and steps to create multi sites in Drupal. Everyone explained it nicely in different ways. And I tried all the different ways to make it work. So, by trying and doing all those, I have messed up everything.

So, now I wanted to create again from beginning.
Can anyone help me with that? Can any one provide steps to how to create multi site in Drupal? I am just beginner for Drupal. So, can anyone please explain the steps in detail?

Also, What is the best practice to create multi sites? With Parked Domain or with Sub Domain?

Thanks for your help!


texts: What's the most efficient way to get D8 to notice changes to .yml files?

texts:
I'm taking my first steps with Drupal 8, starting with a custom theme. As a result I'm making incremental changes and testing them.

I've found that in order to be able to tweak CSS you have to turn off aggregation. The normal: change css, drush cc css-js, reload page workflow doesn't work unless aggregation is disabled.

But I'm also having difficulty with Drupal not picking up changes to the yaml files, e.g. add css to the THEME.libraries.yml file - no drush cc ... command has any effect. The only thing I've found to work is drush cr (or drupal cache:rebuild) which adds about 20-30s delay in my workflow.

Is there a quicker workflow for development?


texts: A menu link that points to specfic place on a page (I can't use anchors)

texts:
I have some embedded pdfs on my site using PDF Reader module, which is working great.  But my boss wants a link to a specific place in one of those pdfs.  Thus I need some way to add a link to the main menu, that will take the user to the page with the embedded pdf, and then automatically scroll down to the proper spot in the multi-page pdf.

I've looked at both the jquery.scrollTo module and the jquery.scrollTo script, but I can't see how to use these without using #anchors, which I cannot put into the middle of my embedded pdfs.

Is jquery.scrollTo the right way to go? Something else?

Thanks in advance,
Peace Corps Volunteer, In Way Over His Head


texts: Matrix view with content as columns and taxonomy terms as rows

texts:
I need to build a view in a matrix format. I have a content type mycontent and a taxonomy vocabulary myvocabulary. The content type has a term reference field in it, which refers to the vocabulary and can have multiple values.

I want to list all contents in a view as columns, and all terms in the vocabulary as a table header, i.e. columns. I want to put a check mark to the corresponding field in the table according to the terms that the content has.

An illustration of what I want to achieve:

+-----------+--------+--------+--------+--------+-----
|           | Term 1 | Term 2 | Term 3 | Term 4 | ...
+-----------+--------+--------+--------+--------+-----
| Content 1 |   x    |   x    |        |   x    |
+-----------+--------+--------+--------+--------+-----
| Content 2 |        |        |        |   x    |
+-----------+--------+--------+--------+--------+-----
| Content 3 |   x    |        |   x    |        |
+-----------+--------+--------+--------+--------+-----
| Content 4 |   x    |    x   |        |        |
+-----------+--------+--------+--------+--------+-----
|    ...    |        |        |        |        |

So, my challenge is to dynamically create a column for each taxonomy term in the vocabulary. I.e. if I add a new taxonomy term, the view should have this column automatically added to the table.

With the default table display I can list the nodes as rows, but it is not possible to make a column for each term in the vocabulary.

I have found 3 different modules which seem to related to my problem:

Views Crosstab
Pivot Tables for Views
Views Matrix

None of those modules have a stable version for Drupal 7, nor they have a good documentation, if any at all.

I am going to download and install the dev versions of each module and play around. However, before I do that I wanted to ask if anyone has done such a view and if there would be another better approach to achieve such a matrix view.

Other suggestions that doesn't include using Views are also welcome.


texts: Why can't I change anything in hook_node_view_alter?

texts:
I'm trying to change one of the side panels, no clue what is rendering it but it displays a list of OG members.

Anyways, in template_block_view and hook_page_alter, the widget has already been rendered into HTML. The only place I've been able to find where its still in pre-render form is hook_node_view_alter but no matter what I do to the $build variable, it has precisely 0 effect on anything (yes, I made sure the function is being called).

So if its not to change the view, what is hook_node_view_alter for? This is on drupal 7.


texts: Drupal::request()->request->all() returns an empty array

texts:
I have a custom controller that expects POST data. I had it working fine in 8.1.0 retrieving the data using \Drupal::request()->request->all() and \Drupal::request()->request->get($myvar).

Now, without any changes in my custom module, \Drupal::request()->request->all() is returning an empty array, and \Drupal::request()->request->get($myvar) is returning NULL.

Between the time it was working and when the issue arose, my hosting service Pantheon updated their Drupal 8 version from 8.1.0 to 8.1.1 and then 8.1.2. I suspect something may have changed then that affected this.

How can I fix this?

EDIT: Thanks for the comments, still not quite working...

Route YAML:

mymodule.foobar:
  path: '/foobar'
  options:
    _auth: [ 'basic_auth' ]
  defaults:
    _controller: '\Drupal\mymodule\Controller\FooBarController::foobar'
    _title: 'foobar'
  requirements:
    _user_is_logged_in: 'TRUE'
    _permission: 'administer site configuration'

Controller:

<?php
namespace Drupal\mymodule\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
/**
 * Class FooBarController.
 *
 * @package Drupal\mymodule\Controller
 */
class FooBarController extends ControllerBase {
  /**
   * Provides content for the /mymodule/foobar path.
   *
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The current request
   */
  public function foobar(Request $request) {
    $content = $request->getContent();
    $data = array();
    $data['a'] = $request->get('foo');
    $data['b'] = $request->request->get('foo');
    $data['c'] = \Drupal::requestStack()->getCurrentRequest()->request->get('foo');
    $data['e'] = $request->request->all();
    $data['f'] = $content;

    $request = \Drupal::requestStack()->getCurrentRequest();
    $content = $request->getContent();
    $data['g'] = $request->get('foo');
    $data['h'] = $request->request->get('foo');
    $data['j'] = $request->request->all();
    $data['k'] = $content;

    return new JsonResponse((object) $data);
  }
}

Postman Request:

Note: This was working before with this exact code, correctly using basic HTTP authentication. There have been no changes other than these variations to my controller, and core updates.

Any more ideas?


texts: Debugging help- rules are getting fired multiple times (recursively) when they should not be

texts:
I'm running Drupal 7 with Rules 2.0.  I also tried the latest dev version (March 08) and I'm running into the same problem.

I have two rules that are set to run whenever a user account is updated.  Each rule should only be executed once per account update.  The "Activate- Lex" rule behaves properly; however, the "Activate-Friends" rule executes twice.  Both rules are nearly identical in structure except for the fields that they check.

In the Rules evaluation log, I see "Reacting on event- After updating a user account" and both rules fire once.  Then, near the bottom there is an additional entry for "Reacting on event- After updating an existing user account" and under this entry the "Activate- Friends" rule fires again but for "Activate- Lex" there is this message: "Not evaluating reaction rule Activate- Lex to prevent recursion."

How can I prevent "Activate- Friends" from also being fired recursively?

I am including the rules below.

"Activate- Friends" fires twice:

{ "rules_activate_friends" : {
    "LABEL" : "Activate- Friends",
    "PLUGIN" : "reaction rule",
    "TAGS" : [ "profile_management" ],
    "REQUIRES" : [ "rules" ],
    "ON" : [ "user_update" ],
    "IF" : [
      { "NOT data_is" : { "data" : [ "account-unchanged:field-acc-friends" ], "value" : 1 } },
      { "data_is" : { "data" : [ "account:field-acc-friends" ], "value" : 1 } }
    ],
    "DO" : [
      { "component_rules_activate_friends_features" : { "acc_to_add_friends" : [ "account" ] } }
    ]
  }
}

While "Activate- Lex" fires only once (correctly):

{ "rules_activate_lex" : {
    "LABEL" : "Activate- Lex",
    "PLUGIN" : "reaction rule",
    "TAGS" : [ "profile_management" ],
    "REQUIRES" : [ "rules" ],
    "ON" : [ "user_update" ],
    "IF" : [
      { "NOT data_is" : { "data" : [ "account-unchanged:field-acc-lex" ], "value" : 1 } },
      { "data_is" : { "data" : [ "account:field-acc-lex" ], "value" : 1 } }
    ],
    "DO" : [
      { "component_rules_activate_lex_features" : { "acc_to_add_lex" : [ "account" ] } }
    ]
  }
}


texts: Superfish - how to integrate main & user menu together

texts:
I am using superfish module to decorate the menu system but found one issue. i need to show my "main menu" & "user menu" blocks on header region. so that if user is logged in, they can see all the main menu along with "user menu" otherwise only they can see the "main menu" items such as [home, Games, Blog]. Please suggest some alternative if this approach is not recommended or proper.

Drupal version - 7.23
Bartik 7.23
Superfish module 7.x-1.9


texts:
Panels comes with a "Node add/edit form" template that, as the name states, lets you edit the add/edit form of a node.

How can override the add/edit form of entities created via Entity Construction Kit (ECK).

My users can create new instances of an entity, via a node through the Inline Entity Form. I would like to use panels to customise the entity add/edit screen when it is called via this form.


texts:
I'm writing a little module which should simplify creating a new view proccess for my site manager. What I want to do is to create a form, where the editor can fill some options (like title, path, some specific values for filtering etc) and then my code has to insert those options in my view template and import it to the database like a noraml view created via UI.

But as I understood, hook_views_default_value just loads the ready view item which is conteined in the module. But i want to create a new one each time with the same template. How can i do this?

Will be very appreciated for any advice.


texts: Change the "Create [content type]" title

texts:
I allow registered users to create content of type X, so they can go to the /node/add/X page and fill in the form. However, I want to give this page a bespoke title, i.e. "Make an X" rather than "Create X". I have tried adding a string override in settings.php, and also tried with the string overrides module. However, neither of these worked.

What is the best way to do this? (I don't want to install another module if I can avoid it, I already have too many and this seems like a trivial issue).


texts: Access 'content' or 'node' variables inside View context

texts:
I have a view where there was a file type field. So I added it to the view and rewrote the result for it:

{{ title }}
The above line results in an a tag with the href for the PDF document and the node title as text for the tag.
Now I have replaced the field  field_download with the field  field_mdownload which is a reference to an entity of type Media document. I can't get the same result with this type of field.
I tried using Twig Tweak and Bamboo Twig for this purpose, and tried direct access to node and content too, but it doesn't seem to work in the context of the view.
I tried to use things like:
node.fileld_mdocument.entity.media_file_document.uri.value
node.field_mdocument | file_uri
field_mdocument | file_uri
file_url (field_mdocument)
<% set node = bamboo_load_entity ('node', nid)%> but here twig doesn't seem to be able to convert the nid to the entire value that represents the node. If I put <% set node = bamboo_load_entity ('node', 1)%> it works.
Does anyone have any idea how I can solve this?


texts: Open Public Distribution on IIS 8.0 and SQL Server 2012 R2

texts:
I am having some issues on installing Open Public distribution (openpublic 7.x-1.2) on IIS 8.0 and SQL Server 2012 R2 without Web PI.
Have any one tried it before in such way ? Is it possible ?
I can install "standard" distribution on IIS 8.0 and SQL Server 2012 R2 without Web PI, without any major issue.

This is the issue I am experiencing during installation of Open Public distribution:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows.
Path: http://endri.net/install.php?profile=openpublic&locale=en&id=1&op=do
StatusText: OK
ResponseText: Home | Drupal @import url("http://endri.net/modules/system/system.theme.css?0"); .... Home Installation tasksChoose profile(done)Choose language(done)Verify requirements(done)Set up database(done)Install profile(active)Configure siteVerify Apps supportInstall AppsFinished Status message You can now configure the CAPTCHA module for your site. SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Procedure or function dbo.CONCAT has too many arguments specified.

and

Warning: file_put_contents(temporary:///.htaccess): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_create_htaccess() (line 494 of C:\inetpub\wwwroot\includes\file.inc).


texts: I've enabled the Media editor and would like an Add Media icon to be available in my text editor (CKeditor). How would I enable this feature?


texts: How to declare @font-your-face local fonts in CSS?

texts:
Pretty simple question, why does my CSS not render my fonts when I declare it programmatically (in my CSS) vs when I use the @font-your-face  UI?

For a number of reasons I'd like to be able to control this from my styles. I'm declaring the CSS font-family declaration correctly and the text is being changed but it's going to some sort of Sans-Serif or Helvetica default.

If it matters I'm using, or trying to use omega 4.
thanks in advance.

Here's my css for the relevant selector, I know it's trying to work because the text changes but not to this font.

.l-page{width:960px;
    margin:0 auto;
    border:2px solid black;
    border-radius:15px;
    padding:2px;
    font-family: 'Cassannet - simple';
    font-weight: normal;
    font-style: normal;}


texts: How to change the display of a paragraph bundle using a custom modules hook_preprocess_entity?

texts:
I have created a paragraph bundle with text fields that ask for social media accounts(facebook account name, youtube account name, twitter account name) Then a custom module will grab that account name and then return the latest feeds for that account.

I created a new template file for the paragraph bundle called paragraphs-item--custom_feed.tpl.php

From this template file I call the functions I created in my custom module but I realize that this works only if i'm signed in as an admin. If I view the page without being an admin then nothing appears where that bundle should be.

<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
  <div class="content"<?php print $content_attributes; ?>>
    <?php print my_module($content['field_youtube'][0]['#markup']); ?>

EDIT:
while changing permissions allowed me to view the paragraph as anonymous and authenticated I was wondering if using hook_preprocess_entity would be a better way to do this so i can can pass the proper variables to the paragraph template file.


texts:
I am attempting to configure Solr search with a drupal web page on a dev server.
I have installed the server and the Search_API_Solr modules along with it's dependencies.  When I try to connect the Search_API_Solr module to my server, I get the error:

  The Solr server could not be reached.  Further data is therefore unavailable.

  SOLR SERVER URI: http:// host_machine:8983/solr/#

  CONNECTION: The Solr server could not be reached.  Further data is therefore unavailable.

To attempt to remedy this, I've tried linking directly to the core that I have setup (e.g. http://host_machine:8983/solr/mycorename) to no success.

Does anyone have any experience fixing this?  I've searched through every bug/support post I came across and attempted all of the solutions with no fix.

P.S. I've read somewhere that you can't access a Solr server if the Drupal site is running on the same host. I don't know the validity of that.

Any suggestions would be much appreciated, thanks.


texts: Attachment node field vs. file fields in a content view

texts:
Sorry, can't think of a better title...

I've created a content view for a specific content type where each node has lots of attached files in one 'attachment'' field.

I want a table of files with columns for file description and file size, grouped by node title.

This is (almost) fine if I use the Nodes 'attachment' field, giving me a list of files (one per row) with the file name or (even better) the file's description.

However, if I want the file size, I create a relationship to File Usage, but this creates a combinatorial explosion in the number of results, returning one file size per file linked to the node per file row...

If I remove the attachment field, just getting the file name and size, its fine. But I want the file description and the size.

The thing is the description seems to be a node property but the size is a file property and the relationship is at the node level, not the file level.


texts: How to find the list of 'paths' on my site?

texts: I recently became the administrator of a Drupal site. I am attempting to configure various blocks on the page, and have so far only succeeded in removing them altogether. The configuration menu tells me to enter the 'path' for where I want the block to appear. How do I find the list of path names available for entry? The site has a blog, but entering "blog" or even "blog/*" did not make the block appear on the block.


texts: When is it appropriate to create an entity instead of a new content type?

texts:
What is the benefit to creating new entity types over just building a new content type?

It seems a bit overkill to do all of the custom coding that is required to create a new entity when you have all of the CRUD and Views functionality already built into content types.


texts: Drush ard is working for D6, not for D7 > bootstrap error

texts:
Noticed something strange today:

drush ard @sites is working in the folder /drupal6/sites/, but not in /drupal7/sites/. When i go to a specific folder, the command runs as expected (drush ard foobar.com in /drupal7/sites/foobar/)
So, Drush is working ;-), it's working in Drupal 6 but not in 7. Can someone advice me where to look? Did some googling, but i can't find a good answer.

Drush status gives

Drupal version                  :  7.26
Site URI                        :  http://foobar.com
Database driver                 :  mysql
Database username               :  [username]
Database name                   :  [databasename]
Database                        :  Connected
Drupal bootstrap                :  Successful
Drupal user                     :  Anoniem
Default theme                   :  Garland
Administration theme            :  Garland
PHP executable                  :  /usr/bin/php
PHP configuration               :  /etc/php5/cli/php.ini
PHP OS                          :  Linux
Drush version                   :  6.1.0
Drush configuration             :
Drush alias files               :
Drupal root                     :  [path to root]
Site path                       :  [path to site]
File directory path             :  [path to files]
Private file directory path     :  [path to files]
Temporary file directory path   :  tmp

The error with drush -d ard @sites is:

Command archive-dump needs a higher bootstrap level to run
- you will need to invoke drush from a more functional Drupal
environment to run this command*


texts: How to put non-breaking space into a menu link name in Drupal 8? I tried &nbsp; but it got displayed   literally.


texts: Different cusztomizable user profile types

texts: We need to add different customizable user profile fields in Drupal 6.  How can this be accomplished?


texts: Swiftmailer module installation fails although the swiftmailer external library is installed

texts:
I am trying to install the Swiftmailer module on Drupal 8, but I get the following error.

  Swift Mailer requires the external Swift Mailer library. The recommended way of solving this dependency is using the Composer Manager module.

The steps I took are the following.

I installed the Libraries and Mail System modules
I installed the Swiftmailer external library, by running composer require swiftmailer/swiftmailer:"~5.4.5" from sites/all/libraries (inside the Drupal root directory)
I uploaded and uncompressed swiftmailer-8.x-1.0-beta2.tar.gz at $DRUPAL_ROOT/modules/. The installation seemed to be successful, afterwards I got a vendor/swiftmailer/swiftmailer directory under sites/all/libraries.
I tried to install the Swiftmailer module with drush en swiftmailer and through the admin UI.

I have also tried the second step from other locations (for example $DRUPAL_ROOT/libraries), with the same result. Note that the Composer Manager module seems to be obsolete and not needed, according to latest information found in Drupal forums/sites.

How do I install the Swiftmailer module?


texts: when exactly does drupal add entries to cache_form?

texts:
I have conducted the following tests on a standard drupal install to check when entries  are added to cache form:

Comment form exposed to anon users on article content type, every time anonymous user visit an article, no entries are added to cache form table. (http://i.imgur.com/W7ftpIu.png)
An admin goes node/add/article, An entry is added to cache form.
Forms using ajax such as ajax_example module, add entries to cache form. (Related d.o issue)

Is this how cache form is supposed to work? And in case #3, does drupal generate a new entry in the table for every page request? I have seen both scenarios and unable to tell if a bug or expected behavior.


texts: How to export feed agregator list and setting as feature?

texts: I want to export feed aggregator list and settings as feature. If both aggregator list and settings cannot be exported, then how to export? Thanks a lot.


texts: Is it safe to use $vars['name_raw'] instead of $vars['name']?

texts:
I ran into an issue with usernames being trimmed in articles. I found a thread here with a fix suggesting to use $vars['name_raw']: https://www.drupal.org/node/854762#comment-7614255. It works.

But I'm wondering if $vars['name_raw'] should be sanitized with check_plain or not before being displayed to the screen. I'm not sure what the difference is between $vars['name'] and $vars['name_raw'] ? I searched and found no clear answer.


texts: How can the -value be passed as a param in a filtered url for a View?

texts:
I have created a View with two exposed filters: name and status.
The name is a text field, the status is a key|name list: 10|one,20|two,30|three

Using the View as a page, the user can filter the view by entering a text into the name field. The user can filter the status from a dropdown. The dropdown shows 'one' by default because that is the most used filtering.

Everything ok so far.

Now I would like to construct a url as well for this filtering. No problem for the name: view_name?name=richard works perfectly.

For a specific status this also works well: view_name?status=10
(only the key is accepted as a value).

For some views I would like to show all records for one name, whatever the status is. The status defaults to 'one' (which must stay like that) therefore it is not enough to only pass a name. I have to pass something for the status as well.
I tried things like:
view_name?status=
view_name?status=10&status=20 (only last value is used)
view_name?status=0
view_name?status=-1
view_name?status=*
view_name?status=Any

How can I pass the Any-value through the url ?


texts:
I want to use this font family: PTSansRegular for my website.

Do I have to instal the module: @font-your-face ?

or is there another easier way to insal it for my site?

(I found it here http://www.afontz.com/font/paratype/pt-sans/regular/)
(i'm using boilerplate subtheme)

thanks alot!


texts:
I'm trying to programmatically include a view in a module and need to limit the number of results displayed. I tried something like this, but it doesn't work:

$view->display[$display_id]->handler->options['items_per_page'] = 2;

I also tried, but neither this worked:

$view->display[$display_id]->display_options['items_per_page'] = 2;

Any ideas? Or at least some links to Views 2 programmatically implementation?

Thanks


texts: Why can't I remove the %20 from a URL evaluated by a contextual filter?

texts: I created a view with contextual filters with taxonomy terms that have two words, so that space creates a %20 on the URL. I found out that the solution is to checked the "Transform spaces to dashes in URL" box, but that still doesn't get rid of the URL. Does anybody here know why? I'm attaching screen shots of the configuration of the view and of the URL pattern that I set with the pathauto module. Thanks!


texts: Customizing webform results submission page

texts: I'm new to drupal. I'm using the Drupal 7 version. I have created one webform with Name, gender, program, branch, district, college..etc fields. And now I want to customize the webform result submissions page. I want to display the submission list based on the district selected. Can anyone help me with this? I will be very thankful.


texts:
I want to create a mobile application using my drupal application. For the communication I use the module services. The connection system works with success. This return this result.

    {
  "sessid": "98gnwpE1GeguxN1y4t0WkWhDzK-C-Ashbn5GExj9l7M",
  "session_name": "SESS7609adb25a00cf561a9d882a31e81d29",
  "token": "aK4L6D1APRH16lGSAirIaZVGR02T5gs8DeE5jffYCKI",
  "user": {
    "uid": "30",
    "name": "admin",
    "mail": "zinalacina@gmail.com",
    "theme": "",
    "signature": "",
    "signature_format": "filtered_html",
    "created": "1486745824",
    "access": "1487091377",
    "login": 1487154223,
    "status": "1",
    "timezone": "Africa/Ouagadougou",
    "language": "en",
    "picture": null,
    "init": "zinalacina@gmail.com",
    "data": {
      "ckeditor_default": "t",
      "ckeditor_show_toggle": "t",
      "ckeditor_width": "100%",
      "ckeditor_lang": "en",
      "ckeditor_auto_lang": "t",
      "contact": 1
    },
    "uuid": "14899bf3-1a0d-42b5-934e-650471d7da54",
    "roles": {
      "2": "authenticated user",
      "3": "administrator"
    },
    "rdf_mapping": {
      "rdftype": [
        "sioc:UserAccount"
      ],
      "name": {
        "predicates": [
          "foaf:name"
        ]
      },
      "homepage": {
        "predicates": [
          "foaf:page"
        ],
        "type": "rel"
      }
    }
  }
}

Now I want to create a node type article and I use this method

POST: http://localhost/drupal-7/?q=my_endpoint/node.json
{"type":"article","title":"BEVVtDcZmL","language":"und"}

But the result [
  "Access denied for user anonymous"
]. I know it normal because he don't know who wants to create the node.
Now I question is how to parse sessionId or token to have the permission to create my node? Thanks


texts:
I developed a site using Drupal 7 and the Ubercart module, where I sell user roles. I have sub-roles like the following.

Producer

Co-producer
Ex-producer

How can I manage this? Is there any sub-role concept existing or manageable with category name in Ubercart?


texts:
For drupal's file_managed widget I created my own "theme_file_widget" function.

I need to do the same for webform's file widget but I don't know what theme hook to use. Any ideas?


texts:
$query = db_select('node', 'n');
$query->condition('n.type', 'article', '=')
  ->fields('n', array('nid', 'title', 'uid'))
  ->extend('PagerDefault')
  ->limit(2);
$result = $query->execute();

while($record = $result->fetchObject()) {
  echo $record ->title."<br/>";
}

$output .= theme('pager', array('tags' => array()));

I put the above code in a page template file. Why isn't there a pager and it doesn't show two records per page?


texts:
Drupal 8.

Title sums up pretty much my question.

I'm wondering what is the best way to rebuild all my site's cache daily.

A cron job with Truncate table cache ?
Module who rebuild cache on each site ?

Does a plugin exist?


texts: Is there a reason why I shouldn't be able to upload more than 95 items on to an image field?

texts:
I have an unlimited items on a simple filefield using an image widget.
When a user upload more than 95 images, after saving the node, it turns it to unpublished and it removes the authoring information.

Afterwards, when you go back to edit the node it doesn't save any changes. Basically you have to go to the database and delete the extra rows until there are only 95 to be able to edit the node again.

This is critical because most of the nodes are supposed to have around 130 images.

Any suggestions?

I've already increased the php memory to 128M thinking it might be a memory problem because it looks like the save function is not executed properly.

Also, worth noting that if I change the order of the field on "manage fields" and get the image field on to the last slot, it save everything but the image field.

Thanks in advance! Any help will be greatly appreciated!

Installation:
Drupal 6
CCK - 6.x-3.0-alpha3
FileField - 6.x-3.10
ImageField - 6.x-3.10


texts: What is the D7 equivalent of CCK "content_instance_tablename" in db_query?

texts:
I am porting a D6 module to D7 which deals with controlling field access of CCK fields. I can now successfully enable my port without any errors but receive a fatal error when trying to create new content.

The issue is the the "content_table_instance" in db_query which as far as I understand no longer exists in D7 due to the CCK --> Fields move. I am having a lot of trouble finding exactly what the alternative of "content_table_instance" is in D7. Any suggestions?

Here is the section of the code:

$result = db_query("SELECT nfi.field_name, nfi.label
  FROM {" . content_instance_tablename() . "} nfi
    INNER JOIN {" . content_field_tablename() . "} nf ON nfi.field_name = nf.field_name
  WHERE nfi.type_name = '%s' AND nf.active = 1 AND nf.locked = 0", $type_name);


texts:
I have Drupal8 site where client suddenly wanted to change some field from 2 decimal scale to 3. To X.XXX that is.

Now I'm aware that changing field definition when there's stuff in db is not possible. However I have been previously able to change decimal scale from field storage configuration yml file by just changing the scale value to whatever I wanted. And then import updated configuration. I just did this couple weeks ago and it worked.

Now today I tried similar approach, to no avail. I can see the values change in the field storage configuration form, but the fields themselves still doesn't take 3 scale, just throws invalid format error.

I have local version where data contents are not important so I just deleted those fields and recreated them with the same name. Ofcourse this worked as expected, and I got those scales updated. I exported my config, and imported them in staging environment.

After importing config to stage, the result was exactly the same than changing those values to config manually. I can see the scale is 3 in the field storage config, but forms won't accept 3 decimals. Or they just round them up to 2.

So I guess my question is: What's going on here, how can I get my field configuration updated? Updating those fields manually in production env isn't really an option. It can be done, but I'd rather not.

Cheers,

Janne


texts: How to have multiple columns for a single field in view

texts:
I created a content type with image field which accepts unlimited values. Now, I have 25 images uploaded to the field. I created a page view. I selected the image field. For the view settings, I selected Grid format > Number of column: 2.

When I go to views page, I expected to see 2 columns on the page views but I did not. How can I make sure I can see only 2 columns of images in the views page when I set number of columns equal 2 in Grid setting?


texts: I have redesigned the layout of the page using the display suite module. When I go to the node, I see empty fields are not there. I like to see the empty fields on the node. I have been looking for the settings and I could not find it. How can I display empty fields?


texts:
When I run Drush in the command line on my Windows 10 computer or Windows Server 2016 servers, I get the following error:

drush : The term 'drush' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ drush
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (drush:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I've downloaded drush launcher and made sure that it was located in my PATH. Why is this error message showing and how do I get passed it?


texts:
I want to display a block only on a particular menu-link.

For example I have a main menu link name: about us and the link: /about

If I restrict the block based on pages and give link as /about , In future the client may change the menu link as /about-us.

So instead of restricting it based on pages, is there any other module which restrict block visibility based on menu's or How can I custom code it?


texts:
I have an image with url like:

http://example.com/index.php?q=sites/default/files/imagecache/node-gallery-display/123.JPG

I want to remove this image but don't know where it stored in database.

Whenever I remove 123.JPG from the path, it is re-generated on the next GET request.
I removed all nodes with that title from the node table but it had no effect. So I'm have no idea how to find and remove all trace of it from the database. Appreciate your help about it.


texts:
I'm looking to override format_size(), but I'm not sure if this is possible in a module.
If I implement myModule_format_size() or in a theme myTheme_format_size() will the hook be called?


texts: Set the allowed options of a selectlist CCK field?

texts:
I have some CCK select list fields which I do not define allowed values for.

I need to set the options available using information available to me when the form is being loaded.

I tried setting the values in the node-form.tpl file but I get:

"An illegal choice has been detected. Please contact the site administrator."

for each field I set the allowed values for in this way.

What's the proper way to do this?


texts: How might I display a field twice in a node using different field formatters?

texts:
Question:

How can I show the field_showcase_headshot field both as a picture on screen and as a download link?

Set up:

From the load tab of Devel, I have a few fields on this node.

The field here is Showcase Headshot. It is currently set to display on the screen as follows

But we'd like to include a download link to the original image in the fashion shown here.

That is, we'd like to append something like the following to the text on the page.

Showcase Download:
headshot


texts: Homepage sidebars (menus or blocks/modules)

texts: Is it always recommended to use Menus for the sidebars on the homepage for example? Or would you sometimes use blocks and manually add the links? In which circumstances would you for example create a custom module for the sidebar which is to display links?


texts: Creating rollover tooltip for a view (Netflix Style)

texts: Here is my scenario: I'm trying to create a view that displays images, and some additional information on rollover -- Something similar to how Netflix does it, and I'm trying to determine the most feasible way to do this. I've found the Beauty Tips module, but since my view is inside a panel, I'm not really sure if this module will do exactly what I'm looking for. Any tips on how this could be implemented would be really helpful. (using Drupal 7 btw)


texts: Using drupal 7 block from another website luckily on same server

texts:
I have spent several hours searching for my solution. I found some but none of them is working. My problem is I have multi-site setup of drupal. Site A has a drupal views generated block of events calendar with next/back navigation of months (mini calendar). I want to use that block in another website of same drupal installation. Both of website has common user tables, theme and modules. I have tried following options until now

Web Widgets module, web widget block does not have month header and the navigation. I believe I can not use it without IFRAME.
I have also tried setting up REST setup between both domains using clients, OAuth, Services, Remote Views Block modules. Fotunately, connection is set up properly but Remote Views Block module is raising following errors when remote module is added to context.

Notice: Undefined property: stdClass::$weight in context_reaction_block->options_form_submit() (line 104 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/sites/all/modules/context/plugins/context_reaction_block.inc).
Notice: Undefined property: stdClass::$weight in context_reaction_block->options_form_submit() (line 104 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/sites/all/modules/context/plugins/context_reaction_block.inc).

and following errors on other pages when context of remote block is active

Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in clients_connection_drupal_services_rest_7->makeRequest() (line 204 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/sites/all/modules/clients/connections/clients_drupal_rest/clients_drupal_rest.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 929 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 2 in drupal_http_request() (line 933 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 933 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 941 of /var/www/vhosts/neumarkets.com/subdomains/southhuron/includes/common.inc).

Am I missing anything here? connection test works properly though and I double checked the module names.

Embed widgets and Remote blocks are not available for Drupal 7.
I read somwhere (I cant find the source right now) that Drupal 7.x.1.1 supports Remote Blocks in the sense that site has other database configured in settings.php. Do we have its documentation anywhere?

Any help would be much appreciated... I am stuck here..


texts: Load existing form and use hook_form_alter to create a custom submit handler?

texts:
I have an existing webform in admin and I want to now render that form on other pages. I have a template page node--download_resource_protected.tpl that prints a hidden CSS pop-up box onto pages that show a teaser for content type Download Resource - Protected. When you click on the teaser, this pop-up shows. It currently includes a static form, asking for data-input before access to the download is allowed. See the screenshot here:

Now in place of this static form I want to render an existing webform with the API. The two teasers on the are defined as entity reference fields: Call to Action 1 and Call to Action 2.

After successful completion of the webform I want to post the data to the node URL of the teaser. For example if the page is displaying a teaser of node 34: the user clicks the teaser and the pop-up appears (this already happends), within the popup a webform is rendered (in place of the current static form) and on completion of the form it posts the data and loads URL node/34 (this needs to be dynamic i.e automatically directing to the correct node URL depending on node_id of the teaser).

I want to use hook_form_alter() to set a custom submit handler like this.

 if ($form_id == 'webform_client_form_112') {
    $form['#submit'][] = 'my_custom_submit_handler';
  }

But I need to pass the teaser node id in which the block webform was called, to this custom function (this will then allow me to to redirect to the node URL), any ideas?

Thanks for your time!


texts: Drupal 6 webform: send email if a checkbox is checked?

texts: I have a webform in Drupal 6 with a checkbox component: 'Send email'. If this box is checked I would like a rule to trigger an email send. Is this possible with a Drupal 6 webform? Thanks


texts: Is there a way to have a views filter value be determined by PHP?

texts:
I need to search for fields that are equal to the value of a visitor cookie. How do I get $_COOKIE[somecookie] as the criterion value in the views filter? (I know that I could use views_php to grab all the records and filter out after the fact but that's a lot of records and would be far too slow.)

It would be preferable to be able to do this without writing a custom module. It seems like this would be a common request by admins so I feel I'm missing something obvious.


texts: Use single create content flow to create many nodes

texts:
I am building a site for a charity. Amongst other things, the site lists a number of upcoming events. I have created a custom content type for these events (with fields like title, body, date, location). I want users to be able to upload photographs taken at these events, and am not sure what is the best way to do it.

I was going to create a new content type called something like Event Photographs, and by using a module like Entity Reference I could require the users to select an event.

But our users will probably have many photographs to upload for each event.

Is it possible for my users to follow a single add node / create content flow but upload many photographs at once to create many nodes?

An alternative is to have a single node, with multiple fields, but then I lose the benefits of each photo being its own node (e.g. commenting).


texts: Drupal 8: Class not found from module Controller, but works fine from module EventSubscriber

texts:
I created a custom D8 module in:

<root>/modules/custom/mymodule

In that custom module are
src/Controller/MyController.php and src/EventSubscriber/MySubscriber.php.

I wrote some custom code in my custom theme in <root>/themes/mytheme/src/MyClass.php.

My namespaces are: Drupal\mymodule and Drupal\mytheme.

I can add/use MyClass in MySubscriber.php (use Drupal\mytheme\MyClass) and it works fine.

However, when trying to add MyClass to MyController.php, it creates a PHP error claiming that it cannot find MyClass. The MyClass code is identical between the two module files.

Why won't it work in MyController.php while working fine in MySubscriber.php?

I've tried a lot of testing, resetting the cache, etc., but cannot find a reason for this. I can use Drupal core classes in myController.php, but nothing from the themes directory (I tried to include custom code from another custom theme).

Any hints? Any best-practice work-arounds?


texts: Term not being migrated into taxonomy reference field

texts:
I've got two migrations set up, pulling from two separate JSON feeds.

The first is a feed of taxonomy terms with a tid, vid, and name. I'm able to run migration on this fine and generate the relevant terms on my Drupal 8 test build.

The second JSON feed is one of node articles, that includes a taxonomy reference field, with a name value that matches up with the terms migrated in the previous migration described.

When I run the second migration for nodes, the taxonomy reference field is blank.

I've tried both entity_generate and migrate_lookup plugins to no success

field_taxonomy_term:
  plugin: migrate_lookup
  migration: migrate_taxonomy_terms_en
  source: tid

The JSON file for the taxonomy terms looks like the following:

[{
"name":"Term one",
"tid":"1",
"vid":"Vocabulary"
},
{
"name":"Term two",
"tid":"2",
"vid":"Vocabulary","}]

The JSON feed for the node migration looks like:

   {"title":"Page title","field_taxonomy_term":"Term one"}

Does anyone have ideas on what I'm missing?

Thanks!


texts: D7: Empty image upload field when adding a translation

texts:
By default when you add a translation your fields get pre-filled with the content of the original language. Is there a way to stop this behaviour for specific fields, in this case an image field. Both the node and field are set to translatable. The image field still needs to be translatable, but the original content should not get copied into the translation.

Reasoning for this is because on our project we have a master language which will provide default content if no localised content is found. So if we upload an image in the master language en and no image is uploaded for nl we use the image of the en language.

But by default the image is copied into the translation, so if the image needs to be updated for the master language, you then need to re-visit every translation and change the image here as well.

Practical example. I created a node in the language English and uploaded an image for field field_series_image. Now when I add a translation for Dutch when I hit the node/{nid}/edit/add/en/nl page I would like to have an empty image field and not pre-filled with the values from the source language en.

I have tried setting and unsetting a lot of values but none of them seemed to work. I tried to do this in the form_alter hook like this:

my_module_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id === 'my_custom_node_form_id') {
    if (strpos($form['#action'], '/edit/add/') > 0) {
      // Logic went here.
    }
  }
}

Things I have tried:

Unsetting the field in the $form_state['build_info']['args'] array
Unsetting the default value in the $form array
Unsetting the field in the $form['#entity'] array.
Setting the default value to 0 ($form['field_series_image']['nl'][0]['#default_value'] = 0)

None of them seemed to work, maybe because the image field is a widget?

TLDNR;
When adding a translation (so being on node/{nid}/edit/add/en/nl) I want to empty a image field using some hook. So the field is empty on the page and not saved using the values from the original node.


texts: What's the correct way to add attributes to a Link field?

texts:
So I'm preprocessing a field: preprocess_field and trying to add attributes to a Link. I've tried:

      $variables['items'][0]['attributes']['target'] = '_blank';
      $variables['attributes']['target'] = '_blank';
      $variables['#attributes']['target'] = '_blank';
      $variables['content_attributes']['target'] = '_blank';
      $variables['content_attributes']['attributes']['target'] = '_blank';
      $variables['items'][0]['#attributes']['target'] = '_blank';
      $variables['items'][0]['options']['attributes']['target'] = '_blank';
      $variables['items'][0]['#options']['attributes']['target'] = '_blank';
      $variables['items'][0]['#options']['target'] = '_blank';
      $variables['items'][0]['#content']['#options']['attributes']['target'] = '_blank';
      $variables['items'][0]['#content']['options']['attributes']['target'] = '_blank';
      $variables['items'][0]['#options']['attributes']['target'] = '_blank';

A silly amount of attempts, none of these worked. How can I add attributes to a link?


texts:
I created my own module and it has a form that is created using the Form API.  The problem is that when a user clicks on a link on the form after hitting the submit button, and goes to the link, and then hits the BACK button on their browser, then the user gets a message of "Document expired.  The document is no longer available".

How can I make it so that the user can hit their BACK button and be taken back to the form?


texts:
Drupal 8.8
Modules: Metatags & Migration plus.

I am trying to convert a tag in an XML file to an open graph image metatag.

File:
modules/custom/my_module/dataxml.html
This is the url that has to be converted to the image metatag.

<ImageUrl>
  <![CDATA[https://via.placeholder.com/300.jpg/09f/fff]]>
</ImageUrl>

File: modules/custom/my_module/config/install/migrate_plus.migration.content.yml
These are the source field for the required metatag.

source:
  fields:
     - name: og_image_url
       label: Image
       selector: ImageUrl

Process for the required metatag

process:
  field_meta_tags:
    source: og_image_url
    plugin: prepare_meta

File: modules/custom/my_module/src/Plugin/migrate/process/PrepareMeta.php
The plugin links the metatag with the required value and serializes the mapped result

<?php

namespace Drupal\my_module\Plugin\migrate\process;

use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;

/**
 * Plugin to prepare the meta tags.
 *
 * @MigrateProcessPlugin(
 *   id = "prepare_meta",
 * )
 */
class PrepareMeta extends ProcessPluginBase {

  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    $metas = [];

    // This should likely work with an array later on, but for now, it'll do.
    if (!empty($value)) {
      $metas[$this->configuration['source']] = $value;
    }

    return $metas ? serialize($metas) : [];
  }
}

When I run xDebug $metas has the following value:
$metas = [
og_image_url => "https://via.placeholder.com/300.jpg/09f/fff"
];

The node is created and the other field are migrated perfectly. However the  metatag field og:image:url remains empty and doesn't trigger an error. I don't really know what I'm doing wrong here. If someone could point me in the right direction, that would be much appreciated.


texts: How to pass an entity fiels to custom field formatter

texts:
everyone.

From the one side I have an entity class, which stores the values in the $field array and from the other side, I have a custom field for this entity, where I have to pass the value ($timestamp) from the entity.

$fields['lastUpdate']=BaseFieldDefinition::create('last_update') ->setLabel(t('Warnings'))
 ->setDescription(t('Reference to warnings-content-type'))
 ->setSetting('target_type', 'warnings_content')
 ->setDisplayOptions('view', array(
      'label' => 'above',
      'format' => 'label',
      'weight' => 15,
    ))
    ->setDisplayOptions('form', array(
      'type' => 'options_buttons',
      'weight' => 15,
    )) ->setCardinality(1000)
 ->setDisplayConfigurable('form', TRUE)
 ->setDisplayConfigurable('view', TRUE);

So I think, that I have to extend my Formatter class with the Entity class, so that I am able to use get method of the Entity class.

class Item extends FieldItemBase { ..

public static function getTimestamp() {

date_default_timezone_set("Europa/Paris");

$timestamp = time();

$time = "dfd";

$timestamp = ['#markup' => t($time),
];
return $timestamp;

How can I do that, I know, that time() function returns the current time and I don#t need it.

Thanks in advance.


texts: Print view field direct in views-view-fields.html.twig

texts:
Is it posible to print all view field direct in views-view-fields.html.twig and sciping to use views-view-field.html.twig?

In my blog view I have a lot views-view-field.html.twig for every field type and this is just one view.

So is this posible and is this recomend?


texts: Loop trough a list of referenced nodes in order to get a specific field value

texts:
I am using Computed Field to get some values;

I have a Template node that holds an Entity Reference multivalues field to a series of other nodes, all referenced nodes of the same type. The referenced nodes have a text field which value I need to get.

Until now I've managed to get the "target_id" of the referenced nodes, but I can't manage to get the values:

$tpl = field_get_items($entity_type, $entity, 'field_plan_tpl_select_trainings');
$nids = array();

foreach ($tpl as $field_item) {
            $nids[] = $field_item['target_id'];
}

What is the next step in order to get the values of a specific field for all the referenced nodes? I mention that the field has only one value.


texts: Add a class retrieved from a sibling field to responsive image

texts:
I have a Profile paragraph type that has the following fields:

Profile Image [Responsive Image Field format]
Profile Headline [Plain Text]
Profile Description [Plain Text]
Rounded Profile Image [Boolean]

What I'm trying to do is that when the field_rounded_profile_image boolean is selected, that it will add the rounded-circle class to the image attributes of the field_profile_image field.

Currently, this is what the code for the image looks like when it is printed:

  <picture>
    <source srcset="/sites/default/files/styles/profile_large/public/paragraphs/image/profile/image1.jpg?h=74e1741d&amp;itok=WLlku9ED 1x, /sites/default/files/styles/profile_large/public/paragraphs/image/profile/image1.jpg?h=74e1741d&amp;itok=WLlku9ED 2x" media="all and (min-width: 992px)" type="image/jpeg">
    <source srcset="/sites/default/files/styles/profile_small/public/paragraphs/image/profile/image1.jpg?h=74e1741d&amp;itok=p2VQAa0P 1x, /sites/default/files/styles/profile_small/public/paragraphs/image/profile/image1.jpg?h=74e1741d&amp;itok=p2VQAa0P 2x" media="all and (min-width: 768px)" type="image/jpeg">

  </picture>

I'm trying to write a preprocess hook to do this but this part of my Drupal game is lacking so I was wondering if anyone could help me out.

I've tried something along the lines of the following to no avail:

// Note that me adding the __profile_card below does work due to another hook I have running to allow me to specify which paragraph type to target
function MYTHEME_preprocess_paragraph__profile_card(&$variables) {
  if ($variables['content']['field_rounded_profile_image'][0]['#markup'] == "On") {
    $variables['content']['field_profile_image']['attributes']['class'][] = "rounded-circle";
  }
}

Any help on this would be great and I can provide any follow-up details if needed.


texts: Control content type availability based on day and time

texts:
I have a website that delivers products that are ordered during the day.  I would like the order form to only be available during business hours.  Outside of those hours, the form shouldn't be available for ordering.

I am using Webform but I can easily enough create my own content type if needed.  I've looked into using Rules, but I am not sure how to write the rules to accomplish this.

I thought there would already be a quick and easy module for this, but I have not been able to find one.  Any suggestions?


texts: How do i get parent ID of a taxonomy term?

texts:
When i try to get data using the JSON API module, the field parent is always empty even if a term hierarchy exists.

For example, for a request to http://mysite.local/jsonapi/taxonomy_term/my_vocabulary/1a2a1fc1-b6d8-40be-a482-766ccab4aed1?_format=api_json&include=vid,parent, part of the response is the following one.

"parent":{
        "data":[

        ]
     },

How can I fix it?


texts:
In Drupal 7, I have created a view to show a list of nodes I need to sort by node authored on date.

Does anybody know how to do this?


texts: How to use the right menu_tree and menu_link depending on region

texts:
How can I have specific menu_tree and menu_link for specific region?

Example:

left region will have his own menu_tree menu_link which will be different from the right region.

How can I achieve this?

Do I need to build a custom module?

If I use template_preprocess_region() , how can I call menu_tree and menu_link?

Thanks in advance

----------- UPDATE ----------------------

I've seen that preprocess_block gives back "region" and "module". Is there anyway to use the different menu_link() and menu_tree() depending on the region and module?


texts: Drupal 7 - Add Items to multiple places in a menu

texts:
I'am trying to set up a menu layout which has two links to /our-public-awareness-campaign; one under "Voter", and one under "News centre". The problem I'am running into is that although I can have two links in different parts of the menu, when looking at the page it will always try to open the menu to only one of them. This means that if you are looking under "Voter", and you go to "Our public awareness campaign", suddenly you're in a different location of the site. Any ideas on how I can fix this?

Thanks, Ruslan


texts: How do I use 2 different taxonomy view modes on one node page?

texts:
On a node page I have a term reference field. This term contains 3 fields

For the term I've created a few view modes:

view_mode_first contains: field_1
view_mode_second contains: field_2, field_3

hook theme suggestions:

  function theme_theme_suggestions_taxonomy_term_alter(array &$suggestions, array $variables) {
    $term = $variables['elements']['#taxonomy_term'];
    array_splice($suggestions, 2, 0, 'taxonomy_term__' . $term->bundle() . '__' . $variables['elements']['#view_mode']);
  }

node field template, where I'm displaying referenced terms:

  {% for item in items %}
      {% set first = item.content|merge({'#view_mode': 'view_mode_first'}) %}
      {{ first }}
  {% endfor %}

  {% for item in items %}
      {% set second = item.content|merge({'#view_mode': 'view_mode_second'}) %}
      {{ second }}
  {% endfor %}

But as a result I'm getting the same templates everywhere: taxonomy-term--name--view-mode-first.html.twig and not a taxonomy-term--name--view-mode-second.html.twig

I found that if I disable render cache in a settings.local file, both templates work:

$settings['cache']['bins']['render'] = 'cache.backend.null';

Is there possibility to disable render cache for specific node and/or fields?


texts: Give permissions to a non-admin user for custom rules components

texts:
I have a view, format: table; and a few fields:

Bulk operations: Content
Content: Title
Content: Price
Content: Stock 1 (Stock 1)
Content: Stock 2 (Stock 2)
Content: Stock 3 (Stock 3)
Global: Math expression (Total Stock)
Global: Math expression (Total Price)

At Configure field: Bulk operations: Content section SELECTED BULK OPERATIONS i selected Delete item and another 3 options (rules components). These are: new_value_for_stock_1, new_value_for_stock_2, new_value_for_stock_3, new_value_for_price.

Admin user can see all these options (rules components), but a non-admin user (eg. an editor role) can see only Delete item.

Is there a method (trick) to give permissions for a non-admin user (role)?

I enabled Actions permissions (VBO) and in Administration » People » Permissions are displayed only default actions (eg. EXECUTE Delete item). The custom rules components aren' displayed there.


texts:
I have Drupal 8.1.2; the Breakpoint and Responsive Image modules are installed.

When an image is inserted using CKEditor inline images there is no margin between the image and the text.

I have looked for the CSS for the image but can only locate                {figure.caption.caption-img.align-left} for example.

Where do I go to set margins around images?


texts: How can I add a class with table theme function to a table header row?

texts:
How can I apply a class to the
 of some table headers using the table theme function?

So, I get this:
foo	bar

...rather than:
foo	bar

...which is all I've managed with this:

$section = array(
  '#theme' => 'table',
  '#header' => array(
    array('data' => 'foo', 'class' => 'my-class',),
    array('data' => 'bar', 'class' => 'my-class',),
  ),
  '#rows' => $rows,
),

Thanks


texts:
Tried to read https://www.drupal.org/project/content_complete but that didn't give me much so now I'm stuck.

I've set what Content Type + Fields to use and Rebuilt Cache. Then I keep getting this error "You need to provide a completeness data field in the display 'Master'." when I try to create a View. Don't know what Master means here?


texts: How do you remove the "user login" block?

texts:
I know this is a simple question, but I've searched for way too long.

I just want to remove the user login box so that all accesses to the site, apart administrator access, will be anonymous. We don't want users to create accounts on the system.


texts: Database::setActiveConnection not working as expected?

texts:
kint(Database::setActiveConnection('preview'));
\Drupal::logger('Little kitties')->info('Mau');
kint(Database::setActiveConnection('default'));

As my expectation this would create a watchdog entry in preview database.
The entry got created in the default database instead.

This means, setActiveConnection() only affects direct queries (select and db_query..)? That would be really sad.


texts:
How to create custom GET resource operation? I tried many variants in  hook_services_resources() but didn't find the solution. Is there way to do this?
I want get some data from url rest/coaching/objectives-info and it should be GET request.


texts:
I have created a new custom content type: tw-how-to-guide.

This is a simple content type that only has one field: a paragraph module. And this paragraph module contains:

some nested paragraph modules
a number list

I would like the contents of the custom node template to display exactly as it does today. I am only looking to make two changes:

Wrap of the tw-how-to-guide content in a div with a css class
based on the selected number from the number list, add an additional div below the wrapper div, with the same class.

I have created a template file: node--tw-how-to-guide.html.twig
However, this is not displaying anything. I have tried using kint, with the following:

<div class="printPage" >

  {{ kint(content) }}

</div>

And I get the array in Kint, which is nice. However I do not wish to customize the display of the contents. I want the content to display as before. I am just interested in modifying the wrapping div.

I am concerned that I will need to recreate, or doing some complex work, to simply add some div tags.

I am really hoping this task can be done easily without having to parse each time in the array and call new templates. As I mentioned, it just adding a wrapper div, and then addition same divs based on selected number.

Any ideas on how to achieve this?


texts: Is there a module? Or: How to alter the Drupal pager to get this?

texts:
I want to add to alter the output of theme_pager(), and add a <li> tag, as the following:

<li class="pager_go_input last">to <input type="text" id="pager_go_input_1" class="form_text pager_form_go_input" alt="1" value="1">
  page
</li>

How is possible to do this?

Update of the question:

I want to change the Drupal pager to this style: http://www.dedecms.com/knowledge/servers/windows/list_66_1.html. Is there a module? Or: How to alter the theme_pager to get that?
the pager is located at the bottom of the pager. as this displays(首页 1 2 3 4 下一页 末页 the selected downlist 共 4页33条). Compare this to the Drupal default pager. It adds a selected downlist, when selects a page from the downlist, the site then auto redirect to the specific page. The whole count  pager (how many the pager have pages?)  and the count of all the records in the pager.


texts:
I have a unique problem, for which I am unable to find the reason and thus not an inch closer to solution since 4 days.

Drush is taking a separate settings.php file instead of the correct one.

Check only the settings files link found on the link marked [2] in both the settings.

So in dev environment, drush takes the following config:

[vagrant@frontier www]$ php ../bin/drush.php core-config
Enter a number to choose which file to edit.
 [0]  :  Cancel
         -- PHP ini files --
 [1]  :  /etc/php.ini
         -- Drupal --
 [2]  :  /var/www/sites/$DRUPAL_ROOT/cnf/settings.php
 [3]  :  /var/www/sites/$DRUPAL_ROOT/www/.htaccess

But on the deployment server, drush takes up the following config:

/var/www/frontier/www
devtools(pabetadfsp01p):php ../bin/drush.php core-config
Enter a number to choose which file to edit.
 [0]  :  Cancel
         -- PHP ini files --
 [1]  :  /etc/php.ini
         -- Drupal --
 [2]  :  /var/www/$DRUPAL_ROOT/www/sites/www/settings.php
 [3]  :  /var/www/$DRUPAL_ROOT/www/.htaccess

Now, I create a symlink at $DRUPAL_ROOT/www/sites/default/settings.php which refers to $DRUPAL_ROOT/cnf/settings.php. So drupal picks up the correct settings while drush doesn't.

I really don't have any idea as to what could cause this mis-configuration. Please let me know any remedy.

Also I don't create a www folder in the sites folder at $DRUPAL_ROOT/www/sites/ which is displayed on drush settings on deployment server.


texts:
I've a block with values in the following array structure.

        $block['tag'][] = $term;
        $block['image'][] = $url;
        $block['title'][] = $title;
        $block['description'][] = $description;

From the function build in block, I'm passing it to theme as

$build = [
      '#theme' => 'allofus_four_grids_block',
      '#test_var' => $this->t('Test Value'),
      '#doubles' => array('key' => $block),
    ];

Then inside the module, I'm passing it to twig as

'allofus_four_grids_block' => [
      'variables' => [
        'block' => array('key' => array()),
      ],
      'path' => drupal_get_path('theme', 'basis') . '/templates/custom-blocks',
    ],

And in the twig I'm iterating it as

{% for key,value in block %}
    Key : {{ key }}
    Value : {{ value }}
    {% for key,text in value %}
        Key : {{ key }}
        Value : {{ text }}

    {% endfor %}

{% endfor %}

But this is not giving me the values?


texts: Remove `/node` from front page when using a template file (page--front.tpl.php)

texts:
As it stands I have no content going to the front page, i am simply using a template file for the front. When I sign out and sign in as any role of user on my site my front page url turns into:
www.mysite.com/node

I do not want this behavior, and have tried several methods but nothing seems to work.

I have tried adding this snippet to setting.php:

function custom_url_rewrite_inbound(&$result, $path, $path_language) {
  if ($path == 'node') {
    $result = '';
  }
}

I have tried creating a custom module and have tried every suggestion from https://www.drupal.org/node/500296 nothing works.

I have encountered this behavior before, and to solve the issue i added the
Node Page Disable module and deselected the Retain /node as an active url? checkbox which removed the /node from the home page URL.

Now when I implement the module and deselect the checkbox and save the form, the checkbox goes back to being selected after the form is submitted. I cannot figure out what is going on, I have cleared every cache known to man-kind, used different machines and operating systems so obviously something is conflicting. I just don't know where to look.

I cannot post a bug/issue to the module page because drupal site is currently broken for creating new users... This is a nightmare. If anyone could give me some insight on possible conflicts or have any crazy ideas how I could get around removing this useless /node from the home page after a user signs in; it would mean the world to me. Thanks regardless.


texts: What hook is triggered when adding / updating and deleting taxonomy?

texts:
I need to update some value in database when a taxonomy
term is added or updated or removed. What is the proper hook
to use here ?


texts: Problem with equal height of columns in Display Suite

texts: I`ve got Fluid two column stacked layout in Display Suite. There is responsive picture in the first column, the second column contain some rendered fields. Below that columns is long text. My problem is with right column. I need to make the height of that column equal to height of the picture on left side. How to achieve that? Is there possibility to add some scrollbar in the right column? Anybody had the similiar situation? Some simple solution without coding or only small snippet ;) Maybe I need to add some view in the right column


texts: How do I rewrite the way my view rows are displayed

texts:
I created a view and added three fields. A title, a link, and an image.
When adding the image, I set the formatter as URL to image.

How do I rewrite my in my views so that each recipe can have the thumbnail as a background image instead?

In a way, each view row should be structured like this:

{{ title }}

{{ content }}

Is there a way I can do this in my template?
Note: The only question closed to mine that I found is here


texts: Override form field #value after ajax request sets it

texts:
First of all, here is the code:

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['join_newsletter'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Join newsletter'),
      '#default_value' => '0',
      '#weight' => '0',
      '#ajax' => [
        'callback' => '::mailCallback',
        'wrapper' => 'mail-wrapper',
      ],
    ];

    $form['container'] = [
      '#type' => 'container',
      '#attributes' => ['id' => 'mail-wrapper'],
    ];

    if (!empty($form_state->getValue('join_newsletter'))) {
      $form['container']['e_mail'] = [
        '#type' => 'textfield',
        '#title' => $this->t('E-mail'),
        '#maxlength' => 64,
        '#size' => 64,
        '#weight' => '1',
        '#prefix' => '
',
        '#suffix' => '
',
        '#value' => 'info@domain.com',
      ];
    }

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

    return $form;
  }

  /**
   * Ajax callback.
   */
  public static function mailCallback(array &$form, FormStateInterface $form_state) {
    return $form['container'];
  }

And here is the scenario.

The form by default shows only the join_newsletter checkbox. When checkbox is checked $form['container']['e_mail'] field is rendered by ajax. Notice, I'm providing a info@domain.com default value represented by #value key for $form['container']['e_mail'] field on ajax request.

Once the e-mail field is rendered I'd like to change this value manually on the page by deleting info@domain.com and typing in anything else like info@gmail.com. But when I submit a form $form_state value is always set to info@domain.com. It's never overriden.

Now, I'm aware I could use a #default_value key, but that's not the point, becasue the above code is just a simple example of what I'm facing at in my project. I tried several different solutions but none worked. Any help?


texts:
Problem:

Our production server has IIS 7.5 (windows server 2008).
Syslog is enabled in Drupal. And works perfectly fine logging to Unix server syslog file. However, on the IIS (which doesn't have Syslog) there are 0 messages landing in the EventLog where it should appear.

What I tried so far:

php.ini -> error_log = "syslog" (that I found on multiple Drupal forum for windows config)
giving to the IUSR_... user the right permissions to wrote to the
Event logs (we gave even administrator permissions)

Misc:

It's important to tell that the general error logging is WORKING. This means if a fatal error happens, and I set error_log = "my_path/error.log", it shows there. However, caught exceptions won't be shown since they are handled by Drupal. That's why I need desperately the syslog on IIS (Windows Events). I am also aware of the existence of DBLOG, but in our use case we can't go with that solution.


texts:
How do i create theme that has different regions for every node?

For example i want my frontpage to have different regions than some other page that represents content.


texts: Is there any way to add comments to pages which are NOT nodes

texts:
Im building a module and need to put a comments form on a page which is NOT a node. Is there a way of doing this?

I guess I will need to use:

  drupal_get_form('comment_form',
  array('nid' => $node->nid));

However this seems to have a certain dependency on the nid as it always seems to be attached to a node.