texts:
I need to assign different classes to all of the menu items in my primary links because each item is preceded by a different icon. How could I go about doing this?

EDIT: I found a module that seems to achieve this -- http://drupal.org/project/menu_attributes. Has anyone used it? Is it an effective solution?


texts: composer require fails because it can't delete default.services.yml

texts:
Using composer with Drupal (7, 8 & 9), composer require drupal/<package-name> returns the following error.

Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
Could not delete web/sites/default/default.services.yml

How can I fix this error?


texts: Custom Module Separate Settings for Each User

texts: I am working on a custom module. I am currently using system_settings_form to enter an API key and it works fine. However, I need users to be able to enter different api keys. What is the best way to do this?


texts: How to override the widget of an exposed form filter?

texts:
I have a view with a single filter criteria (let's call it category) exposed to the user. The user can also select multiple categories in for this view (standard view stuff).
The category selection filter is rendered to the user in a big <select> for element. For aesthetic reasons, this is undesirable.
What I'm trying to do is override the display of the widget that renders out the <select> element. I've copied my /sites/all/modules/view/themes/views-exposed-form.php.tpl to my theme's folder, however, the widget itself (which contains the <select> form control I want to change to something else) is simply rendered by $widget->widget;
How can I change how the widget renders the multiple categories selection filter in the view?
Edit, for more info and clarity: This question deals with styling a widget, which is not quite what I want to do. I want to change the markup that renders the widget.
Another edit (after answering my own question): Turns out widget is not quite the correct Drupal terminology to use here for the exposed form filter.


texts: How to flag an entity when it is created or updated?

texts:
I have a Drupal 8 site with the Flag module.
I want when a user creates or updates a node, product, store, group, ... the updated entity is flagged.
How to flag an entity when it is created or updated ?
I'm testing the "Rules" module which is finally (usable) in production.
But how do you flag down a new entity when it is created ?
What should be put in "Action", because it is no longer like in Drual 7 with an interface.


texts: Looking for a good Mini - Panels tutorial

texts:
There are lots of good to tutorials for view and panels, but I'm having trouble finding specific information on how to properly use mini panels. Does anyone know of a good tutorial or explanation of how it works? again I've seen to referenced a bunch of times as a possible solution to certain problems, but never really understood how to use it.

(D7 panels 3 would be ideal)


texts: Steps to update vendor files after pulling changed composer.lock file

texts:
Let's say I work in a group and somebody else did composer update and pushed changed composer.lock file. I pulled it and now I have to do update too, to match the files from changed lock file.

In symfony I would delete vendor dir and run composer install. But in drupal not all files are in vendor dir.

What is the best workflow in this case? Should I manually delete old vendor files (what dirs exactly?) or there is some composer command that will do all the work for me - check current vendor files with versions from composer.lock file and update what has to be updated?


texts: Display users created only by the current user in Admin/People

texts:
Below is the site's user access level hiearchy:

There is a user myid_administrator which has a role MYID ORGANIZATION ADMINISTRATOR. The administrator, aegono,  had enabled 'Administer users' to enable the user myid_administrator, create users.

In the url admin/people. myid_administrator can see users which has a higher level of user access than it. For example, It can see 'aegono', the administrator of the site.

I want it to display only the users , the myid_administrator created and below its user level. Is it possible ? How?
Do I have to create a customized form for the users with roles MYID ORGANIZATION ADMINISTRATOR, to add users and only see the users it created? Or is there any module than can help my problem?


texts: How to change date repeat display format

texts: I am using date module & date repeat API but now i want to change repeat date format.Now repeat date is display in "Repeats 5 days " but i want to show only "5 days " instead of "Repeats 5 days"


texts: Why is the field default value set during ajax request not appearing in the form

texts:
I have the following in my form function

  if ($_SERVER['REQUEST_URI'] == '/system/ajax' && $form_state['values']['x']) {
    $r = get_info($form_state['values']['x']);
  }

  $form['type'] = array(
    '#type' => 'select',
    '#title' => 'Type',
    '#prefix' => '
',
    '#suffix' => '
',
    '#options' => $type_options,
    '#ajax' => array(
      'event' => 'change',
      'callback' => 'qty_callback',
      'wrapper' => 'my-form',
    ),
  );
  $form['group_a']['qty'] = array(
    '#type' => 'textfield',
    '#title' => t('Quantity'),
    '#default_value' => $r['qty'],
  );

return $form;

My callback is:

function qty_callback($form, &$form_state) {
  return $form;
}

Just before the form function returns the form, $form[qty][#default_value] has the correct value in it. In the callback, that value is still present. But it never appears on the form.

I have tried putting the if statement above and below the form fields, and have tried using #value.

If I put the following in the callback

  $form['group_a']['qty']['#value'] = $form['group_a']['qty']['#default_value'];
  return $form;

OR the following in the form function

  if (!$form_state['input']['qty']) $form_state['input']['qty'] = $r['qty'];

the value appears, but I don't think this is the way I'm supposed to handle it:


texts: Could it be that the drupal database doesn't work anymore after using jquery .load()

texts:
After using jquery .load() in drupal 7, the database doesn't seem to work

module

   <script type='text/javascript'>
   function loadPage (id,level) {
   $.ajax({
          beforeSend: function () {
            // here you can do things before the action start
          },
          success: function () {
          $('#contenpage').load(\"$path/pages/page.php\", { 'var': [id,level]})
          }
        });
   }
   </script>

I want to use the database in the page "page" and echo the result back.

page

 $query = db_select('course_function', 'f');
  $query
      ->fields('f', array('id'))
      ->condition('f.chapter_id', $id, '=')
  ;
  $result = $query->execute();
  print_r($result);
  foreach ($result as $res) {
    $id = $res->id;
  }
echo $id;

But it does not work - do I need to use the PHP manner?


texts: Prioritize Row within View based on Taxonomy Term

texts:
I am generating rows through a view and have specific requirement for listing on my page.

What I want is if there is one specific term value of my Filter Taxonomy, the row should show itself first.

For each result of this view, I have a term value of one taxonomy (Role).

Possible term values for this Taxonomy (Role) are:-

Leader
Manager
Editor
User

Now what I want is, that which ever row's Taxonomy value is Leader, the row should be shown first and then the Manager, then the Editor and at the end, of User.

Any help how I could achieve this in Views?

Thanks.


texts:
In Drupal 7 using Views 7.x-3.3, I've specified a CSS class for the view under Advanced -> Other -> CSS class.  I have my CSS class defined in my custom theme CSS file as...

TABLE.listView {
  border: 0;
  border-spacing: 0;
  margin: 10px 0;
  width: 100%;
}

but the view is not using the class.  When I look in FireBug I see it using a class "views-table cols-5".  If I overwrite that class in FireBug with the one I created in the theme, the view table is styled the way I want it to look.  How can I get views to use the CSS class I've specified?  All I'm trying to do is get the table styled the way I want it to look.


texts:
How do Drupal publishing sites create a typical content access system (giving away some content before presenting a paywall)?

OUTCOME 1: give the anonymous user role access to X views of content type Y over a Z time period.

OUTCOME 2: give registered user role access to a bit more.

OUTCOME 3: give paid user roles even more or unlimited access.

OUTCOME 4: when the limits are reached, hide content, display a message, a modal or redirect them to purchase a role on Ubercart.

Can this be achieved with Rules?

I had hoped so but a promising module Node View Count is not currently integrated into Rules.

And sadly Limited Views only supports one role at a time and it is minimally maintained. Similar story for Limit Visit and Field Paywall and Paywall is just a placeholder.


texts: How do I dynamically change the $GLOBAL['base_path'] variable?

texts:
Example scenario:

All authenticated users should see /members/ at the beginning of each URL path, and all anonymous users should see /guests/ at the beginning of each URL path.

So if an anonymous user were to visit example.com/node they'd be redirected to example.com/guests/node, and once they logged in they'd be redirected to example.com/members/node.

I'm sure this is not impossible because using a multilingual site allows for paths to be negotiated by prefix only, but I can't seem to figure out how to go about it.

Here are some of the things I've tried (some of which have been out of desparation):

Example 1:

function mymodule_init() {
  if (user_is_logged_in()) {
    $GLOBALS['base_path'] = '/members/';
  }
  else {
    $GLOBALS['base_path'] = '/guests/';
  }
}

Example 2:

function mymodule_init() {
  $prefix_default = 'guests/';
  if (user_is_logged_in()) {
    $prefix_default = 'members/';
  }
  $get_q = isset($_GET['q']) ? $prefix_default . $_GET['q'] : $prefix_default;
  $args = explode('/', $get_q);
  $prefix = array_shift($args);
  $args_new = array();
  if (!empty($args)) {
    foreach ($args as $arg) {
      if ($arg != $prefix) {
        $args_new[] = $arg;
      }
    }
  }
  $GLOBALS['base_path'] = '/' . $prefix_default;
  $_GET['q'] = implode('/', $args_new);
}

Example 3:

function custom_url_rewrite_inbound(&$result, $path, $path_language) {
  global $user;
  if (!$user->uid || !isset($user->status) || empty($user->status)) {
    // Allow access to front page only, or guests/* paths, or even user/* paths
    if (($path != 'node') && ((!preg_match('|^guests([/]?.*)|', $path)) && (!preg_match('|^user([/]?.*)|', $path)))) {
      $result = 'user';
    }
  }
}

Any input would be most appreciated. Thanks!


texts: Unable to set placeholder on password input

texts:
function customization_form_user_register_form_alter(&$form, &$form_state, $form_id) {
 $form['account']['pass']['#attributes']['placeholder'] = t('Password');
}

I am trying to set placeholder on password field in registration form.

I seted placeholder on username and email, but on password field won't work...

Any help? Thank you!


texts: Checklist(s) for simplifying upgrades from Drupal 6 to 7 or higher in the future?

texts:
Is there any checklist to configure before upgrade for better deciding?

Is there any checklist for it after upgrade?


texts: How do I create a Rules component for merging multiple field items into one?

texts: I have a "Notes" field on the user. A text area that allows unlimited number of values. I need to merge all of them into just one and delete the others. How do I create a rules component to do this via VBO?


texts:
I couldn't believe that this question hasn't already been answered on this site, but I didn't find it when I searched, so...

Why is it such a bad idea crime against nature to hack core?

Is it really that great to be able to upgrade your core version? Most of my sites end up having horribly out of date cores anyway, so why bother?
Even if it is so bad for site owners, why does the community care so much? Why is it referred to as "killing kittens"? Isn't that rather hyperbolic?
Hacking core is so easy, don't we like taking the easier route to a problems' solution?
Aren't there problems that can only be solved by hacking core? What then?


texts: Drop down triggering image_button callback

texts:
I have a custom form with 2 dropdowns which trigger an ajax callback on change and change the html inside a wrapper. If I use a submit input with this form which has its own submit callback function, it works fine but if I change the input to image_button with same callback function, changing the values in dropdown ends up triggering image_button callback.

$form['fieldset1'] = array(
    '#type' => 'fieldset',
    '#title' => t( 'Fieldset Title' ),
    '#title_display' => 'invisible'
);
$form['fieldset1']['select1'] = array(
      '#type' => 'select',
      '#title' => t( 'Select 1' ),
      '#title_display' => 'invisible',
      '#options' => $options,
      '#default_value' => $default_value1,
      '#ajax' => array(
          'event' => 'change',
          'callback' => 'select1_callback',
          'wrapper' => 'my_wrapper_id',
          'method' => 'replace',
          'prevent' => 'click',
          'effect' => 'fade'
      )
  );
$form['fieldset1'] ['select1'] = array(
    '#type' => 'select',
    '#title' => t( 'Select 2' ),
    '#title_display' => 'invisible',
    '#options' => array_combine( range( 1, 10 ), range( 1, 10 ) ),
    '#default_value' => $default_value2,
    '#ajax' => array(
        'event' => 'change',
        'callback' => 'select2_callback',
        'wrapper' => 'my_wrapper_id',
        'method' => 'replace',
        'prevent' => 'click',
        'effect' => 'fade'
    )
);
$form['fieldset1']['to_be_changed'] = array(
    '#type' => 'item',
    '#prefix' => '
',
    '#suffix' => '
',
    '#title' => $to_be_changed_value,
);
//This works.
$form['fieldset1']['submit'] = array(
    '#type' => 'submit',
    '#value' => t( 'Submit Button Value' ),
    '#submit' => array( 'button_callback_function' )
);
//This doesn't work. The button works but dropdown callbacks call button callback
$form['fieldset1']['image_button'] = array(
    '#type' => 'image_button',
    '#name' => 'image_button_name',
    '#value' => t( 'Image Button Value' ),
    '#src' => drupal_get_path( 'module', 'my_module' ) . '/assets/img/image.png',
    '#submit' => array( 'button_callback_function' )
);

Not sure what I'm missing over here.


texts: How to send an email on every 10 contents that are waiting for admin approval?

texts:
I want to notify admin only if there are 10 nodes in a queue. If 10 such nodes do exist, a single email should be triggered to admin.

How can I do this, any idea?


texts:
I have installed a Drupal 7 views module called Islandora Solr Views and I can create views from the Islandora solr search results. My next goal is to add some semantic data to these fields but after searching around several days, I still can't find a way to do that.

At the moment the HTML for one of the fields look like this:

  Author:
  Mr LLoyd Marshall

I want to add the following RDFa data the to the field:

        Mr LLoyd Marshall

Is there a module to do that? If not how should I go about achieving this?

According to the post Allow custom attributes on Semantic Field wrapper tags, I wonder if there is a module to do this at the moment.


texts: How to add dynamic fields with condition?

texts:
I have a website that is about automobiles, I want when a user choose a brand drupal shows some of its models:

This image show an example:

for example I want when a user selected BMW drupal shows BMW's models in other select tag dynamic. and for example selected Lamborghini  drupal shows Lamborghini's models.

I mean a tree stystem


texts: How to pass data from a Rules Action to a subsequent Rules Action?

texts:
How I can add actions in the Rules module in which they have a relationship with each other sequentially.

I mean a 1st Rules Action sequentially passes data to a next Rules Action and in that next Rules Action I can use those passed data from previous data.


texts:
I am currently having problems with uploading images and using clean urls on my website. File permissions are working correctly.

When I upload an image to an article page and then I click refresh to view the page, the image doesn't appear. I check for the image url and an example url would be:

http://example.com/sites/default/files/styles/large/public/field/image/01.jpg

but the image would appear if I modify the url on the address bar to:

http://example.com/?q=sites/default/files/styles/large/public/field/image/01.jpg

I have tried:

turning on and off clean urls (sometimes the images appear, but then they disappear again)
modifying rewrite rules in the the .htaccess file
folder permissions
This happened when I uploaded the site to a server and the url would change, but before uploading the site to the servers and testing it on my computer, the url doesn't change. I am currently thinking that it has something to do with some of the rewrite rules in the .htaccess file.


texts: Enable language selector for Paragraphs Library

texts:
I am using paragraphs on a multilingual Drupal 9 page. Everything is working fine, I can translate basic pages with paragraphs to get a multilingual node.
I have now enabled the Paragraphs Library sub module, but I can't enable the language support for that.

When creating a new paragraph library item at /admin/content/paragraphs/add/default there is no language selector. Library items are always in the page's default language: English.

In the "Paragraphs library item settings - Manage form display" the default field "Language" with the widget "Language select" is present. (/admin/config/content/paragraphs_library_item/form-display)

In "Configuration - Regional and language" at /admin/config/regional/content-language there is a check box for "Paragraphs library item". If I tick this checkbox and save the page, it reloads and the tick is gone. I'm not able to enable "Paragraphs library item" in "Custom language settings" here. I do not get any error in the "Recent log messages" either.

Below on this same page (/admin/config/regional/content-language) there is the default paragraph type entry "From library". I have enabled this like I did with my other paragraphs.

What am I missing to enable language support for paragraphs library items?
Thank you for you help and suggestions in advance!


texts: Images instead of radio buttons or dropdown list?

texts: I would like the user to choose the category when he creates a new node content. However, instead of radio buttons or dropdown list I would like to have selectable images, with exactly the same logic. Is it possible to somehow ovveride radio buttons / dropdown lists with options being displayed as images? So, for example instead of a radio button with 'Cars' label I would like to have a picture of a car, then for the next category another picture, etc. Any advice appreciated.


texts: VBO custom action: get the list of selected items

texts:
I need to create an vbo action to produce a document (pdf) with a page for every item selected in the list.

Using im using hook_action_info but the callback get called once for every item selected; I need to have a function that get called with the list of selected items.

I've seen the Pass ids as arguments to a page action, that can fit my needs, but hey I'll love to avoid having such kind of urls (if possible, of course)

Is possible?


texts:
I have a couple of nodes (using node translation) shown on /en/admin/content. All the edit links point to /en/node/*/edit which always has the English language on the URL. This is problematic because for French items the entityreference fields show English nodes and not French. In order to solve this I have to manually edit the URL to /fr/node/*/edit.

The same applies when initially translating a node. The "add translation" link at /en/node/*/translate always starts with /en/.... If it'd start with the target language (e.g /fr/...) then this problem with the entityreference fields would not exist.

Is this a problem of entityreference or Drupal? Can it be fixed or configured from somewhere?


texts: I have two websites with different database in a same server. I want to implement a search function that can search the two databases/websites and show the results in one site. Is it possible to do in Drupal 7 or 8 using Search API. Thanks.


texts:
My company has a website with a blog, and we have a virtual assistant.  Our process is that after writing the blog we have our virtual assistant proof read for grammar and spelling errors.  what we would like to do is to have our virtual assistant log into our site as herself but be able to post the blog article as one of us.

Is there a module that allows for this kind of ghost posting?


texts:
I have migration where I have to migrate date field. Migration has problem with date format. After some debugging I have found that I have problem in method DateTimePlus::createFromFormat

There is validate_format parameter that indicates if validate date format or not. But I can't find out what can I do if validation fails. Validation failure is correct because dates are not same:

2016-11-30T00:00:00
2016-12-00T00:00:00

Have anybody ever had same problem? Is there anything I can do to fix this?

I have noticed that problem occurs if date field has only defined year and month. For fields with defined year, month and day it seems work correctly.


texts: How to show descriptions when a user hovers over a form element

texts:
How is the descriptions tooltip done in rubik theme by development seed? I have looked through the entire theme and couldn't identify which is handling this. Is it js or css?
https://github.com/developmentseed/rubik


texts: How to get all users with a specific permission

texts:
Is there a way to retrieve all users with a specific permission (eg "Post comments").
I only found the possibility to get them by their role:

Drupal::entityQuery('user')
->condition('status', 1)
->condition('roles', 'administrator')
->execute();

or

Drupal::service('entity_type.manager')
->getStorage('user')
->loadByProperties(['roles' => 'administrator']);


texts: How to fix Zen theme only showing correct breadcrumbs with theme developer module enabled?

texts:
I've been going around in circles with trying to get breadcrumbs working as the client wants them on a Drupal 7 site with a custom Zen theme working. I've built the site out and it requires the titles being added to the breadcrumb trail.

The issue is, the crumbs only display correctly with the theme developer module enabled. I know you can set the Zen theme's settings to append content titles to the breadcrumb trail, but this doesn't seem to work (either through specifying through the UI, or by changing the settings in the MYTHEME.info file). They do however correctly display with the theme developer module enabled. For a host of reasons I can't have a live site with this module enabled.

So,

1) How do I get the breadcrumbs working properly and why doesn't it work through the UI or in code?
2) How can I resolve this apparent conflict?


texts: 'Could not find the alias' error after installing drush alias for Pantheon

texts:
I'm attempting to get the drush alias to work with Pantheon, but when I try to run drush @pantheon.mysite.dev status I get Could not find the alias @pantheon.mysite.dev.

I've already installed the aliases by running terminus aliases, but it doesn't seem to be seeing the generated file. I did go in manually to confirm that the alias file was placed inside of the .drush directory.

When I run drush sa, I get the following:

@none
@self
default

I did recently installed drush 9 on my Drupal 8 sites, but I still have a number of Drupal 7 sites running an older version of drush. I understand that the directory structure for drush 9 is different. Do I need to install the aliases for it somewhere else?

Just so you're aware. I installed drush 9 via composer, and I'm using the drush launcher which lives in my bin directory.


texts:
This is not an issue of a broken handlers or missing fields.

I cannot update any existing or new views on my site. For example, if I try to add a field, nothing happens after I click apply. The field is not added, but the view reminds me to save my changes. This screenshot demonstrates what happens.

A few things to note:

Disabling views caching and javascript does not work.
Disabling overlay does not work.
I'm not getting any memory limit issues.
Exporting the view and re-uploading it does not work
I am running 7.x-3.11


texts:
I am working on Drupal 7.  I am wotking on user-edit -profile page

I created a user-profile-edit.tpl.php
which is working fine

now here i mention

    **`
<?php print render($user_profile['field_first_name']);  ?>
  <?php print render($user_profile); ?>
`**

which is also working

Now  Edit or Update button is not coming .

Can anybody tell me how to get submit buttons etc
Thanks


texts: Is there any 'advanced' debugging available for Views?

texts:
I know Views can show you an SQL preview, various performance statistics, and other SQL queries performed for live previews; I'm looking for something a bit closer to the bone.

The use case...

I'm writing some custom handlers for various entity/field properties (doesn't matter which types, it's all very generic stuff). I'm trying to get these handlers applied to fields in a Search API view, and the 'standard' method of implementing hook_views_data_alter() and changing the field handlers to the new ones isn't working. I think perhaps because $data['commerce_product']['title'] (for example) isn't what the Search API view actually ends up using, so replacing the handler for the entry does nothing.

So I need to know what fields are using what handlers, and preferably anything else that would help me to understand why Views has chosen one and not the other.

I know I could theoretically do this by looping through the field definitions in a pre_render hook or similar, but I'd rather have a solution in place for this any time I need it, as opposed to having to write/copy code for it every time. It feels like such a thing should exist and that I just haven't come across it yet.

Is there anything either included with, or that can be tacked on to, Views (version 3 specifically) that will help with this?


texts: How can I track download statistics for private files?

texts:
One of the most important metrics for the publications database I'm working on will be file downloads, looked at in various combinations with things like publication type, date published, etc.  With the system I'm migrating from, I parse the server logs with a python script, and then reconstructing information about publication type, etc. is time consuming or impossible.  Google analytics doesn't work because a lot of the file downloads come from direct requests to the file, not via the page itself.

My hope is that with drupal's private file system, the system should know about and be able to send to google analytics (or some other counter failing that), information about all file downloads in that private file system.  Ideally it would carry with it information on the node that the file is attached to, making it much easier to look at, for example, the number of journal article downloads for material published in FY2015.

I'm fairly new to drupal, and honestly I'm so tied up with other parts of the build that I haven't been able to do much to dig into this yet, beyond searching here and on google a number of times.  My searches so far have been fruitless, so I'm trying to find out whether I need to try to make sure enough detail is implicit in the file system to allow me to parse the log files better.

Can anyone help me figure out how counting file download statistics can be accomplished without relying on server logs?  I'm happy to explore modules, my initial thought was that the google analytics module might take care of that on its own, but I realized it still relies on someone clicking a link.

I should mention that I am using the media and file_entity module.


texts:
Is it possible for me to apply a filter in a view on a field only if that field is not empty? In other words if the field is empty the filter is not applied (and the row is shown), and if the field is not empty the filter is then applied and determines whether to show the row or not based on the field value.

My particular use case is a job expiry date. If no expiry date is entered I want the job to show, but if an expiry date is entered, then this determines if the job is displayed or not based on the current date.


texts: Embedding a custom form in node.tpl.php does not trigger validation

texts:
I'm trying to render a custom form in node.tpl.php.

The form is rendered properly and submit handler works.
However, the validation handler is not triggered properly upon submitting. If I refresh the page, the error message is only then displayed.

Here's the sample module code:

function sample_custom_form() {
  $form['sample_field'] = array(
    '#type' => 'textfield',
    '#title' => t('Enter something'),
  );
  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );

  return $form;
}

function sample_custom_form_validate(&$form, &$form_state) {
  if ($form_state['values']['sample_field'] == 'error') {
    form_set_error('sample_field', t('This is a validation error'));
  }
}

function sample_custom_form_submit(&$form, &$form_state) {
  drupal_set_message(t('You entered: @value', array('@value' => $form_state['values']['sample_field'])));
}

In hook_preprocess_node():

$form = drupal_get_form('sample_custom_form');
$variables['custom_form'] = drupal_render($form);

In node.tpl.php:

<?php print $custom_form; ?>

Any ideas what am I doing wrong?
Why isn't the validation handler invoked properly?


texts: sending test mails not working in simplenews

texts:
Regular emails works as expected, but i cannot use test ones. When i go to /admin/config/services/simplenews/settings i choose Send one test newsletter to the test address then pressing save button, but i am not getting any test emails - what's wrong?

Regular emails to real users works well, but not test emails. Or i am doing something wrong? Any help would be appreciated!


texts: Drupal Twitter widget not showing tweets

texts:
Hi i am working on drupal site And i have noticed Twitter profile widget is no more working and its showing an empty space in the tweets block. I checked developer pane i have found following notices.

TWITTER WIDGET: The Twitter API v1.0 is deprecated, and this widget has ceased functioning. widget.js:1

TWITTER WIDGET: You can replace it with a new, upgraded widget from https://twitter.com/settings/widgets/new/user?screen_name=people_10 widget.js:1

TWITTER WIDGET: For more information on alternative Twitter tools, see https://dev.twitter.com/docs/twitter-for-websites

Do you have any suggestions to overcome this issue ?


texts: populate a field when referencing a node

texts:
I am using the node reference module.

When referencing a node, I want to populate a text field in the new node, with the value of a text field from the referenced node.

Can this be done by a rule?

Can anyone confirm the rule?

Many thanks

David

added comments below


texts: Why does max_allowed_packet need to be increased?

texts: Strange problem on the production server. After restarting the container assembly (which had the unintended side-effect of re-initialising the MySQL server with default settings), some memory-intensive pages (specifically the Views-enabled All Content page) wouldn't load. I couldn't import an SQL snapshot into a dev server for testing because MySQL kept on complaining about max_allowed_packet. After increasing max_allowed_packet, the import was successful and the troublesome pages loaded fine. I increased the setting on the production server and the problem went away as well. Why did max_allowed_packet need increasing unexpectedly? Is increasing it by a factor of 10 likely to avoid further problems, or will it cause more problems further down the line?


texts:
I am trying to use the Modal Forms module to display login screen as a popup on that but form is not loading.  I just see the revolving screen.

I have everything checked at "admin/config/development/modal_forms"

Has anyone experienced the same issue?


texts: Block View limited by node, where node path is only part of the entire URL

texts:
This may be a bit hard to explain. I have nodes at something/node-title. I then want particular blocks to show up on any pages deeper (such as something/node-title/deeper or something/node-title/deeper/even-deeper), but to use the contextual filter based on the something/node-title node.

If I was ONLY doing those blocks on something/node-title, it's simple. I use the Content: nid contextual filter, and set default value as content ID from URL. But, since I only want to use a partial URL, I can't do that.

I tried to choose "Raw value from url" instead of "Content ID from url", and set the index value as 2, but that didn't work.

Any suggestions?


texts: How do I fix a "Mismatched entity and/or field definitions" error on my configuration?

texts:
I'm getting the following error on my Drupal 8 configuration page;

Entity/field definitions    Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Content

Update the node.rng_capacity field.
Update the node.rng_registrants_duplicate field.
Update the node.rng_registration_groups field.
Update the node.rng_registration_type field.
Update the node.rng_reply_to field.
Update the node.rng_status field.

I'm not sure what caused these issues or how to go about resolving them - I think they may be leftover fragments/elements from when I deleted a registration or entity type maybe?


texts:
What I want to achieve

I need to create a single view to display latest content of each content type. And I have content type: Article, Basic page.

What I do

I have create a View with a display Block called Latest content by Bundle. In this view, I add Contextual filters Content: Content type. I set When the filter value is not avaiable to Provide default value: Content ID from URL.

I try the view preview, type the value article and it display the articles content. I then go to Block layout, place the block view that I created to a region.

My problem

When I configure the Block view, there are option to select content type, but the dropdown item is empty.

I'm expecting list of content type displayed. Is this correct? Or there are something that I miss?


texts: Clean URL pagination (rewrite ?page=parameter)

texts:
One of my client works with an SEO agency and they ask me to remove the pagination parameter ?page=x (generated by the Views module) and rewrite it like this:

Before:

/my-page?page=1

After:

/my-page-1

Is there a way to do it with Drupal? I don't see any option in the view or in Pathauto to do this.

Is it possible to handle this with a custom module or should I work with .htaccess file?

I've tried the Clean Pagination module but you have to manually set pages where clean pagination should work and the module doesn't seem to work properly.


texts: What is the recommended way for using PHPUnit?

texts:
Installing Drupal 9 with the drupal/recommended-project Composer package ships without PHPUnit. Why? (In Drupal 8 it is included. The documentation only tells about Drupal 8.)
Which version of PHPUnit should I use? In this post kiamlaluno answered that Drupal 9 supports PHPUnit 8 at the moment; therefore, I think that version 8.5 is OK, isn't it?
I installed PHPUnit 8.5.8 with composer, but when I try to use it, I get this error.

Class "Symfony\Bridge\PhpUnit\SymfonyTestsListener" does not exist.

This post suggest installing symfony/phpunit-bridge, Composer choose version 5.1, but it didn't work, and I got the same error message. Is this a wrong version for Drupal 9 and PHPUnit 8.5.8?
It solved the issue commenting out the listener class in phpunit.xml. But I'm not shure if this is the right way.

Is there anywhere a documentation/tutorial for the actual official release of drupal to get PHPUnit running the recommended way?


texts: Migrate existing dev desktop site from PC to Mac without existing db dump

texts:
I have a PC with dev desktop on it where I had a local install of a drupal 7 site.
I needed to reinstall windows on the PC and it wiped out my local install except I kept the old windows files, so I have access to the original site files.

What I don't have is a database dump of the local install.

With the old files, is there a way I can find the database table data?  I can see in the old install of dev desktop the mysql/data content for the site, but I think I need additional files to complete the database tables, etc.

Thanks.


texts:
I have a table in a form such as the 'user_admin_account' form. In one of the TD's I want to add a class, how do I do this the most convenient way?

This is what I currently have, it doesn't seem to work

$row = array(
  'title' => array(
    'data' => array(
      '#title' => $name . ' ' . $surname,
      '#attributes' => array(
        'class' => array(
          'myClass',
        ),
      ),
    ),
  ),
  'date' => date('Y-m-d', $account->created),
  'name' => $name . ' ' . $surname,
);


texts: Stop caching for a specific node type Drupal 7

texts: I'm working with a node type that has several custom fields. The values of these fields need to refresh on each page load, but because of Drupal's caching feature, they don't. What is the best way (simplest way) to stop this content type from caching?


texts: How to transfer field location inside a div?

texts:
I am looking for a way to transfer the location of the field created programmatically inside a div created by field_group module.

Can anyone help me to achieve this?

Thank you.


texts: How do I install Drupal with a custom language?

texts:
I know I can install a new Drupal web site with:

drush dl drupal --drupal-project-rename=[project]
cd [project]
drush site-install standard \
    --db-url='mysql://[db_user]:[db_pass]@localhost/[db_name]' \
    --site-name=Example

But how can I install Drupal 8 with some custom language, let's say italian, using Drush?


texts: Adding a class to current taxonomy term link

texts:
Hi I wrote a SQl query to generate a list of taxonomy terms, I want to add a class to each taxonomy term when its clicked, like when I click any term  it goes to its term page, on that page I want some class should be be added to this taxonomy term.

I tried with jquery when I click any term, the class gets added but the page refreshes as it goes to this term page, the class is removed. I can do with cookie procedure, but I think there might be any other way in drupal.


texts: Upload and convert Large videos using video module

texts:
I am trying to develop Drupal 7 website which will allow users to upload large video files. As the files are too big (min 1.5GB), i am converting them to .flv format by using video (7.x-2.11) module with ffmpeg (version:N-67205-g61e42c1) configured. I am hosting this website internally on Windows server 2012.
Now, My problem is when i upload my video and convert it on node save, ffmpeg takes 100% CPU which affecting my whole website performance. I checked this link but it's not helping me to much.
My main requirement is to convert all videos to .flv format by using this video module or any other method. So, can anyone point me to proper direction to implement this kind of website?
Thank You :)


texts: Is there a way to create CSS image styles?

texts:
Is there a way to assign css to image styles?

I don't see any drop down for custom...

Would be nice to add img-responsive style to ALL images on the site...

Is there a module that can do that? Shouldn't it be native functionality?


texts:
I want to add a configuration form for a block. The form's style is the following:

    one year (label)    input text box value    eg:$10
    two years           input text box value
    three years         input text box
    500 accounts        input text box
    1500 accounts       input text box
    2500 accounts       input text box
    image:              can upload an image

How do I do it? I should write a module to get that.

How do I design the table, which is used to store the input box value and image value.
How do I design the fields?
Which hook should I use?


texts:
What would be the strongest reasons for running Drupal on PostgreSQL, in terms of available features and performance? I.e. what postgres features of that are supported by Drupal are not available on mysql? For example, postgres is known for ACID conformance and transactions; does Drupal core take advantage of these or other features in any way?

This question is not about which is a better DB in general, rather whether there are any specific reasons why one might choose postgres over mysql. One obvious trade-off is that many contrib modules will be buggy running on postgres.

I am working with D6, but feel free to direct answers to any major version.


texts: How To Calculate Sum() of a field in a view using use aggregation=Yes option

texts:
I have  a field called payment_value for different customers i need to calculate the sum of payments for each customer , i can see ""use aggregation =Yes" at the view page but i dont know how to implement this option .
thanks a lot.


texts: Dependency Injection in Custom Field Widget

texts:
I am trying to inject the entity query service into a custom field widget.  This is the relevant code:

/**
 * Plugin implementation of the 'address_options' widget.
 *
 * @FieldWidget(
 *   id = "address_options",
 *   label = @Translation("Addresses"),
 *   field_types = {
 *     "entity_reference"
 *   }
 * )
 */
class MyCustomWidget extends WidgetBase {

  /**
   * The entity query factory service.
   *
   * @var \Drupal\Core\Entity\Query\QueryFactory
   */
  protected $entityQuery;

  public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, QueryFactory $entity_query) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
    $this->entityQuery = $entity_query;
  }

  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $plugin_id,
      $plugin_definition,
      $configuration['field_definition'],
      $configuration['settings'],
      $configuration['third_party_settings'],
      $container->get('entity.query')
    );
  }

The following error results:

  Recoverable fatal error: Argument 6 passed to
  Drupal\custom_module\Plugin\Field\FieldWidget\AddressWidget::__construct()
  must be an instance of Drupal\Core\Entity\Query\QueryFactory, none
  given, called in
  /homedir/core/lib/Drupal/Core/Field/WidgetPluginManager.php on line
  130.

Is it not possible to use dependency injection in this case or am I missing something?


texts: hook_user_update() is invoked before saving the user account, not after

texts:
I created a module that implements hook_user_update().
As far as I understand this method is called once a user has edited his data and this has been saved to the database.

The problem I notice is that it is not what really happens with my code: The code is called before.

function mymodule_user_update(&$edit, $account, $category) {
  $username = "username";
  $password = "password";
  $database = "database";

  mysql_connect(localhost,$username,$password);
  @mysql_select_db($database) or die( "Unable to select database");
  $query = "select * from somewhere;";
  $result = mysql_query($query);

  $num = mysql_numrows($result);

  $myFile = "some_file.txt";
  $fh = fopen($myFile, 'w') or die("can't open file");
  $stringData = "now: ".date('Y-m-d H:i:s')." Value is:".mysql_result($result,0);
  fwrite($fh, $stringData);
  fclose($fh);
}

When I check the result at this point, the values are still the ones before saving the user account.
I thought it would be some kind of database cache but this is supposed to be deleted once you edit the table.


texts: Available updates report does not list all available module updates

texts:
I just noticed that the page admin/reports/updates highlights subsequent modules as I proceed with the upgrades. For example, initially the Webform and Token modules got the yellowish highlight, and then when I applied the updates to those two, refreshing the page highlighted subsequent modules, say: Date and Rules.

So, is there a particular logic in which the suggestions are made? And, can one get a COMPLETE list of update candidates at one shot?


texts: Rewrite a Views Field to get rid of accents. I need roman alphabet characters for a csv export

texts:
I'm using Views Data Export to generate CSV files for end-users to use and then re-upload using Feeds. I need Vietnamese characters like â ỏ ể to be converted to a o e before export as these are in users' names.
I tried utf8_decode in Views Data Export settings but it doesn't work for all characters and even then, changing Feeds to use ISO-8859-1 still results in a "This isn't a UTF-8 file" error.
It seems that changing a setting in Excel can fix this but that isn't an option for me for usability reasons. I'm not the one who will be using these CSV files so I need these names to be exported properly.


texts: Does anybody else encounter issues with the new Flexslider 2.3.0 library and Drupal?

texts:
After installing the most recent version of the flexslider library (2.3.0) the Drupal Flexslider module (7.x-2.0-alpha3) is not able to find the flexslider library anymore.

I get the following error on admin/reports/status:

FlexSlider version could not be determined. Please consult the README.txt for installation instructions.


texts: Grabbing and Manipulating Endpoints/Referenced Entities in Rules

texts:
Using Rules, I am creating relations from a Lab Cage Content Type that has a field that is an entity reference list, where you can select a list of Mice entities. For instance, if the user selects 3 Mice from the Lab Cage's entity reference list field, 3 relations are created between the Lab Cage and each Mouse. How would I be able to manipulate the fields of the Mouse in Rules? Rules doesn't recognize that the entity reference list field contains entities with the Mice content type, so I cannot select fields related to that content type. Here is my rule so far:

Event

After saving new content

Conditions

Node is of type Lab Cage

Actions

Loop through an entity reference list in Lab Cage (called node:field-micelist), gives me each item as a variable list_item

I create a new list (create_relation)

Add an item to a list create_relation (list_item)

Add an item to a list create_relation (node)

Create a new entity Relation between endpoints in create_relation list

Save entity

My question comes in the next action I'm trying to accomplish:

2. Next I want to set a data value to a field from the Mice endpoints, basically I want to copy data from a field in Lab Cage to a field in a Mouse. Is this possible?


texts:
I am very new to Drupal.

I have a table called test with two fields: (int) id and (varchar) text
When a new user signs up I want to store data on the table test

I'd like to know how can I do that. I really don't know how to start researching about this.

I think the most approximately that I have found is Overriding user login. I presume that it does what I want but in the pre-process functions I have to insert into the database. Question here how do I insert into the database from Drupal?

Could anyone clear my thoughts or point me to any good reference.

Thanks.


texts: Trying to replicate a view with no success

texts:
I'm currently working on my drupal site and I have trouble replicating one view. This is the view I'm talking about.

I have replicated the drop down menu, the search bar "with the exception of a placeholder" and the list of episodes as well, but I'm having trouble replicating something where it autoselects/autodefaults the dropdown menu item based on the show name. (represented by the red arrow) I have tried everything, contextual filters, remember options, but nothing works.

Can you help me, I'm at loss of words here as to how to replicate it? Your help would be gratefully appreciated.


texts:
I am using Services Module in Drupal 7. When I try to POST comments, these comments are Posted anonymously.

I am sending POST request to ?q=endpoint/comment.json

with this Body

{   "nid":"401","subject":"Comment Subject sdfsdf ",   "comment_body":{
    "und":[{
      "value":"Comments body sdfsnd fsd fds "
    }]   } }

Comments are getting posted but anonymously. I want to comments to be posted by the name of logged in user.


texts: Does node_save create all fields associated with a custom content type automatically?

texts: I have a custom content type and want to create new nodes in code.  The content type contains fields, some will be set with values and others left empty.  Is it necessary to define all the fields using $node->field_custom_name[$node->language][0]['value'] = 'field value'; or just the ones with values to complete the node definition?


texts: Ensure a given module (set) is enabled on a dev site

texts:
Configuring dev-site specific settings is easy using the $conf array in settings.php

Sometimes I need to also disable (securepages) or enable (devel) certain modules on a dev site, but I don't know of an analogous method for doing this via settings.php

One hack which seems tempting is to define, say, menu_init() in settings.php (*gasp), and make that function check that the required modules are enabled using module_exists().

[* Yes, all manner of things might asplode if menu.module defined that function. OMG,ETC.]

So I'm wondering if people have done similar things to make sure their dev site is correctly configured, and if so, what. Is this the Poor Dev's Pantheon?


texts: Not able to find login form anymore on Drupal

texts:
We are not able to find the login form anymore on Drupal. We can't find the form on site.com/user/login... We can't find it anywhere.

How can we login?


texts:
What is the proper way to write a query containing 'NOT IN' using a condition statement?

My query is the following one:

SELECT DISTINCT nid FROM node WHERE language NOT IN
  (SELECT language
    FROM languages WHERE language = 'ab');

I've tried something like the following:

$query->condition('n.' . $key, $value, 'not in (select language from
  languages where language = $value)');


texts: Add 2 filters for a single field in views

texts:
I am writing a view code for my module, stuck with writing 2 filters for a single field.

 $data['taguser']['tag_uid'] = array(
    'title' => t('Tagged user'),
    'field' => array(
      'handler' => 'taguser_views_handler_field_user_name',
      'help' => t('Display the user name the Item has been assigned to.'),
      'click sortable' => TRUE,
    ),
    'filter' => array(
      'handler' => 'taguser_views_handler_filter_user_options',
      'help' => t('Filter Action Items by the assigned user.'),
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_user_uid',
      'help' => t('Filter Acton Item by the assigned user.'),
    ),
    'relationship' => array(
      'help' => t('Relate a case to the user who have been assigned to the case.'),
      'handler' => 'views_handler_relationship',
      'base' => 'users',
      'base field' => 'uid',
      'label' => t('Assigned to'),
    ),
  );

i want another filter for this field like

'filter' => array(
  'handler' => 'taguser_views_handler_filter_user_options_list',
  'help' => t('Only limited user.'),
),

how can i add to it ??


texts:
I'm trying to query a random node from the last 10 that were created.

So far I've used this but it doesn't produce the right results:

 $query = db_select('node', 'n');
 $query->fields('n', array('text','created_time'))
   ->orderBy('n.created', 'DESC')
   ->range(0, 10)
   ->orderRandom();
$result = $query->execute()->fetchAll();

How can I get the data I want?


texts: What's the easiest way to add a contact form for all nodes of a certain content type?

texts: I need to add a contact form to all nodes of a certain content type, so when a user submits the form it's delivered to the e-mail address of the author of the node. I tried using Webforms as a block with Contexts but Tokens doesn't work.


texts: What is causing content types to not display created nodes

texts:
I have an issue with a D7 site built in Panopoly. I have created several content types. When a user creates a node via one of these content types the node is blank. However the data is available (appears in the appropriate fields) if you click the "edit" tab.

The title of the node will be shown, but none of the other fields.


texts:
How to create paragraphs item programmatically?

In Drupal 7 I am using the following code.

    $node = node_load($nid);
    $paragraph = new ParagraphsItemEntity(array('field_name' => 'field_name', 'bundle' => 'para_bundlename'));
    $paragraph->is_new = TRUE;
    $paragraph->field_ptest1['und'][0]['value'] = 'Foo';
    $paragraph->setHostEntity('node', $node);
    $paragraph->save();
    node_save($node);

But its not working ?


texts:
I've created a website based on a Drupal 7 Zen subtheme and now I would like to create a login page for the administrator. When I navigate to http://mysite.com/?q=user, I return to the main page as specified in the page.tpl.php file. I would like to have a manual login page, so I tried following the following tutorial: https://drupal.org/node/350634. My template.php looks like this:

function camuse_theme() {
  $items = array();

  $items['user_login'] = array(
    'render element' => 'form',
    'path' => drupal_get_path('theme', 'camuse') . '/templates',
    'template' => 'user-login',
    'preprocess functions' => array(
       'camuse_preprocess_user_login'
    ),
  );

  return $items;
}

function camuse_preprocess_user_login(&$vars) {
  $vars['intro_text'] = t('This is my awesome login form');
}

And my user-login.tpl.php file like this:

<?php print render($intro_text); ?>

<?php print drupal_render_children($form) ?>

However, when I navigate to http://mywebsite.com/?q=user, I still go to the home page. I don't know what I'm doing wrong here, I've checked the names and everything seems fine. Could anyone help me with this?


texts:
I have created a custom table in drupal database. I need to use this table data in views . For this I have used schema module but its displaying only new views. But I need to use these table data in all views in our site.

Any suggestions?


texts: Alter field value without save it, but caching it

texts:
I want to alter a body's node value, but without saving it:

the altering depend of a array of values, witch it could change sometime, so i have to update every node at each change if i save it. Anymore, the backward before re- altering it could be very complicate.

For now i change the render value in a preprocess theme hook.

But if the body is very long, the altering could be hevy.

So i'm thinking about something like that :

Before rendering, check the body's node cache.
if it's empty, generate it with the altered value.
when updating values responsable of  altering the body's, i reset the node cache.

Is there a common way to do this using the drupal's system cache or have i to make my own for this specific task?


texts:
I have created a few blocks via /block/add and assigned these blocks to various regions defined in my theme.

How am I able to add content to these blocks?


texts: Why is drupal spitting out urls like entity:/node-1474 instead of /node-1474

texts:
So for the longest time I was using the following line of code to get urls instead of relying on drupals raw output. The main reason being I need an <a> tag to wrap several elements.

{{ item.content['#paragraph'].field_home_slider_button_link.0.value.uri }}

Inside of a field.

For a quick minute I contemplated just removing the entity:, however I'd really like to understand what's happening here and if there's a way to tell drupal I want the actual url in either twig or some setting?


texts: How to set the default values of "Included Export Components" for a Drupal Webform

texts:
I'm trying to figure out how to set the default values of the Webform Results > Download > Included Export Components Field to exclude certain fields.

The webform module defaults to a state for that field in which all the webform's fields are checked.  They can be manually unchecked before each download but we've run into a business requirement by which we would require 3 fields (IP Address, Draft, and UID) to be unchecked on the page load.

I've looked through the configuration pages for the webform module and for the specific webform node and have come up empty handed.  I've considered writing an additional module which will override the module which sets the checkboxes.  Before I went that route though, I was wondering if anyone has dealt with this requirement before and/or can share some insight/point me in the right direction.

Thanks!


texts: Custom content entity: can't hide translation details in edit form

texts:
I've created a multi-lingual custom content entity using Drupal Console. The basic stuff with editing/viewing works fine, also multi-lingual. But for some reason, I can't hide the "Translation" details form element (the one with the translation meta data) in the entity's edit form.

Screenshot of form display settings:

Screenshot of edit form:

In the config export core.entity_form_display.chunk.weather_daswetter.default.yml the translation also is listed correctly in the hidden section:

id: chunk.weather_daswetter.default
targetEntityType: chunk
bundle: weather_daswetter
mode: default
third_party_settings:
  stuff_from_field_group_module_here: nothing_with_translation
content:
  all_visible_fields_listed_correctly
hidden:
  changed: true
  created: true
  langcode: true
  translation: true
  uid: true

Into the blue I've tried relisting the fields from core's ContentTranslationHandler in my own src/Entity/Chunk.php->baseFieldDefinitions() and explicitly set them configurable, but this did not help either:

/**
 * @ContentEntityType(
 *   id = "chunk",
 *    ...
 *   translatable = TRUE,
 *   ...
 * )
 */
class Chunk extends ContentEntityBase implements ChunkInterface {
  use EntityOwnerTrait;
  use EntityChangedTrait;
  use EntityPublishedTrait;

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

    // tried adding this, did not help
    if ($fields['content_translation_status']) {
      $fields['content_translation_status']->setDisplayConfigurable('form', TRUE);
    }

    if ($fields['content_translation_outdated']) {
      $fields['content_translation_outdated']->setDisplayConfigurable('form', TRUE);
    }

    if ($fields['content_translation_uid']) {
      $fields['content_translation_uid']->setDisplayConfigurable('form', TRUE);
    }

    if ($fields['content_translation_created']) {
      $fields['content_translation_created']->setDisplayConfigurable('form', TRUE);
    }
  }
}

Why doesn't the form display mode control for "Translation" work?

I really want to keep this visible and configurable in the UI and therefore want to avoid using hook_form_alter.

UPDATE:
I've tried using hook_form_alter, but this doesn't work either:

function wt_chunks_form_alter(&$form, $form_state, $form_id) {
  if ($form['#entity_type'] == 'chunk') {
    /** @var $formMode \Drupal\Core\Entity\Entity\EntityFormDisplay */
    $formMode = $form_state->getStorage()['form_display'];
    $hiddenFields = $formMode->get('hidden');
    if (in_array('translation', $hiddenFields)) {
      //code goes into here, but the key 'content_translation'
      //does not exist in the $form array
      $form['content_translation']['#access'] = FALSE;
    }
  }
}


texts:
I have a JSON array, and I want to pass it to drupal function to work with the data. what are the possible ways to do that?

any code sample would help


texts: Display Suite layouts not available for field collections Edit\Add forms

texts:
I'm using Drupal 7 with the Display suite and Field Collection contrib modules.

For nodes entities the "Layout for..." vertical tab provided by Display Suite is available in both "Manage fields" and "Manage display". This applies also to any node content type I created, so I'm able to rearrange forms layouts used when adding\editing and when viewing nodes.

But for field collections the "Layout for ..." vertical tab is missing in "Manage fields" and it's available only in "Manage display", so I'm not able to rearrange the layout used by the add\edit form specific to field collections.

Is this a limitation of Display Suite? Any other way to rearrange the edit\add form for field collections fields?


texts: Link formatter to display link title, image and summary

texts:
I know I've seen a module that does this at some point in the past but can't seem to find it right now. In Drupal 8, I have a link field. I want to fetch that link's metadata so I can display the link's title / summary / image via a formatter (think of how facebook displays links). I don't remember if this worked server-side, storing the info in the drupal db or client-side via javascript (and for the prototype I'm putting together, I doesn't matter).

I'd appreciate any help before I decide to go and write it myself.


texts:
I want to search mix values inside $filter->condition e.g

$mix =  array(12,21)

$filter->condition('category',$mix, 'IN');

But it is not working on search api query. Can anyone give me any alternate solution for this?

Thanks


texts: Couldn't get setErrorByName to apply error class

texts:
I have created a form following structure:

my_module
    |__
       src
         |__Form
                |__myform.php

I want to get the form_state in some() function in controller located at:

my_module
    |__
       src
         |__Controller
                     |__mycontroller.php

So that I can set error on one of my form element (say) - upload_container. And I will call function some():

static function some() {
$form_state->setErrorByName('upload_container', 'throw error while validating form');
}

here shown below as (in myform.php):

public function validateForm(array &$form, FormStateInterface $form_state) {
   mycontroller::some();
}

In D7, we do the same thing in a separate file example: common.inc

static function some() {
    form_set_error('upload_container', 'throw error while validating form');
    }

But in D8, How to set error on a form element via function located somewhere in controller file? I can't even get form_state in any third function which is located at controller.


texts: How do I change pager (# of items) for one page display in a view?

texts:
I have a view that will have about 7 different display pages. Some of the pages will have a different amount of items displayed on that page.
When I'm on my Publication Page (display name) and change Use pager:Display a specified number of items | 3 items to 15, it changes it for all displays in this view.
How do I override it for this display only. Here is a screenshot of the page I'm currently on: https://ibb.co/8YJpC1d
I thought this would be something easy (probably is), but I honestly couldn't find anything online to help me.


texts: AJAX pagination with back button Drupal view

texts:
I have one view of a multimedia page wherein I use AJAX for pagination. The view shows the result of a multimedia image. When I click on the image it goes to the inner content page. In the inner content page there is a back button. When I click the button, it goes back to the previous page from where I came.

When I click on the back button it always forwards me to the multimedia page. But I want it to forward me to pagination page 2 if I came from page 2.


texts: How to send notification for an event for users that have signed up with the list of events for that month?

texts:
I have a content type for "Event" which has a date field describing when the event is going to occur. I want users to signup for this event notification and they would be notified of all the events for that month.
Prerna


texts:
Does the admin role always has access to everything ?

Because even if my AccessResult returns false, my admin still have acces to it (but it's perfectly working for the other roles)


texts: How to get $form_state['values'] after a drupal_get_form() call?

texts:
I have an form in a block with ajax submission. The block view code calls drupal_get_form, adds some other info, uses a custom theme tpl to create the block.

I want to replace the form in the block with a thank you message after successful submission.

AJAX works: The ajax on the submit element of the form means that a custom ajax callback  can replace the entire form with another themed chunk, passing in the form values received by the form so they can be merged in the thank you template. This works well because the ajax function has access to the form_state.

But what if AJAX is unavailable on the client? Then the normal form submit happens and the block view function just gets a blank form.

So how can my block view function get hold of the submitted values to feed them into the thank you template?

Edit: messy work-arounds

I could just access $_POST but that's nasty and unvalidated! yuk
In the submit handler I can copy the $form_state['values'] variable to a superglobal, and check for that.


texts:
Am using Drupal 7 Feeds module and I have "Autocomplete term widget (tagging)" field in content type.

As well as I have configured as "Auto create". But, when I import nodes that auto creation does not working, its shows the blank field.

Any other way to do?


texts: Transferred website not referencing images files correctly

texts:
I recently copied some Drupal websites from a local Acquia Dev Desktop web server to a local MAMP web server.

Curiously the sites work except the graphics are not loading. i.e., stylesheets load, database connects but no images.

The browser’s error console shows that the root dir folder is not being read. For example:

http://localhost:8888/sites/all/themes/mytheme/images/some_image.png

should instead be referenced as such..

http://localhost:8888/mysitename/sites/all/themes/mytheme/images/some_image.png

Does anyone know why this is happening and how to fix?


texts: How to display additional fileds I've added to a page - the way I want them?

texts: I've added some additional fields to the content type - Page. But now when the page is rendered it displays all of them as well - just lists them at the bottom of the content. But that's not what I want - I do not want them to display at all, I just want to use them elsewhere in PHP code. There should probably be a hook for this, but I still just can't get my head around the whole thing. Please?


texts:
I have a custom module that creates a form. I want to display a message to a user, but I don't want to use the normal drupal_set_message method. I want to add a div with text and images to the top of the form after submission.

A user may be submitting this form multiple times. So after submission, I want to still be on this page. It's just that after the form is submitted, a new div will appear at the top.

I don't really know how to detect that the form was submitted. It's similar to replacing the form and displaying a thank you message.

What is the best way to achieve that with Drupal 8?


texts: How to integrate captcha to multi page webform

texts:
I have integrated a multi step form through the drupal webform modules. Need to add a captcha at the end of the form. I have used captcha module for it..but while enabling the module and assigning the form id from the backend it is adding the captcha to each step forms.

Can any one please help me how to add the captcha at the end of the form.


texts: Is there any possibility to add a relationship in views from a second database to the default one. I.e. I am using a second database which contains one table with a userid. In my hook_views_data I would like to add a relationship from this field to users_field_data uid. How can I do this?


texts: PDF Module, PDF full pageheight or full scroll

texts:
I managed to get a PDF in a content type and to show the full PDF. I do this with the PDF module in drupal 7.
But I want't the height of 1 page (A4 always) or just the full height of the document.

How can I manage this? 100%, auto doesn't work. I can only give a certain amount of pixels. But when it's resized, it's not perfect, the frame is higher then the document.

When I try to use the option PDF: Continuos scroll, it breaks. That should also be a solution for me, just the height of the document. But I have the following errors:

  Uncaught (in promise) TypeError: Cannot read property 'getDirection'
  of undefined at webViewerLocalized (viewer.js?opdors:7109)
  viewer.js?opdors:4958 Uncaught (in promise) TypeError: Cannot read
  property 'firstElementChild' of null at PDFViewer
  (viewer.js?opdors:4958) at viewer.js?opdors:5790 at Promise () at
  Object._initializeViewerComponents (viewer.js?opdors:5778) at
  viewer.js?opdors:5692
  /sbsdebrug/sites/all/libraries/pdf.js/build/pdf.worker.js:50046 The
  provided value 'moz-chunked-arraybuffer' is not a valid enum value of
  type XMLHttpRequestResponseType. supportsMozChunkedClosure @
  /sbsdebrug/sites/all/libraries/pdf.js/build/pdf.worker.js:50046
  pdf.js:28 Uncaught (in promise) ReferenceError: getOutputScale is not
  defined at renderPage (pdf.js:28) pdf.js:28 Uncaught (in promise)
  ReferenceError: getOutputScale is not defined at renderPage
  (pdf.js:28) pdf.js:28 Uncaught (in promise) ReferenceError:
  getOutputScale is not defined at renderPage (pdf.js:28) pdf.js:28
  Uncaught (in promise) ReferenceError: getOutputScale is not defined at
  renderPage (pdf.js:28)


texts: My drupal 7 site has an user rating system for authors content, but problem is, every up-vote and down-vote do not add point's automatically in users profile. But i think, it is possible by User Points module. From Userpoints Karma module page i have learned that vote/up down module allows a voter to add or subtract points to the author of a given node or comment, thereby awarding or punishing the author for what they wrote.So, i have configured vote/up down module successfully, here is a screenshot of a views of my website: Now my question is, How to add point's automatically for votes using vote/up down module and User Points module? So, if an user vote a content then the user points for that content author will be 10 + 5 = 15! {Here 10 is previous user point for the content author and 5 is the value for every up-vote!} I can't understand that How to do it automatically? Any ideas? Thanks


texts:
i'm new into the world of Drupal, i'm a student comming from the Symfony ^^

I have create a module an i want to add an database connection for my module. In looking for an answer i have see the method getConnection of the Database class.

I have tried this onto my controller

$connection = \Drupal\Core\Database\Database::getConnection('moduleunicef','password');

for connection at my database called moduleunicef, i have see i need to modif my setting.php file.

/* /sites/default/setting.php*/
$databases['default']['default'] = array(
 'driver' => 'mysql',
 'database' => 'moduleunicef',
 'username' => 'theuser',
 'password' => 'password',
 'host' => 'localhost',
 'prefix' => '',

);

In result i have this error message (For security i have change the password and user ^^ )

  Drupal\Core\Database\ConnectionNotDefinedException: The specified database connection is not defined: root in Drupal\Core\Database\Database::openConnection() (line 366 of core/lib/Drupal/Core/Database/Database.php).

  Drupal\Core\Database\Database::getConnection('moduleunicef', 'password')
  Drupal\unicef42\Controller\PbRouteController->index()
  call_user_func_array(Array, Array)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
  Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
  call_user_func_array(Object, Array)
  Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
  Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
  Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
  Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
  Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
  Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
  Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
  Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
  Stack\StackedHttpKernel->handle(Object, 1, 1)
  Drupal\Core\DrupalKernel->handle(Object)

So i have tried an over method into my controller

$connection = \Drupal::database();

the test of connection it's Ok but it's the base who i have input onto my setting.php file? or the drupal DataBase created for the install of the website?

I need some namespace onto my controller?


texts: Ubercart : How to display product information ( of certain brand ) as XML?

texts:
Can the Ubercart module display product information of certain brand as XML ?

I have looked into Ubercart module settings, but I can't find anything useful.


texts: Complex SelectQuery with multiple left joins and conditions with OR

texts:
I have a view and in hook_views_pre_execute() I have to add multiple left joins with conditions. Currently I'm doing this:

$or = db_or();
foreach ($fields as $field) {
    $query->leftJoin($field->table, $field->table, '(node.nid = ' . $field->table . '.entity_id)');
    $or = $or->condition($field->table . '.' . $field->field, '%' . $string . '%', 'LIKE');
}

$query->condition($or);

but it doesn't seem to work.


texts:
I want to show view content only to authenticate devices,
So I have a plan to add a custom field for users and add MAC address of authenticated device in it, send MAC address of device via GET/POST method to view and if the MAC address is valid show contents!
Sending MAC address using GET/POST method is not a big problem :) (Already done)
But I don't know how can I authenticate in views side!
is there any module or custom code or something like that to check if MAC address validated show view content ?

Thanks a lot :)


texts: Get all content in all language using query

texts:
I tired to get the content from db using query with some conditions and I need to fetch content in all languages. I have tried two methods, only english language content were fetched, but it doesn't work for all other languages...

Method 1:

    $langcd = \Drupal::languageManager()->getCurrentLanguage()->getId();
    $query = \Drupal::entityQuery('node')
      ->condition('status', 1)
      ->condition('type', 'page');
      ->condition('langcode', $langcd);
    $nids = $query->execute();

Method 2:

    $db = \Drupal::database();
    $query = $db->select('node', 'n');
    $query->fields('n');
    $query->condition('type', "page", "=");
    $query->condition('langcode', $langcd);
    $result = $query->execute()->fetchCol();

Every time I am getting only the English version of that content, but other language for that particular content was available in db. Please somebody help me to get the content in all other languages.


texts: DrupalKernel not found, after install package with composer

texts:
I have Drupal 8 Website and i want install this library with composer :

https://github.com/spatie/calendar-links

After run "composer require spatie/calendar-links", the drupal 8 make big error:

"Fatal error: Uncaught Error: Class 'Drupal\Core\DrupalKernel' not found in /home/[...]/public_html/index.php:16 Stack trace: #0 {main} thrown in /home/[...]/public_html/index.php on line 16"

How can i resolve this problem ? I use composer with netbeans.


texts: Node Clone operation/tab missing for webform

texts:
Node Clone 7.x-1.0+2-dev
Webform: 7.x-4.13
Drupal 7

I only see the clone operation available on 1 custom content type, and NOT on my webform content type.

I tried installing the node clone tab module, and the tab does not appear either.

Clone any node, clone own node permissions enabled for my role 'Administrator'.

Any suggestions for moving forward?


texts: How to create a view that links an image from a field collection item to the field collections host node

texts:
I have a custom content type "FH Portfolio" item that contains (among other fields) a Field Collection of "Geoimages". Each Geoimage contains (among other fields) one or more "Portfolio image" fields.

I'm trying to construct a view (block) that displays 3 'featured' FH Portfolio items, showing the first Portfolio Image. On hover, the title of the FH Portfolio item should be displayed. When the image is clicked, it should link to the FH Portfolio item, not the Geoimage that has provided the image.

I can get the images displayed correctly, with an Image Hover Effect (using Image Hover Effects module, which relies on a link being wrapped around an image to work)) that displays the title of the relevant FH Portfolio item (by using the token [host:node:title] ), but I can't make the image/title link to the FH Portfolio item; is there any way to do this? (I have Image linked to content).

I've tried rewriting the image field as a link going to [host:node:url] but that doesn't work.  (I've also tried including Content:Path as a field in the view (excluded from display) and rewriting the image field to display a link to [path].  That works, but I lose the image hover effect displaying the title.).


texts: Change label max length on all field types

texts: The default max length for all labels of all field types is 128. The db can handle 255. So no schema change. How can I change the default max length to 250?


texts: Autocomplete views exposed textbox for Entity reference field

texts:
I've got 2 content types "Equipment" and "Machine" , "Equipment" content type consists of an entity reference field targeting "Machine" content types.

My goal is to provide an exposed filter for user so he/she can filter equipments based on Machine's model. If "- Enable Render Views filters as select list" is checked in field settings exposed filter type changes to "select list" but cause I've got more than 11000 different models of machines , this is not an appropriate tool for selecting the proper model.

so the question is how can I provide an autocomplete textbox widget for this field (like what is provided in node creation form)?


texts: How can I assign the Commerce Product SKU as the Path Alias?

texts:
We would like to automatically assign the Path Alias for each new Product as /products/sku.

How can we do this, either from the URL Alias admin UI or via Rule or programmatically?


texts: Hook fires before current_user service can identify current user

texts:
I want to make a menu link disappear when a user doesn't have permission to use it.  I tried this code:

function some_module_menu_links_discovered_alter(&$links) {
  $user = \Drupal::currentUser();

  file_put_contents(DRUPAL_ROOT . '/logs/permission.txt', var_export($user->hasPermission('access some module config'), true));
  file_put_contents(DRUPAL_ROOT . '/logs/roles.txt', var_export($user->getRoles(), true));
  file_put_contents(DRUPAL_ROOT . '/logs/id.txt', var_export($user->id(), true));

  if (\Drupal::moduleHandler()->moduleExists('some_module')) {
    if (!$user->hasPermission('access some module config')) {
      $links['some_module.admin']['parent'] = '';
    }
  }
}

And it didn't know that the logged in user existed.  I was logged in as an administrator, and it thought I was anonymous.  I tried the same code in another hook, and it worked.  So, I'm curious:

Why does this hook load before currentUser knows I'm logged in?
And, are there other hooks like this?
Should I try to figure out the current user through another more low-level method?
Or, is there another way to make a menu link disappear when a user doesn't have permission to view it?

EDIT: Providing code to show what I've done.  The menu link is not disappearing when users don't have access to the route it links to.

some_module.settings:
  path: '/admin/config/system/some_path'
  defaults:
    _form: '\Drupal\some_module\Form\SomeModuleForm'
    _title: 'Some title...'
  requirements:
    _permission: 'access some module config'

The users do not have the access some module config permission, yet the menu link is showing up for them.  When they click on it, they get an access denied page.


texts: Which releases are supported with semantic versioning of modules?

texts:
I have a site running Drupal 8.9.13.  I have enabled email notification for "only security updates" and it generally works well - I get a mail for "urgent things" otherwise I wait and apply ordinary updates once a month.
Today I received a warning about an unsupported release.  When I check, all I find is an available update.  For this module, I am running 2.0.0 and 2.1.0 is available.  According to the documentation about semantic versioning for Drupal modules, this is a change to the minor version.  I don't see any reason why 2.0.0 is in fact unsupported.
From my perspective, this isn't an "urgent thing" and I don't want to be mailed about it every day.  Under the "old" version numbering scheme, a minor version change such as 8.x-3.5 to 8.x-3.6 does not cause the same behaviour.
Is this a bug in the Drupal core update module?  Or have I misunderstood how the new semantic version mechanism works?
Screenshot:


texts: I've got several custom modules I have written and they make liberal use of Views, Panels and the CTools page manager.  I've exported the views, panels and page variants into the module code, and am wondering if there is any way I can use drush to revert my production site to the new views/panels/variants after I do the rsync, rather than logging in and commencing the click, wait, click routine.


texts:
I've read documentation about name suggestions but I don't get it.
My goal is to create a specific template used only with a specific content type (Drupal 8).

I've copied page.html.twig to edit the code inside a new file, named page--recette.html.twig (recette is the name of my content type) but this doesn't work.

html--node--recette.html.twig doesn't work neither.

Link : http://ofhjfqaj.preview.infomaniak.website/cms/recette-sans-gluten/tarte-tatin-comme-la-vraie


texts: How to add css and js file in custom module

texts:
I created a custom module in drupal 8. And I am trying to add js and css file in
my_module.libraries.yml file using this

lrv_key:
  version: 1.x
  js:
    js/lrv.js: {}
    dependencies:
      - core/jquery
      - core/drupalSettings
  css:
    theme:
      css/lrv.css: {}

But it doesnt work.


texts: Entity Reference Colorbox Format Display

texts:
I'm having trouble in creating an album with many galleries, that reference images through entity reference content type from Biblio. I have tried many ways to create the following. But all partially failed.

In my last try I followed the following tutorial: Creating-a-drupal-7-image-gallery-using-content-types-nodes_tech , it works out fine with the referenced image.

But couldn't complete the tutorial in the following step:
I need to change the referenced image format to colorbox, from the Manage Display of Node Image content. Is there way to do the following on a referenced entity?

Is there a better solution?


texts: Where is the location of developer/globals.php

texts: It's documented on the drupal website here but this path does not exist in the drupal installation.


texts: What is the database relationship between node_type and taxonomy_vocabulary tables?

texts:
I have 3 content types. I have 3 vocabularies - one for each content type.

Recently I have created a script to save nodes programatically based on batch files clients send me. I am very happy with it, and it works fine.

However, I currently have to manually manage a separate file for a huge multidimensional array. Here is an excerpt from the file.

$query['baby_clothes']['category']['id'][] = 1;
$query['baby_clothes']['category']['id'][] = 2;
$query['baby_clothes']['category']['id'][] = 3;
$query['baby_clothes']['category']['id'][] = 4;
$query['feeding']['category']['id'][] = 26;
$query['feeding']['category']['id'][] = 28;

The first dimension represents the content type and the others the id. There is one entry per unique taxonomy term id in the array. Basically I loop through the IDs; extract the content type from key [0]; save accordingly.

As the taxonomy grows and changes this becomes very inefficient to manage, and i would like to create these arrays dynamically, but I am having trouble understanding the database relationships to create this part of the code.

Basically it would work like this:
"Get an array of content types. For each content type get the taxonomy IDs for the one vocabulary that is associated with the content type. Dynamically create the array."

Or, how about this? Would this be easier?
"Get a list of taxonomy IDs. Get the content type with which this term is accociated. Now I have my content type and my id - save node accordingly."

I can see the node_type and taxonomy_vocabulary in the mysql database, but I am not sure how they relate to each other, or how to relate them so I get the desired result.  I would prefer option two, but any direction is appreciated as well as are alternate suggestions. Pseudocode is fine. Thanks!


texts:
Where can I see the options accepted by the field API for the widget type?

$instance = array(
  'field_name' => $field_name,
  'label' => 'Demofield Demo',
  'description' => 'This is a demonstration text field.'
  'widget' => array(
      'type' => 'text_textfield',
  )
);


texts: How to edit files without changing the last modified date?

texts:
One of my sites recently got hacked with the dreaded pharma-hack. The hacker inserted base64_decode'd code into includes/bootstrap.inc

Initially I thought the FTP password was discovered since the password was quite weak.

However, the Hosting providers indicate that there has been no FTP access from other than my I.P. address. And also the file bootstrap.inc's "Last Modified" date has not been changed.

I let the client know to change his FTP password, and he's only done it a day after. However during that time, they changed another file includes/cache.inc (must've realised the code has been removed from bootstrap.inc), but the cache.inc's Last Modified date didn't change either. So now he's (client) changed his FTP password, but I'm worried that this hacker is gaining access not by through FTP, but by some other means.

I've thoroughly went through the site, and haven't noticed any abnormal, or out of place *.php files uploaded into the directories. Maybe I haven't looked hard enough? What other means are there to change a file's contents without using FTP? And how to change a file without changing the modified date?

Drupal 6.

Thanks.

Update: Most likely an FTP breach, as the affected site had a very weak FTP password (8 char only, all lowercase, only alphabets). This was probably done through brute force guessing the password, and then uploading a file that's sort of like a file manager. I seen this file cleverly (well not so I guess) disguised as LICESNE.php (hacker can't spell :) ) and ironically I managed to hack this file and gain access to the administration screen.

From this page you can create new files, modify existing files and run scripts on the server, delete files, manage databases etc. It was a 1 page hacker administration page!

The sites have not had a breach now as I've done the security updates and changed the passwords to secure ones.

Again thanks for all the answers and comments. Much appreciated.


texts:
After installing MAYO, I refresh my main site and get this error message:

  Fatal error: Call to undefined method Drupal\Core\Config\ConfigFactory::getEditable() in /var/www/fs1/38/[user name]/public_html/themes/mayo/mayo.theme on line 331

Re-installing didn't help. I can't figure for the life of me what I am doing wrong.

Could anybody help, please?


texts:
Is it possible to test signle sign from active directory on locally on your desktop?

Does it work with XAMPP / IIS?


texts: How do you change the URL alias of a contact form?

texts:
Sounds simple enough, right? I can't find it anywhere. My contact form's path remains:

/contact/contact_us

And I have no idea where to change this. I have checked under the form settings at:

/admin/structure/contact/manage/contact_us

Which leads me to believe that perhaps all contact forms are in the structure:

/contact/[FORM_SYSTEM_NAME]

Is that the case or is it possible to change it?

UPDATE

What I really want is a simple ALIAS field per contact form, so I can set the url alias myself?


texts: How do I take payments via Ubercart and distribute them to vendors?

texts: I'm working on a site that needs to take custom payment and remit a part of it to one or more vendors that are determined by the products purchased (the vendors essentially create the products themselves in the shop). I have seen Ubercart Marketplace as a possibility for this, but it's rather old. However, it's the closest to what I need. Should I go with it or is there a better, more fully-integrated solution in Drupal (that uses Ubercart) that I should investigate?


texts: A taxonomy-provider module: enable/disable vs install/uninstall

texts:
If a module provides a taxonomy vocabulary, what should happen in hook_install, hook_enable, hook_uninstall and hook_disable?

My main concern is how hook_uninstall should differ from hook_disable. Should we just taxonomy_vocabulary_delete() in both hooks? Should the existing nodes referring to the terms just lose the references upon disabling as well as uninstalling of the module?


texts:
I'm using Drupal 7, and this problem have been tormenting me these past few days :

let's say I'm using the basic content type Article, with basic view mode : full and teaser.

Now I'm creating a new content type Magazine, which reference multiple Article (with the module entity reference). On Magazine full view mode, I have set that every Article will be diplayed in teaser and linked to its content.

Easy isn't it ? Everything work fine. Noted that the red block in the sidebar are the same (with contexte module), and as the title.

Now I'm creating another new content type Book, which also reference multiple Article. On Book full view mode, Article are also displayed as teaser linked to  its content.
And now we have a problem when clicking on a Article from book: the sidebar and the title is from Magazine, and what I need is to display green block and title from Book.

What I get :

What I want :

Is there a way to achieve that ? By contrib or Custom ?

P.S. An article can be referenced in Book, or in Magazine, or both, or neither of them.


texts:
I have a Github clone of drush that has been working since it moved there.  I did a git pull this morning, and am now getting errors:

  $ drush

  Warning: require(/home/mpd/drush/vendor/autoload.php): failed to open
  stream: No such file or directory in
  /home/mpd/drush/includes/bootstrap.inc on line 1007

  Fatal error: require(): Failed opening required
  '/home/mpd/drush/vendor/autoload.php' (include_path='.:') in
  /home/mpd/drush/includes/bootstrap.inc on line 1007

How can I fix this?


texts: How can I display 2 or more fields horizontally?

texts:
In my content type I have several fields. I want to display two or more of them horizontally.

Here is an example:

 Auto
+------------+
|  INPUT     |
+------------+

 Ascensore
+------------+
|  INPUT     |
+------------+

Nome                Cognome
+------------+          +------------+
|  INPUT     |          |  INPUT     |
+------------+          +------------+

Città
+------------+
|  INPUT     |
+------------+

How can I do this?


texts: How to add order status to commerce_line_item_table view in same way as in the commerce_user_orders view?

texts: I am trying to add user's order status to commerce_line_item_table view same as it is present in commerce_user_orders view. When user click on order no in commerce_user_orders view and it goes to commerce_line_item_table view here the order status is not present i want to add order status in this view. Any Help please


texts: jQuery events are lost after form reload

texts:
First I thought that this would not be a Drupal specific problem, but jQuery specific solutions didn't solved it. I hope you have some advices.

I have a form with lots of fieldsets. To find the right fieldset I've implemented a textfield as a filter with jQuery to show just the fieldset I want to see:

$(document).ready(function(){
    $(document).on('keyup','#textfield-filter', {} ,function(e){

        if($(this).val()) {
            var val = $(this).val()
            $('#myform fieldset').each(function() {
                if($(this).attr('id').indexOf(val) >= 0){
                    $(this).show();
                }
                else {
                    $(this).hide();
                }
            });
        }
        else {
            $('#myform fieldset').each(function() {
                $(this).show();
            });
        }

    });
});

That works on page load. But I also have a Drop Down Select Menu to select a complete different set of fieldsets. With a click on a button the entiry page is refreshed with the set of fieldsets, which was selected in the Drop Down Menu. But unfortunately, the 'keyup' event of my textfield is not fired after refreshing the page with the button.
As I said, I thought about a jQuery specific problem first, but the only solution I found was to attach the event handler for now and for the future, what I already did with $(document).on('keyup','#textfield-filter', {} ,function(e).

The form is rendered with the Form API. If necessary I can -of cause- give you my php code.

I would welcome very advice.

Many thanks!

Daniel


texts: Automatically generate a short description of a page when a user posts a link

texts:
On facebook, google plus and similar websites, when someone posts a link, the thumbnail and short description of the page is automatically generated. See the screenshot below.

Is it possible to this in Drupal 7 ? If yes, how? Is there any module for it?


texts:
I have a page that contains 4 separate blocks, from the same view,

Items block 1 - this contains a list of item titles
Items block 2 - this contains a different list of item titles
Content block 3 contains content unrelated to this functionality
Results block 4 - this needs to display the details of the items that are highlighted in the above 2 sections after the user selects 'Next' in list 2.

I've found some information about passing variables to a view using contextual filters, but I'm not clear on exactly how this works still

how do I set up a filter - does it go in the source or target block or both?
how do I access the value in the target block?
how do the values get passed, on the URL, or as session values?

also my situation involves passing variables from 2 view blocks to another view block.

And presumably AJAX would need to be used to load the third view?

I could split the third block into 2 and display results from block one and block two separately, if that's any easier.

But I'm really not sure how to set up a filter or how to use the passed values, or how exactly contextual filters work, any guidance appreciated.

Update:
I have updated this question to try to make it clearer what I have and what I need to do.

Thanks to Remy I understand how the filter value is accessible, but I still don't understand the following:

Is there something I have to do to enable a block to be able to receive parameters (does it need to be an attachment, an embedded view, or something else)?


texts: How to update record programmatically with ECK?

texts:
I'm playing with Entity Construction Kit (ECK) on a Drupal 7 site. In a custom module I need to add, update and get ECK record.

By admin panel I created my entity "company" and his bundle "company". In my module I already built add and get method for the entity record (methods are working).

But  how can I update a specific record ?

Thanks.


texts: How to filter views output base on custom field

texts:
I've created a view listing a content type named foo, it has a custom field 'start_date' which can be left blank.

When a node's start_date field is left blank, it should always show in the listing. When it's populated, and the date is less than the current date - then the node should also be listed.

I've tried to use hook_views_query_alter to do this, but it didn't do what I wanted as it's for changing the query itself.

Which hook should I use?


texts: When making changes to files in sites/all/modules/moduleidownloaded where should the changes be stored? I know you shouldn't edit the core module files for risk of updates etc. So where should I put customized module files such as templates and styles?


texts: Adding a 'search tips' link next to the search button in a views-based search

texts:
I'm using a Drupal 7 views-based search. I have a search button in there of course. I'd like to add a link next to it called 'search tips' that goes to a 'basic page'. Anyone know how to add a link there?

This is the code I have so far:

<?php

  /*
    * Implementation of hook_form_alter()
    */
  function search_tips_link_form_alter(&$form, &$form_state, $form_id) {
    if($form_id == "views_exposed_form") {
    // there's a submit button in here I'd like to add a link after that...
    // not sure how to place a link with this function.
    }
  }


texts:
If my DB user doesn't have permission to truncate a table - would using delete instead without any parameters be equivalent?  So like -

 $this->db->delete('data')->execute();

in lieu of

 $this->db->truncate('data')->execute();

I've never used the delete command this way in the Drupal DB API.


texts: How to create a theme function for overriding Address Field theming?

texts: How do you create a theme function for overriding the formatting of an Address Field in Drupal 7? I didn't want to create a CTools plugin or work with render arrays.