texts: How do I correctly implement hook_bootstrap_colorize_text() to alter button colors in a Bootstrap sub-theme?

texts:
I have read similar questions on here, but I'm still struggling for an answer for this.

I'm trying to implement hook_bootstrap_colorize_text() to alter button colors in a Bootstrap sub-theme.

I would like to add some specific text items to the array that dictates how the buttons are colorizes. For example, I have some buttons that have the  "btn-default" class, and I would like to indicate specific texts to which should have “btn-success" or "btn-warning" instead.

The bootstrap.api.php describes this process:

/**
 * Allows sub-themes to alter the array used for colorizing text.
 * …
 * @see _bootstrap_colorize_text()
 */
 function hook_bootstrap_colorize_text_alter(array &$texts) {
   // This matches the exact string: "My Unique Button Text".
   $texts['matches'][t('My Unique Button Text')] = 'primary';

  // This would also match the string above, however the class returned would
  // also be the one above; "matches" takes precedence over "contains".
  $texts['contains'][t('Unique')] = 'notice';

  // Remove matching for strings that contain "apply":
  unset($texts['contains'][t('Apply')]);

  // Change the class that matches "Rebuild" (originally "warning"):
  $texts['contains'][t('Rebuild')] = 'success';
}

Therefore, I have attempted to implement the following code in my sub-theme (methodsTheme) template.php file without success.

<?php
// Implements hook_bootstrap_colorize_text_alter() to alter button colors.
  function methodstheme_bootstrap_colorize_text_alter(array &$texts) {
    $texts['matches'][t('Request Rotation')] = 'success';
    $texts['contains'][t('Notify')] = 'success';
    $texts['contains'][t('Set')] = 'success';
    $texts['contains'][t('Mark')] = 'success';
    $texts['contains'][t('Assign')] = 'success';
    $texts['contains'][t('Report')] = 'warning';
    $texts['contains'][t('Request')] = 'info';
  }
?>

I've also tried:

<?php
// Implements hook_bootstrap_colorize_text_alter() to alter button colors.
  function methodstheme_bootstrap_colorize_text_alter(&$texts) {
    $texts['matches'][t('Request Rotation')] = 'success';
    $texts['contains'][t('Notify')] = 'success';
    $texts['contains'][t('Set')] = 'success';
    $texts['contains'][t('Mark')] = 'success';
    $texts['contains'][t('Assign')] = 'success';
    $texts['contains'][t('Report')] = 'warning';
    $texts['contains'][t('Request')] = 'info';
  }
?>

And, I've also tried:

<?php
// Implements hook_bootstrap_colorize_text_alter() to alter button colors.
  function methodstheme_bootstrap_colorize_text_alter(&$texts) {
    $texts = array(
      'matches' => array(
        t('Request Rotation') => 'success',
      ),
      'contains' => array(
        t('Notify') => 'success',
        t('Set') => 'success',
        t('Mark') => 'success',
        t('Assign') => 'success',
        t('Report') => 'warning',
        t('Request') => 'info',
      ),
    );
  }
?>

And, yes, after each attempt, I'm clearing the caches to see if the changes to the code are implemented to the desired result. However, I'm still emptyhanded. I'm placing the template.php file in my sites/all/themes/methodstheme/templates folder. The sub-theme was already established and working well (i.e., it is set-up properly, I believe).

I'm using Drupal 7.64 (with install profile varbase, but I've mostly removed all usage of the varbase profile and modules) and latest version of Bootstrap 3 theme as the base theme.

Can anyone offer some help or suggestions on what the issue may be?


texts:
I have just installed a Drupal 8 website using drush dl drupal-8 --select.
I have rewrite issues because there is no .htaccess in my root directory.

Where can I find the default .htaccess file for Drupal 8?


texts: How can I create the functionality to assign icon per field type in field settings form?

texts:
I would like add a new setting for field which would allow to choose a icon for a field same as cardinality or any other settings.
/admin/structure/types/manage/[content_Type]/fields/field_[some_field_name]
I don't want it per instance but for a field type e.g. phone number could have phone icon.
I also don't want to play with hard coded templates and I'd like to use Icon api module's icon selector from ui.
There's a lot of hooks available and so far I've managed to get this icon selector to settings form (not sure how I made it) and also to save the value.
However, I cannot access icon data from forms such as views exposed forms which include these fields widgets with assigned icon since icon data is not available in field settings data or similar. There's only maxlength, size etc. "settings" available but not this icon setting.
function mymodule_field_info_alter(&$info) {
  // Add a setting to all field types.
  foreach ($info as $field_type => $field_type_info) {
    $info[$field_type]['settings'] += array(
      'icon' => array(
        'icon_field' => array(
          'label' => t('Icon'),
          'description' => t('Store a bundle and icon in the database to assemble an icon field.'),
          'settings' => array(
            'bundle' => NULL,
            'icon' => NULL,
            'wrapper' => NULL,
            'wrapper_class' => NULL,
          ),
          'instance_settings' => array(
            'bundle' => NULL,
            'icon' => NULL,
          ),
          'default_widget' => 'icon_field',
          'default_formatter' => 'icon_field_default',
        ),
      )
    );
    $info[$field_type]['instance_settings'] += array('icon');
  }

}

function mymodule_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {

  $form['field']['settings']['icon'] = array(
    '#type' => 'icon_selector',
    '#title' => t('Icon'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#default_bundle' => (isset( $form['#field']['settings']['icon']) && $form['#field']['settings']['icon']['bundle'] !== '') ? $form['#field']['settings']['icon']['bundle'] : '',
    '#default_icon' =>  (isset( $form['#field']['settings']['icon']) && $form['#field']['settings']['icon']['icon'] !== '') ? $form['#field']['settings']['icon']['icon'] : '',
  );
}

function mymodule_field_settings_form($field, $instance, $has_data) {
  $settings = $field['settings'];

  $form['icon'] = array(
    '#type' => 'icon_selector',
    '#title' => t('Icon'),
    '#required' => FALSE,

  );
  return $form;
}


texts: Views + VBO + User Point + Rules action incorrect

texts:
I make views(type:node) to grant user point with VBO and Rules but when I select users to grant point then point was grant to one user (I think current user).

but when I change views type to user , I select users to grant point is correct. (I want to use views type:node because I want to filter somethings with PHP filter )

Can I solve this problem?

sorry for my english skill.

Thank you.

Update : sorry I'm confuse about it.
I can solve it.

I've set Rules set
argument:content (before this I add argument content and user)

Do:
- Load content author
- Grant points to a user

Thank you


texts:
I cant figure out to hide forum sections based on role. I only want clan leaders to see the clan leaders section, squad members to see their own squad section etc. I already have the roles set up, but I can't figure out how to restrict access to container/forum based on those roles.

Someone mentioned the taxonomy access control module. But that seems really overyly complicated for what I want to accomplish.


texts: Is there any module for picking photos for image field on mobile platforms like iphone

texts: I think this is probably impossible but I wondered if there was any way to provide image upload or equivalent for mobile platforms for drupal.


texts: Stopping 404 pages when adding get variable to the URL

texts:
I have a Drupal 8 website with a URL like http://mywebsite.com/my-content-url/my-content-url. What I have done is adding a variable to the URL, making it like http://mywebsite.com/my-content-url/my-content-url/myvariable.

How do I get Drupal 8 to stop seeing /myvariable as a part of the URL and giving me a 404 error?


texts: I have some include files (.inc) that have classes in them that are used by multiple modules. Where should these be stored so that they are accessible to files[] in a modules .info file? Preferably without having to store copies of the files in each modules directory.


texts: In Drupal Commerce, what Rules need to be set to go directly to checkout after Add to Cart button is clicked?

texts: On a fresh drupal commerce install, clicking on add to cart brings your back to the same page. What is needed in Rules to have it go straight to checkout after clicking on the Add to Cart button?


texts: Print a specific Views Block in twig template

texts:
So, I created a block using Views and I´m trying to call it from a template.

mytheme.theme file has:

function mytheme_preprocess_node(&$variables) {
$variables['block1'] = entity_load('block', $id)->getPlugin()->build();
}

template-of-my-page.html.twig file has:

{{ block1 }}

But I don't see any results....

I bet I'm doing something wrong, I'm not a programmer, should I add the machine name? Am I calling it wrong on Twig?

If anybody could give me a guide on how to call a block made with Views I would really appreciate it.

Please consider I'm not a programmer but I can follow instructions very well :)


texts: Unable to sort by term weight within multiple term reference

texts:
I have two taxonomies, Menu and Menu Category. Menu has a term reference to Menu Category, allowing multiple selections.

I have a view that displays a Menu, and in this view I'm displaying the related Menu Categories - in the Multiple Field Settings for Menu Categories, I have the "Display all values in the same row" option unchecked.

The Menu Categories are sorted by weight, but in the view they are not being output in this order (I can't honestly say what order they are appearing in, perhaps by the order they were added as term references, but certainly not alphabetically or by id).

I've added a Menu Category to the sort criteria, but that doesn't have the desired effect (presumably because it's not looking within the Menu Categories).

I also tried adding a relationship to Menu Category from this view, but this doesn't seem to work either - although there are 3 options and I'm not sure which (if any) are correct:

Taxonomy term: Content using Menu Category

  Relate each Content with a Menu Category set to the term.

Taxonomy term: Menu Category (field_menu_categories)

  Appears in: taxonomy_term:menu.

Taxonomy term: Taxonomy term using Menu Categoies

  Relate each Taxonomy term with a Menu Categories set to the term.

Update: As requested, to clarify my view output, I'm expecting the Menu details including the list of Menu Categories, with this taxonomy sorted by the weight assigned to it.


texts: Installation error in Ubuntu - The settings.php file does not exist

texts:
I've installed Drupal 6\7\8 in WAMP environments for about a hundred times, but I don't recall ever having the following instllation error, which I encountered only in Ubuntu desktop 15.10, Apache2 (2.4.12), Drupal 8:

  The Settings file does not exist.

  The Drupal installer requires that
  you create a ./sites/default/settings.php as part of the installation
  process. Copy the ./sites/default/default.settings.php file to
  ./sites/default/settings.php. More details about installing Drupal are
  available in INSTALL.txt.

As the error suggest, I've tried to create it myself from the default.settings.php as the install error suggests and there was no change. I could surly import it from another Drupal 8 site in my WAMP environment, but I would thank any Drupal developer who would shed some light on why this would even happen?

Maybe it happened due to the fact that in the first time there was an install attempt, the folders permissions were not 777 (now they are - changed recursively for the site's folder only and at least temporarily).

Will thank you for your help,

Update


texts: Custom redirect on custom page for admin user

texts:
I've created a basic page with url login.

The node id is 129 and I've made a custom page--node--129.tpl.php in my theme.
On that file I've put this:

<?php print $messages; ?>
<div class="admin-login">
<?php print drupal_render(drupal_get_form('user_login')); ?>
</div>

So on this page I'm rendering the user_login form and I'm using it as a page for admin login.
How can I set redirect when admin is logging, lets say to admin/content?


texts: Can we load core css files from custom theme with yml lib?

texts:
Is there a way to provide f.e normalize.css within my custom template using a *.libraries.yml config file? Tried the following, didnt work out.
I was just wondering if this would be possbile, for it seems to be nice, while the file comes with drupal8 installation.

global-styling:
  css:
    theme:
      css/style.css: {}
    core:
      normalize-css/normalize.css: {}
  js:
    dependencies:
      - core/modernizr


texts: Is there a way to iterate on all Drupal modules on d.o?

texts:
I'd like to iterate on all contrib modules, pull their repos and extract information (such as drush commands, graph dependencies, etc.)

Is there a way to list all modules, other than scraping https://drupal.org/project/project_module?


texts: How to add a rule condition from select-list in a webform

texts:
This an export of my rule

{ "rules_webform_to_simplenews" : {
    "LABEL" : "Webform to simplenews",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "webform_rules", "rules", "simplenews_rules" ],
    "ON" : { "webform_rules_submit" : [] },
    "IF" : [
      { "webform_has_id" : {
          "form_id" : "webform-client-form-113",
          "selected_webform" : { "value" : {
              "webform-client-form-27" : "webform-client-form-27",
              "webform-client-form-113" : "webform-client-form-113"
            }
          }
        }
      }
    ],
    "DO" : [
      { "simplenews_rules_action_subscribe" : { "mail" : "[data:e_mail-value]", "tid" : "211", "confirmation" : "2" } }
    ]
  }
}

When a webform is submitted, the e-mailadres is added to the newsletter-subscriptions.
But there should be an extra condition that the submitter agrees the subscribing by checking a select-option on the webform.

when i use the data-selector data:newsletter-value or data:newsletter-key for parmeter, it is refused.


texts: How to add user role as a class while rendering a username

texts:
I'd like to style the username of certain roles differently (mainly admin roles) and I think the way to do it is to append the user roles in the class of the username.

I'd like your help with this because I've tried this but it doesn't work:

function THEME_username(&$vars) {
  foreach($vars['user']->roles as $role){
    $vars['classes_array'][] = 'role-' . drupal_html_class($role);
  }
}


texts:
i'm using EntityFieldQuery to retrieve some nodes according to some conditions.

foreach (array("important", "normal") as $type) {
  $query = new EntityFieldQuery();
  $query->entityCondition("entity_type", "node")
    ->entityCondition("bundle", "Announce")
    ->fieldCondition("field_ann_cat", "value", array($nid))
    ->fieldCondition("field_ann_type", "value", array($type));
  $result = $query->execute();
  var_dump($result);
  // Some actions
}

The first time it loops, i have my announces marked as "important" (field_ann_type).
The second time it loops, i dont have any announces marked as "normal".

I've tried to intervert them, and when i have array("normal", "important") instead of array("important", "normal") in my foreach, i can see my announces marked as "normal", but not my announces marked as "important".

Does anyone knows why?
Thanks.


texts: How to use an external jQuery plugin with Drupal's no-conflict jQuery

texts:
I'm using drupal_add_js() to load some external js:

drupal_add_js('http://jquery-accordion.googlecode.com/svn/trunk/jquery.accordion.js', 'external');

This produces 'TypeError: $ is not a function' errors because Drupal uses jQuery in no-conflict mode.

So I think the only solution is to copy the code, wrap it in this function and call it locally:

(function ($) {
  // Original JavaScript code.
})(jQuery);

I wondered whether there was a trick to still be able to directly use external js?


texts:
So far I copied all files to a new directory.

Put the site into Maintenance Mode

Then I downloaded the database and imported it into a new database I created.

Truncated the following tables in the database

cachetags
cache_*

Updated settings.php with new database name, database user and password.

Currently the problem I am having is that I where I moved it to has a different path. Before I had my Drupal site set up at /xyz/my_drupal_site and now I have it set to /abc/my_drupal_site. I believe at this point I just need to update the database with the new path and I am not sure what needs to be updated (a global replace did not seem like good idea) or if there is an admin page that I can go to to take care of it.

I found instructions for Drupal 7 and they mentioned /admin/settings/file-system but it does not appear to exist in Drupal 8.

Also I want to make sure I am not missing anything else.


texts:
I am migrating the custom code of d7 to d8 while doing I am using db_query in d7 where as in d8 I am using

\Drupal::database()->select('node_field_data', 'spmw')
            ->fields('spmw', ['id', 'created' => 'DATE_FORMAT(created, "%H:%i")'])->execute()->fetchObject();

I am getting error as

1054 Unknown column 'spmw.DATE_FORMATcreatedHi' in 'field list': SELECT spmw.id AS id, spmw.DATE_FORMATcreatedHi


texts: How do I check which of my installed modules is unsupported?

texts:
When I go to admin/modules, I get this scary warning:

  The installed version of at least one of your modules or themes is no
  longer supported. Upgrading or disabling is strongly recommended. See
  the project homepage for more details. See the available updates page
  for more information and to install your missing updates.

That sounds like something I'd like to fix!  So I click the "available updates" link, but that page tells me:

  All of your projects are up to date.

Hmmm.  I tried checking for updates with Drush (drush up) but Drush doesn't find any updates either.  How can I find which modules installed in my site are unsupported?


texts: How do you redirect anonymous users to another page without rules?

texts: Right now i want to restrict  all anonymous users to a specific page. I know you can do this with rules by setting the condition if they are anonymous have them redirected to another page. But how can this be done via code? Also I need to add exceptions to the redirect as I dont want users redirected out of user/login page, but everywhere else.


texts:
I am surprised that I am not able to find an existing Views 2 filter for aliases (paths). Seems to be such a basic property to filter results by.

I know Views can filter by argument but I need it as an exposed filter.

Does anybody know of an existing module that does it -- or at least a snippet of code that would build such a filter?


texts: Why does Drupal use the database for the cached data?

texts: Why Does Drupal put the cached data in the database? It's hard too understand it, because the database can easily cause performance bottleneck.


texts: Webform - Show/Hide fields based on day of the week selected from Datepicker

texts:
I have a little issue with a webform.
I am setting a booking system and some items are only available on some days of the week.
I have modified the date field to be a textbox with popup calendar
I need to show/ hide some field based on the Day of The Week selected ( if Day is Tuesday or Day is Friday then Show the fields, otherwise, hid them)
Any help is welcome, because with the conditionals, i can only do it based on date not on the day itself.

thank you


texts: How to allow html tag in menu in Drupal 8. For example if use home @reg used in menu title it display the html tag.


texts: How to prohibit a view for specific languages?

texts:
We've got a view like news with only English content and we're not planning to add content in other languages any time soon.
But we do have other languages (more static ones) on the page and therefore are using the language dropdown. If I'm in the view: /news.html (in English), Drupal and the language dropdown still provides es/news.html even though there are 0 news in Spanish.
How can I point the language dropdown to / in case I'm on the news view?
(I could do Drupal redirects I reckon - but maybe there is a smarter solution which solves the root, not the impact?)


texts: How can I easily verify if a core or module update has not broken anything?

texts: When I update drupal core or even a couple of modules, I'm always afraid if something breaks. What easy way is there to test a site if anything has broken? Its not feasible for me to test a site that has over 1000 pages.


texts: HTTP exception not giving a Json Response in custom module file

texts:
I am using the Drupal REST module. I have a custom module file I have created and it has a hook below

function magri_rest_user_presave($account) {

   if (isset($account->field_region->value)) {

        $taxonomy_query = \Drupal::entityQuery('taxonomy_term');
        $taxonomy_query ->condition('vid', "region")
            ->condition('name', $account->field_region->value);
        $tids = $taxonomy_query->execute();

        $tid = array_values($tids)[0];

        if($tid){
            //set taxonomy ref field on user entity
            $account->field_region_tax->target_id = $tid;

        }else{
            throw new NotFoundHttpException(t('Region not found!'));

        }
    }

The exception is thrown but it only gets printed in the logs:

Symfony\Component\HttpKernel\Exception\NotFoundHttpException: Region not found! in magri_rest_user_presave() (line 61 of /var/www/html/modules/custom/magri_rest/magri_rest.module).

Symfony\Component\HttpKernel\Exception\HttpException: Internal Server Error in Drupal\rest\Plugin\rest\resource\EntityResource->post() (line 198 of /var/www/html/core/modules/rest/src/Plugin/rest/resource/EntityResource.php).

I want something like below to be returned to the client:

{
    "error":"Region not found!",
}


texts: How do I add a custom textarea into the checkout screen?

texts:
I want to add 'Notes' textarea for adding addtional message by customer while placing the order.

I have added additional textarea in 'Order types' page (/admin/commerce/config/order-types/default/edit/fields). It is displaying in order page but not in checkout page.

Example: Customer is placing an order for Toys and they want to add message saying 'Please deliver in 2 days..'

Edit: I have seen same question in Drupal 7. But there is no 'Commerce Fieldgroup Panes' module in Drupal 8.


texts: Assign new role to user after puchasing a product

texts:
I installed and configure Drupal commerce successfully in Drupal 8 and now I want to change the role of a user when he/her purchase a product. E.g I have a product type test and user role paid now when the test user purchase a product I want to assign the paid role to this user after successful purchase.

I did this in Drupal 7 via rules module but how in Drupal 8.


texts: Pull content from production to staging server

texts:
I have a setup that consists of a Drupal 8 instance on my localhost, a staging instance on a develop server and a productive version on a production server. Initially, I was co-designing the theme, the configuration and so on on my machine. But now, the site is live.
For configuration changes, I can update my local instance and export the configuration. Pushing this to my develop branch in my git repository automatically triggers a deployment on the develop server. Creating a new release triggers a deployment on the production server.
Now this situation: Content editors create new nodes on the instance on the production server. On some piece of the new content, they discover an issue and want a fix for that and maybe even want to review this fix on the develop instance.
I already have such a neat deployment for the configuration, so I really want to avoid copying databases around. For images, there's a module, that can replace local static files with links to the productive version. What would be the equivalent solution for the content in the database?
What might be a useful flow for the case that there's no better automation:

I do a composer update on my local machine
The content from develop gets pulled to my local instance
I commit my changes and pull them to the develop instance
The develop instance pulls content from the productive instance
The develop instance reads my new configuration

It would be even better if there would be some API magic that enables my instances on localhost and develop to read the content directly (and cache it).
So, is there some API magic around? Or do I have to write scripts and everything to pull databases from server to server?
Additional requirement: I did most of the work so far and have all the administrative rights, but in the future, this should work for additional developers who should not need to login onto a server.


texts:
I'm looking for a module for Drupal 7 that let's users on a drupal site request invitations to meetings.

So for example, Bob can send a message invitation to Alice and George asking for a 3:30 pm meeting at Starbucks Coffee at the corner of 1st Street and 2nd Street.  THen Alice and George can either accept or decline the invitation.  Bob will have a feed somewhere on his profile page showing what appointments he has coming up.

Is there a module that will do such things?


texts: How to terminate a batch when an error occurs

texts:
I've read this: http://api.drupal.org/api/drupal/includes%21form.inc/function/batch_set/6 and through the source code, but I cannot see how a batch operation can flag that an error has occurred to show the error message.

I can set $context['finished'] = 1.0; to end the batch, but I cannot see how to set $current_set['success'] to FALSE to abort the batch and show the error message to the user.

How is this done? Is there a good example somewhere?


texts: How to enable WYSIWYG in a text field summary?

texts:
I have a body field (Text field with summary) with WYSIWYG CKeditor enabled.

However, the "summary" part of the field lacks a WYSIWYG editor.
How can I enable it?


texts: Block plugin's render array values ending up in $variables['content'] instead of $variables

texts:
I've got a bizarre issue where my the render array from my block plugin's build() method doesn't seem to be properly interpreted by the template. I've got the following setup.
function my_module_theme(){
  return [
    'block__my_module__user_header' => [
      'render element' => 'children', // also tried without this
      'variables' => [
        'tabs' => NULL,
        'user' => NULL,
      ],
    ],
  ]
}

and my block plugin class
public function build() {

  $render_array = [
    '#theme' => 'block__my_module__user_header',
    '#tabs' => $this->getTabs(), // returns an array of data to handled in twig
    '#cache' => [
      'contexts' => [
        'route',
        'user',
      ],
    ],
  ];

  if ($user = $this->getContextValue('user')) {
    $render_array['#cache']['tags'] = $user->getCacheTags();
    $render_array['#user'] = $user;
  }

  return $render_array;
}

But then, when I inspect the variables in theme_preprocess_block(), all of that render array information from build() is sitting in $variables['content']. Same in the actual twig template, and same result if I remove ['#cache'] from build(). I'd expect to be able to access {{ tabs }} directly, but instead the data is sitting in {{ content['#tabs'] }}. Aside from that inconvenience, it also means that any cache tags/contexts I try to set in build() don't end up in the actual render array so they're completely ignored, which is a problem because the "tabs" as rendered in twig are dependent on this context.
I'm completely perplexed, as the same pattern works fine for hook_theme/block plugins in some of my modules, but this issue crops up in other modules.


texts:
in my code i need to use db_merge , that works well, but I'm looking for a way to show message when db_merge do not insert a record (to avoid duplication) the message would be : "you can't add this record because it exists in the db".
The best way is try/catch, but it seems to work for db_selct,db_insert,db_update but not for db_merge.


texts: Which hooks can alter the display of a node?

texts:
I have a custom content type in Drupal 7. It consists of a fixed number of images. I would like to make it so that when its viewed, it comes up as a form. Each image would have a text area underneath, and when a user hits 'submit', the text they entered are displayed below each image.

We're not going to store the text that they enter for the nodes. It's just going live for that form submission.

What hooks can I use to alter the display and functionality of my content type?


texts: How to index content from the Feed Aggregator?

texts:
I use the Feed Aggregator to create this list of titles and snippets of articles from The Economist. http://www.smagula.org/?q=aggregator/sources/1

I would like to be able to search for a term like "Morality and the brain" and see the recent Economist article appear in the results.

I have dug around on Drupal.org, and have found several others who are seeking the answer to this question here http://drupal.org/node/872686, but no answers or hints.

Is it just a matter of configuring the script which indexes content to go to the right directory? If so, where would I find that script?


texts:
I am needing a solution to add an event to a calendar, and the events are also displayed on a web page in order of the next event.

Similar to this Wordpress plugin:
https://wordpress.org/plugins/the-events-calendar/screenshots/

Any help is greatly appreciated.


texts: Why does #triggering_element pick the wrong element?

texts:
I'm triggering an ajax-enabled button on a form but Drupal's setting $form_state['#triggering_element'] to the wrong element.

The button is a child of a #tree and is identical to other buttons in other tree-ed structures, except for its parents. But I thought this was the point of #tree.

Looking at the drupal code in form.inc it's clear that Drupal only goes on the #name property to identify the triggering element, which is automatically set to 'op' for buttons. This seems to have no idea about trees or the element's parents.

The rather scant and very old docs for tree state:

  #parents is used to create the name/ID of the form element itself.

But my button element's names are not being set to anything other than 'op'. I'm creating the buttons in a #process function for the parent element.

Example code

$form['group1'] = [
  '#prefix' => '
group1',
  '#suffix' => '
',
  '#tree' => TRUE,
  'trig' => [
    '#type' => 'submit',
    '#value' => 'ajax go',
    '#ajax' => [
      'callback' => 'mymod_ajax_callback',
      'wrapper' => 'foo',
      ],
  // Other elements part of group 1...
  ],
$form['group2'] = // The same.

A work-around is to code creating unique names for every one of these elements, but I feel I might be missing a trick/nuance?


texts: Display subscribe to group on access denied page

texts:
I am using Drupal 7.25 (I need to update to 7.26) and organic groups 7.x-2.4.  I currently have public and private groups working.  I have two users (admin and a normal user).  I have a menu tab that opens the og list (/og-list) view which lists all groups (public and private).

When logged in as a normal user if I click on a public group it shows a subscribe to group link.  That's great.  However, if I click on a private group it gives me the Access denied page without a subscribe link.

I would like to have any normal user be able to click a private group and have it display a link to subscribe.  Any help would be greatly appreciated!


texts: Request to reset the password ask current password

texts:
My problem with Drupal is that when I choose "Request new password" and submit, it sends me a email with a link

  example.com/?q=user/reset/69/1376903015/wiUMZxM27RkYYAAr6zHZfqz6BH4sVMHDAfGoaeZT-Cc

I can login to account by clicking over that link. When I do the same it logged in me and redirects me to user edit page

  example.com/?q=user/69/edit&pass-reset-token=-yS11phdH8HuId-5wpaKrdI6KyWOtfV098jZ5mXb_C0

Now I want to reset my password but when I click on password tab example.com/?q=user/69/password,  it ask me my account's current password. But I (may be a user) don't know current password . So How can I change password?

One point I noticed that when I put pass-reset-token on the password change URL like this

  example.com/?q=user/69/password&pass-reset-token=-yS11phdH8HuId-5wpaKrdI6KyWOtfV098jZ5mXb_C0

I can reset my password without putting current password.

It means that token does not apply on the password tab link. Do I need some module or change in core user module to rectify this problem?

WHAT I DID FOR TIME BEING / TEMPORARY SOLUTION

I edited file : modules/user/user.pages.inc
    //on line Number 142 updated

drupal_goto('user/' . $user->uid . '/edit', array('query' => array('pass-reset-token' => $token)));

to this

drupal_goto('user/' . $user->uid . '/password', array('query' => array('pass-reset-token' => $token)));

Changed "edit" to "password"

Now my goal is complete. I know it not a good solution.

Any suggestion or answer would be appreciated.


texts: CronJobs - I have two cron jobs but only one works

texts:
I have created 2 cron jobs on my server(ubuntu), but only one works.

*/5 * * * * curl -s http://www.example.com/cron.php?cron_key=TzVesnZuNqR4mkjv_LgBemUV-oYvsfYalyHOfDtL4cc

*/5 * * * * curl -s http://www.example.gr/cron.php?cron_key=OrrbXhtfSEZ2NI7BlHjAPRtMT_ENAKaz68iH86Kl5wI

In my log file at /var/log/syslog there is an error stating "Cron could not run because an invalid key was used." but my key is correct. When I launch manually, it runs the cron successfully.

I can't understand why this is happening. Is there any solution?


texts: Trying to use variable to pass a view argument/parameter

texts:
I'm currently in the middle of trying to figure out a way to pass the value from a variable to be used as parameter/argument for my drupal view.

I have a contextual filter that currently configured on my drupal view to output only nodes based on the taxonomy term/ID. Instead of explicitly manually setting the parameters below.

{{drupal_view('view_one', 'block_1', 212, 210)}}

Is there a way I could use a variable to pass the parameters to my drupal view

 % for tags in node.field_filter_tags %}

    {% set tagid = tags.entity.id %}

{% endfor %}

{{drupal_view('view_one', 'block_1', tagid)}}

I tried it but it seems to show duplicates.


texts: Different front page node depending on logged in?

texts:
How would I go about displaying a different front page node depending on if the user is logged in or not.

For example when a user is not logged in, you would be viewing the About Page.
When a user is logged in, you would be viewing your user profile page.


texts:
I have customized the user-edit page in Drupal7 using user-profile-edit.tpl.php.  I have also added reCAPTCHA to it using the reCAPTCHA module.

I would also like it so that there is an "I agree to terms and conditions" checkbox, and only when the user clicks this check box should the information be saved (i.e, it should be a required field).

How can I do that?

I found the Terms of Use module and the Legal module but they appear only on the registration form, whereas I want it in user-edit page (form). I thought of adding a field to the account settings for users but I am not getting any desired field for that.

Any suggestions?

Following the answer below, I was able to do some progress. However I want it to be a required field and if I click on that in its field setting then automatically it is shown on the user registration page which I do not want .


texts: Passing a variable into a views block via hook_preprocess_views_view

texts:
I have a block view for a commerce cart, and I'd like to add the cart quantity into the block. This is what I've tried so far:

// In template.php
function mymodule_preprocess_views_view(&$variables) {
  if ($variables['name'] === 'commerce_cart') {
    $variables['quantity'] = 'x';
  }
}

// In block--views--commerce-cart.tpl.php
print $quantity;

The template file doesn't seem to know about the newly added variable, however, because I assume the theme function hasn't defined that unknown value as a possibility.

Is there a simple way to get this value into the template file? Thanks in advance!


texts:
I am having problem creating slideshow with DDBlock

Created a new block 'DDBlock1' from 'admin/structure/ddblock'
    Cannot configure Block: Selected "Input Type" as "Content Type" but under "Content Type" drop down box, only option is "None" (as shown)

I am stuck here - how do I direct DDBlock to pick images from an Image field in a content type I have??


texts:
I have a vexing issue. I'm using the equal heights module to ensure two blocks are of equal height on the home page of my site. Inside each block, at the bottom of each block, is a read more link. I need the read more links to be spaced so that they are both at the bottom of each block, positioned identically on the page (within their respective blocks). When I'm logged in to the site as an ADMIN the CSS I'm using is working fine (see first screenshot below for the orange read more links showing on each side). However, when I log OUT of the site (or login as another user) and view the home page the 'read more' links are collapsing together at the top of the page in the middle for some reason (see the second screenshot). They are using the exact same CSS so I don't know why it's doing this.

Note: I tried giving another user all the same permissions as the admin to see if that fixed it and it did NOT fix the problem, so I don't think it's a permissions issue.

Ok, so here's the CSS (for one of the blocks - they are the same) I'm using to position the elements:

#block-views-featured-resource-block .views-field-view-node {
position: absolute;
margin-bottom: 8px;
padding-bottom: 5px;
text-align: center;
left: 20%;
width: 50%;
bottom: 0;
@media screen and (max-width: 959px) {
    position: absolute;
}
}

And here's the page--front.tpl.php file:

<?php if ($logo): ?>
    <a href="<?php print $front_page; ?>" title="<?php print t('Home');
?>" rel="home" id="logo">
    <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />

<?php endif; ?>
<?php print render($page['top_navigation']); ?>
<?php print render($page['user_menu']); ?>

  <?php /** print $breadcrumb; */ ?>

  <?php print render($page['pathfinder_header']); ?>
  <?php print render($page['introduction']); ?>
  <?php print render($tabs); ?>
  <?php print render($page['help']); ?>

  <?php if ($action_links): ?>

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

  <?php endif; ?>

  <?php print render($page['featured_resource']); ?>
  <?php print render($page['hp_video']); ?>
  <?php print render($page['whats_new']); ?>

  <?php print render($page['find_your_path']); ?>
  <?php print render($page['search_library']); ?>
  <?php print render($page['browse_library']); ?>

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

  <?php print $feed_icons; ?>

The items in question are within the 'feat-container'  in the page.tpl above.

Anyone have ideas why when I'm logged in as an admin user they work but not for any other user? It makes no sense to me. I tried clearing the cache...that didn't help. I flushed with drush. That didn't help either.


texts: Multiple forms one page always submit with the values of the first

texts:
I have got a form defined that is displayed multiple times on a single page. For each instance of the form, different values (node ids) are inserted into the hidden fields, which seems to be there once the form is rendered.

However, when I submit any of the forms on the page, the submit handler always gets the values that have been inserted for the first instance and I can't seem to get hold of why this is happening.

One thing that I noticed though is that all of my forms have the same form_id, form_token and only the form_build_id changes.

Any idea why this is happening, I can't find a solution to this problem anywhere.

Thanks a lot.

Code:

I'm attaching the form to the nodes in hook_node_view like this:

$node->processed['add_collection_form'] = drupal_get_form('add_to_collection_form', $node->nid);

when I try to do it in hook_node_load drupal always complains about the memory limit in PHP even though I have set it to a generous 1GB, which is pretty weird.

The form on the page are rendered the standard way:

print drupal_render($node->processed['add_collection_form']);

in node--.tpl.php


texts: Show "Login or Register to do something" link for anonymous users on all inaccessible forms

texts:
Some modules will show forms in a page or tab for roles with the relevant permissions, and these forms don't show up for roles without the relevant permissions by default.

So, my question is: Is there a universal and configurable (preferred) way to show Login or Register to do more link in the positions of these forms, instead of simply not showing the forms at all. And It is best to show up the Login or Register form in a modal form.
It seems Redirect 403 to User Login and LoginToboggan cannot achieve my goal.


texts: Problems in recovering the fields with php

texts:
How do I retrieve a field without first being written its title? Now I'm doing so: print render ($ content ['field_text']);
I tried to recall the title of a node: print render ($ content ['title']);
but this is not the way


texts: i am got some trouble with AJAX in Drupal 8 Form API.I use few fields with #states so that the value of one field depends on another.And in the end of form i need to pass field value  to another field.And when i send a value using AJAX the whole form will reload and all field's is cleared.Can someone give some advice on how to handle this?


texts: Moving Drupal database from MySQL to Oracle

texts:
I've developed a website with Drupal 7 running on standard PHP/MySQL server. Now there's a need to move it to server with Oracle database. While I managed to set up testing environment with a fresh Drupal 7 install and all my modules, to check if they are working with Oracle DB, now all data from original development version needs to be moved to new server.
First option was to use Oracle SQL Developer "Migrate" function, but I ended up manually copying tables from repository to Oracle DB and in the end it failed to function.
Next thing I tried some migration tools. DBTNG migrator failed, because production server has no MySQL or SQLite extensions, so it was impossible to import anything from original database. Backup and Migrate module works only with MySQL. Other modules were migrating limited number of data types or didn't support i18n.
There's a third option of manually recreating all content types, menus, taxonomy, views and other elements, but in the end it would be very convenient to have a system for migration from MySQL to Oracle database.
What needs to be migrated: custom content, fields, blocks, menus, taxonomy, views and all translations.
Does anyone have any ideas how to achieve this task? Preferably using open and free software, but commercial products are an alternative, if they work fast and efficiently.


texts: I am using the Feedback Module, and I need to add an email field to the feedback form. How can I make the necessary edits to the Feedback Module in such a way that they stay when the module is updated?


texts: Set value of field based on GET param for anonymous users

texts:
I ran into a strange problem. All forms are cached for anonymous users even if there is a token present in the url. But I need that token to store a "value" field type on a form. Because the form is stored in cache, it does not verify for that get param and set the value accordingly.

I tried using an "after_build" function but that is also not triggered.

Is there a way I can use the GET param in my code? Or is there a way I can disable caching only for this form?

Thanks.


texts: Make 'Full HTML' the default text format

texts: How do I make Full HTML the default text format for the administrator? Currently it is Filtered HTML.


texts: Translated menu items with menu_build_tree in drupal 7

texts:
I'm having an issue with menu item translations with custom rendering of menu tree.

I see all languages displayed at the same time whenever I change the current language. Items have translation set it works if I enable the built-in main menu block but not with my code.

I've tried adding 't($string)' and set 'language' in params; but no luck.

What am I doing wrong here ?

I have the following code in template.php for my theme :

function theme_preprocess_page(&$variables) {

    $params = array('max_depth' => 3, 'language' => 'fr');
    $menu = menu_build_tree('main-menu', $params);
    $main_menu_tree = menu_build_tree('main-menu', $params);
    $html = '
';

    if (arg(0) == 'node' && is_numeric(arg(1)))
        $nodeid = arg(1);

    foreach ($main_menu_tree as $item_menu) {//for each main element
        $isSecondLevel = isset($item_menu['below']) && !empty($item_menu['below']);
        $active = '';
        if ($item_menu['link']['link_path'] == 'node/' . $nodeid) { $active = 'active';
        }
        if ($isSecondLevel) {
            $html .= '
';
        } else {
            $html .= '
';
        }

        $html .= '';
        $html .= $item_menu['link']['link_title'];
        $html .= '';

        //is there any sub elements to display
        if ($isSecondLevel) {
            $html .= '
';

            foreach ($item_menu['below'] as $item_submenu) {//for each sub element
                $isThirdLevel = isset($item_submenu['below']) && !empty($item_submenu['below']) ? 'main-menu-third_level' : '';

                $html .= '
';
                $html .= '';

                $html .= t($item_submenu['link']['link_title']);

                $html .= '';
                $html .= '
';
            }
            $html .= '
';
        }
        $html .= '
';
    }
    $html .= '
';
    $variables['main_menu_html'] = $html;
}


texts: The geographic data (latitude, longitude) isn't saved in content

texts:
I have installed the Geofield module, created a new content type, and added a geofield field.
When I start to add nodes with latitude and longitude, those values aren't saved. Editing again the same node doesn't show any value for latitude and longitude.
What I'm trying to do is to install the Leaflet module, so I need to save the values first with the Geofield module.


texts:
I have a lot of nodes that need to get their input format changed - I could do that by hand, but then I won't be done before Christmas 2014.

Where is Drupal storing that information? How can I change the input format in a split second, with an SQL query?


texts: How do I include a custom JavaScript file in a module?

texts:
I want to include a custom JavaScript file in a module using the following code.

function profile2_form_user_register_form_alter(&$form, &$form_state) {
  drupal_add_js('http://localhost/prf2.js', 'external');
}

I then add scripts[] = js/prf2.js in the .info file, but it throws this error.

  Warning: file_get_contents(js/prf2.js): failed to open stream: No such file or directory in drupal_build_js_cache()


texts:
Objective: Once client update any form's field, it will update database. (Will not need submit button to update the form). Example: I change name field value from Peter to Tom. It will automatically update database.

    function ajaxFunction(getName){
    var ajaxRequest;
        var getVariable = "name="+getName;
    try{
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                alert("Your browser broke!");
                return false;
            }
        }
    ajaxRequest.onreadystatechange = function(){
        if(ajaxRequest.readyState == 4){
            var ajaxDisplay = document.getElementById('name');
            ajaxDisplay.value= ajaxRequest.responseText;
        }
    }
    ajaxRequest.open("POST", "name.php", true);
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    ajaxRequest.send(getVariable);
}

</script>

I create a file call name.php and load the file to /sites/all/modules/custom/name.php

I can send the value $_POST["name"]. Which mean everything is good. I think....

My problem is name.php seem cannot connect to database. I use db_select to do the testing and I dun get any result. I predict there is php error and I believe db_select is not recognized.

  $query= db_select('particular', 'n')
   ->fields('n')
   ->condition('nid', '111111','=');

   $result=$query->execute();
   foreach ($result as $record) {
      echo $record->name;
   }

May I know how to meet my objective?


texts: Add a link into a drupal header and table

texts:
I am currently in the process of creating a free sports betting site, and I would be able to manage the matches. For this, I create a table with the data from my table, but I would add a column to manage the matches, to remove them or modify them. Outside, I do not like to add a link in the header, for exemple:

 l(t('Modify'), 'link/modi');

Here is my actual code:

    function get_rencontre_all(){

    $header = array(
    array('data' => 'journee', 'field' => 'journee' ),
    array('data' => 'eq1', 'field' => 'eq1'),
    array('data' => 'eq2', 'field' => 'eq2'),
    array('data' => 'stade', 'field' => 'stade'),
    array('data' => 'date', 'field' => 'date'),
    array('data'=>'Opérations', 'colspan' => 1),
    );

    db_set_active('sport_db');
    $query = db_select('rencontre', 'r')->fields('r');

    $sorter = $query->extend('TableSort') //création de l'objet TableSort
    ->orderByHeader($header); //détermination du trier
    $result = $sorter->execute(); //exécution du TableSort
    db_set_active();
    return $result->fetchAll(PDO::FETCH_ASSOC); //revoie d'un tableau de lignes

}

function modulesport_page_rencontre_manage(){
    $rows = get_rencontre_all();
    //header qui définit les colonnes et les champs associés
    $header = array(
    array('data' => 'Journée', 'field' => 'journee' ),
    array('data' => 'Equipe domicile', 'field' => 'eq1'),
    array('data' => 'Equipe exterieur', 'field' => 'eq2'),
    array('data' => 'Stade', 'field' => 'stade'),
    array('data' => 'Date', 'field' => 'date'),
    array('data'=>'Opérations', 'colspan' => 1),

    );

    $page_array = array(
    'titre' => array(
    '#prefix' => '<h1>',
    '#suffix' => '</h1>',
    '#markup' => 'Liste des rencontres',
    ),
    'tableau' => array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows'=> $rows,
    ),
    );
    return $page_array;

}


texts: How can I create a collapsible block from page content using .tpl file?

texts:
I'm using the FlickrGallery module - http://drupal.org/project/flickrgallery and its basic functionality is pretty great - it automatically pulls in photosets from the Flickr account and displays everything using shadowbox, which means it'll work on iPhones, iPads, etc. Once the user uploads a photoset on Flickr, it simply appears on the site - no fuss, no muss. And it's also domain-sensitive, so different subsites can have different galleries. Like I said, pretty great - except for one major issue:

The module works outside of Drupal's content system - it simply pulls in a page and everything's hardcoded. The problem is that the page displays all photosets and there's no way to limit the photosets displayed, by paging or otherwise.

I want to create a multimedia page with collapsible blocks for photos and video - the video is no problem using Collapsiblock, but with a large number of photosets, the user will need to scroll down to the bottom of the page to see all available content.

Here's my question: How would I place the page content into a collapsible block using the module's .tpl file? Any ideas greatly appreciated - this is my first post on Drupal Answers!

Here's the existing template (with a few mods):

<?php
/*
 * Available vars:
 * - $description: Containing the description of the FlickrGallery module you provided at the settings page
 * - $albums: Array that contains the image and titles with links
 */
?>

<?php print $description; ?>

    <?php foreach ($albums as $key => $album) : ?>

        <?php print $album['image_link']; ?>

        <?php print $album['title_link'];  ?>

<?php print $album['total'] . t(' Pictures'); ?>

    <?php endforeach; ?>

It would be great to call the code for collapsiblock - thanks for any ideas here!


texts: How to import Nodes and Node Location data using Feeds module?

texts:
I would like to use Feeds to import Node Location data together with Nodes themselves.

Each node of a selected content type is or is not assigned to a location.

How to do this ?


texts: Prevent JS from showing on specific pages

texts:
I've got a Javascript that I'd been able to post on every page using Drupal_add_js, and everything was fine till my client's needs changed.

Now I need to show that same JS script on every site page except one node type, and one specific URL and I dont know how to do this.
I'd prefer to do it the Drupal way rather than use JS Injector if I can.

Any help is appreciated!
Thanks
Steph


texts: Providing "translations" based on region rather than language

texts:
We are using FAPI to create some custom forms (actually extending the registration form) and want to provide different form labels based on a Country of Residence. For example if in Australia they will be asked to enter "City/Town/Suburb" but if they're in New Zealand the label will be "City".

Is this something that can be done and managed with Drupal's base translation modules? My understanding so far is that most of this functionality is at the language level rather than "regional" settings. If not, what would be a plan for managing this in a maintainable way?

Thanks.


texts: Auto create nodes from external RSS source

texts:
The scenario I am trying to fulfil is the automatic creation of Drupal nodes from an RSS list.

At the initial execution of cron, the module, custom/contributed, should parse some remote RSS and for each entry in the RSS a Drupal node with matching title, body etc is created.

The next hour when cron fires, any matching content previously created is ignored. Only when there is a new entry in the RSS should new node(s) be created.

Is there an existing module for doing what I have described above?
OR,
Can anyone direct me on how best to implement such a service?

Thanks.


texts:
I need to store "time" in a content type. The time is actually duration (how long it took people to perform various tasks), with the time varying between a few minutes to several days.

Is there anything already out there (Date doesn't seem to cover it)?

If not, what's the best way to create this?

Ideally I'd like dropdowns for days, hours, minutes, seconds, tenths.

It seems to make sense to store a computed value in the database (total seconds, rather than save everything in five separate fields. Are there any good tutorials on doing this?

I assume I then use a field formatter to break out 300.3 seconds into 6:00.3 or whatever format I want?


texts: How to show labels of matching fields in a search-api view

texts:
I have a view that displays search-api results. Is it possible to include a list of the labels of the fields where a match was found?

E.g. when searching for Ford:

Henry Ford: Title, Body
Fordissimo: Title
Apu Nahasapeemapetilon: Body


texts: How can users write a bio on their profile page?

texts:
I'd like my users to be able to write a bio on their profile page. Therefore, I added a long text field called 'Bio' to the user accounts. I created a view that shows the user's bio and wanted to add a link to only let the user edit his/her bio. Unfortunately, I only found a link that redirects the user to a page where he/she can edit his/her whole profile - which isn't exactly what I want.

Did I miss something?

I tried to solve this in another way. I created a content type called 'Bio' and a rule that creates a 'Bio' node with title My bio automatically when a user is created. Users don't have permission to add another bio, but they can edit their own 'standard' one. Now, I don't want the title field to be displayed on the edit form, because I'd like the titles to remain My bio.

How can I do this?


texts: How to add only "Add to Cart" Button in a view

texts:
I have a view with all my product. My view display is TABLE. I'll want add a column where insert only "Add to Cart" button.

How can i do it?

Thanks


texts: How many different ways are there to create a "page"

texts:
By page I mean what's served by a given route/url. Trying to understand all the options so I know what I can combine (e.g. create a View, and use a render alter hook to add a form at the bottom).

Here's my incomplete list:

Controller
View
Form
Backend creation of pages, articles, custom content types.
Contact Forms
?


texts:
I Use Drupal 8.8 with Webform 8.x, in a simple webform with a select list element and a text field element, I need to update a text field element with values resulting from database queries when the user chooses an option from the listbox.

I would like to accomplish this with a PHP code in a custom mymodule. How can I intercept the user's action when selecting a value from the select list?

Besides intercepting the event I also need to know the content of the choice that the user has made on the select list.

How can it be done? Can anyone give me an example?


texts:
By default the navigation in books is an unordered list:

Vegetables

Carrots
Tomatoes

Fruits

Apples

Is there any way to make it an ordered list?

Vegetables

1.1. Carrots

1.2. Tomatoes
Fruits

2.1. Apples


texts:
When I create a node of content type Proposal like this:

I can add images, paragraphs, ... . But it looks like this on the detail page of the node:

No image, no paragraphs, ... . What could be the problem of this?

I'm using the Filtered html text format. When I check the html of the paragraph there is no image, nothing. Just text ... .

These are my settings of context filter filtered html:


texts: How to select an address field city from dropdown list?

texts: I am using Address field module to populate address. A requirement needs to limit cities to a particular set, and also countries to particular set too. so I would like to present a set of cities in drop down list based on country selection. From the answer here I could figure out that something has to be done in plugins but I could not figure out what exactly. If anyone has sample code for city drop down in Address Field modules's plugins it would be of great help!


texts:
After months of displaying without a glitch, I can no longer see the profile2 page. The sub-tabs (Accounts and Profile) are visible but it is the account page that displays regardless of the tab that is selected. The field forms of the Profile2 page have become inaccessible and, therefore, can no longer be edited.

Creating other profile types displays the tabs but, below, it's still the fields of the account page that display. The url changes as the different tabs are selected however (such as ...user/1/edit for the account page and ...user/1/edit/main for the profile2 page.)

Any idea of what's going on?

Thanks. :)


texts:
Is there a way to search for files attached to taxonomy terms ?

I mean I have a vocabulary, with some terms. Each term have some files attached (Field) (Ex: example.pdf, Image.png).

I want my search to show that files, for example::

Search result:

--- Example.pdf

--- Image.png

Is that possible ? I don't want to search file contents, I just need filenames and path's shown on the search page.

Thanks and sorry for my english.


texts: Rules token one-time-login-url is showing up empty

texts:
I have a rule that, after submitting a webform, a user gets created and then sends two emails to that user.  One saying their form data is being looked at by someone for review before they get a certain role, and another that gives them the one-time login url.  The problem is the that, while the rule works and both emails get sent, the login url is not displayed in the second email.

{ "rules_application_submission_affiliate" : {
    "LABEL" : "Application submission: Affiliate",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "webform_rules", "php" ],
    "ON" : { "webform_rules_submit" : [] },
    "IF" : [
      { "webform_has_id" : {
          "form_id" : "[form-id:value]",
          "selected_webform" : { "value" : { "webform-client-form-101" : "webform-client-form-101" } }
        }
      }
    ],
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "user",
            "param_name" : "\u003C?php echo $data[\u0027components\u0027][\u0027your_username\u0027][\u0027value\u0027][0]; ?\u003E",
            "param_mail" : "\u003C?php echo $data[\u0027components\u0027][\u0027your_e_mail\u0027][\u0027value\u0027][0]; ?\u003E"
          },
          "PROVIDE" : { "entity_created" : { "new_user" : "New user" } }
        }
      },
      { "entity_save" : { "data" : [ "new-user" ] } },
      { "user_unblock" : { "account" : [ "new-user" ] } },
      { "mail" : {
          "to" : "[data:your_e_mail-value]",
          "subject" : "Thank you for your application!",
          "message" : "Your application is being processed.  You will receive another email when your account is ready for activation.",
          "language" : [ "" ]
        }
      },
      { "mail" : {
          "to" : "[new-user:mail]",
          "subject" : "Your account is ready!",
          "message" : "You may activate your account by going to this link to set your password:\r\n[new-user:one-time-login-url]",
          "language" : [ "" ]
        }
      }
    ]
  }
}


texts: Drupal 7 at shared hosting behind Cloudflare

texts:
I use Drupal 7 at a share hosting account (with apache server) and I use Cloudflare.com CDN.
Cloudflare ip token (at webform etc) shows cloudflare IP instead of visitor's original IP.

At settings.php I put

$conf['reverse_proxy'] = TRUE;
$conf['reverse_proxy_header'] = 'HTTP_CF_CONNECTING_IP';

These did not seem to work.

What seems to work was:
the instructions given by cloudflare for PHP

if ($_SERVER["HTTP_CF_CONNECTING_IP"]) {$_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"]; }

or alternatively what was written at drupal cloudflare module (which is only for drupal 6 and not 7)

$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];

The questions are

why the typical drupal settings ($conf['reverse_proxy_header) did not work, and how can I make them work?
If not, then which of the 2 solutions that worked for me is more secure or better?
Should I setup $conf['reverse_proxy_addresses'] with cloudflare ips,
or it's useless since $conf['reverse_proxy_header'] does not work
anyway?


texts: how to name templates for same content types

texts:
I have a Content Type machine name as "aktionsblock_oben" and made some content and get the Content ID as 33 for this one. Now I can use template name as page--node--33.html.twig, but what if I create new content like this where I get another ID? The page--node--33.html.twig won't fire.

My try page--node--aktionsblock_oben.html.twig or aktionsblock_oben.html.twig was a failure.

Any suggestions


texts: Using contextual filters with multiple taxonomies plus dynamic paths

texts:
I have a content type, FAQ, which has the Title, Body, and Related AP Course(s) fields. The last is a node reference field, where the target is a AP Exam node.

I'd like to create a view page that follows the path URL pattern of the AP Exam content type which is [content-type]/[ap-exam-category]/[ap-exam]. The FAQ URL would be [content-type]/[ap-exam-category]/[ap-exam]/faq.

How can I create the contextual filter and path for this view?

So far, I've tried the following configuration.

Contextual Filters

Content: AP Exam Category

Content: Related AP Course(s)

Relationships

field_ap_exam_category: Taxonomy term

Path: ap-exam/%/%/faq

No results are returned.

I've included the configuration for a most accurate representation.


texts: Allowing users to 'follow' taxonomy terms. Then creating a view which displays a list of nodes which are assigned the 'followed terms'

texts:
I'm looking for the recipe which emulates a feature from the popular tech blog: Mashable.com

Here's what I'm looking for:

Nodes are assigned taxonomy terms.
Users may view a node, and see the taxonomy terms which are assigned to this node.
Users may 'follow/subscribe' to each taxonomy term assigned to this node.
A custom view (called "My Custom Stories") will be configured, for each user, which displays a list of nodes which are relevant to the taxonomy terms to which he subscribed.

For example:

A node X is created which is assigned the terms 'Politics', 'Apple', and 'China'.
User A follows/subscribes to 'Politics', while User B follows 'Apple'.
User A's 'My Custom Stories' view will only contain a list of nodes which are assigned the 'Politics' taxonomy term, while User B will see a list of 'Apple' nodes.

I'm particularly interested in the 'taxonomy term follow' modules required for this recipe, as well as how the 'Custom Stories' view will be configured.

I'd appreciate any tips. Thank you!


texts:
How do I allow users send emails to the other users?
What module can I use to allow users to email each other?


texts: hook_form_form_id_alter doesn't save data by default

texts:
I use hook_form_form_id_alter() to edit the user_form. I'm creating some checkboxes and textfields. Thats working fine. I also can output the values, when clicking the submit button.

But it doesn't save the values by default.

How do I save my values?


texts: what determines what user id to which a new user account will be assigned? On my site, Drupal 7.37, new user accounts are assigned to non-sequential user ids. All new users now have user ids well above 3500.


texts:
In my sites/default/settings.php I changed:

$config_directories = array(
    CONFIG_SYNC_DIRECTORY => 'sites/default/config-sync',
);

I created the folder config-sync in sites/default/
When I do drush cex I get this message in my Terminal window:

  Choose a destination.
  [0]  :  Cancel
  [1]  :  sync
  [2]  :  staging

What do I have to do? Because I want all my configuration files in sites/default/config-sync because this directory is tracked by Git.


texts: Drush php-script | Drupal functions such as node_load() are not being found

texts:
I successfully installed Drush on Ubuntu 12.04, and I created a script containing the following line.

print_r(node_load(10));

I am calling the script with drush php-script --uri=http://localhost myscript.php

Drush returns the following error.

  PHP Fatal error: Call to undefined function node_load()

I also tried with drush --uri=http://localhost cache-get, but I get the following error.

  Command cache-get needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.
  The drush command 'cache-get' could not be executed.
  Drush was not able to start (bootstrap) the Drupal database.
  Hint: This may occur when Drush is trying to:

  bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See drush topic docs-aliases for details.
  connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See http://drupal.org/node/1428638 for details.
  Drush was attempting to connect to:
  Drupal version:  7.26
  Site URI:  http://localhost
  Database driver:  mysql
  Database hostname: 127.0.0.1
  Database username: username // This is shown correctly
  Database name: database_name  // This is shown correctly
  PHP executable: /usr/bin/php
  PHP configuration:  /etc/php5/cli/php.ini
  PHP OS:  Linux
  Drush version:  7.0-dev
  Drush temp directory:  /tmp
  Drush configuration:
  Drush alias files:
  Drupal root:  /opt/lampp/htdocs
  Site path:  sites/default


texts: How do I manually set tnid when migrating nodes?

texts:
I need to manually set tnid during migration.

My code:

  public function complete($entity, $row) {

    // load the newly created node (just in case entity isn't fully populated).
    $node = node_load($entity->nid);
    $node->tnid = '66';
    $node->title = 'CHANGE THIS !';

    // create the field collection item entity
    $item = entity_create('field_collection_item', $values);

    // attach it to the node loaded above
    $item->setHostEntity('node', $node);

    // save the entity
    $item->save();
  }

The node 66 exists and is active, but when I check on translations, the new node isn't associated. Instead the  title is changed with "changed this", then the new node is updated.

With Devel I see that the node has tnid 66.


texts: What D7 settings need changed to take advantage of bigger cloud server

texts:
I've just upgraded my Rackspace cloud server to 2GB in hopes of speeding up my site. What steps should I now take to enable my Drupal site to utilize this extra memory?

Php mem is to 512MB at present. This is as far as I have gone in changed things (could I go higher, should I?)These are the types of questions I have..


texts: Is it okay to store a $node object as a $_SESSION variable

texts:
My contrib module currently stores a $node object temporarily in the variable table, and stores the nid for that $node in the $_SESSION variable so that the $node can be retrieved from the variable table at a later point.

Would it be okay to store the $node directly in the $_SESSION variable? Or would there perhaps be a performance of security impact?

If it is okay to store a $node object in the $_SESSION variable, do I need to serialize it first?


texts: How to make a region available to a non-page tpl file?

texts:
I'm working with a custom theme (which I did not develop.) We're wanting to add a block to a specific node type, which has a template called node-session.tpl.php. This template prints out all kinds of internal html and php, but is framed by the page.tpl.php file. The node-session.tpl.php contains the code that's printed by the $content variable in page.tpl.php.

I have a new block (created by the AddThis module) that needs to be positioned on the page such that it's nested inside a div created in the node-session.tpl.php. Unfortunately placing the region inside that file doesn't work, and in fact just testing for the variable $add_this itself returns false. According to all the documentation I can find, region variables are available to page template files only. Is there a way I can make the variable available to the node-session.tpl.php file so that I can position the block correctly?


texts: Is it possible to embed a content creation form in views header?

texts: Suppose I am building a twitter-like site, and allow members to form groups with OG. So I have set up a view to list all the posts in a given group. However, I would like to embed a content creation form in the header (similar to how twitter is at the moment) with group audience set automatically to the group (therefore is not shown as an option in the form). Is there a way to do it without writing code (I haven't been doing drupal module development after D6...)?


texts: Link to images(thumb) in a (block)view to the image(original) in another (page)view

texts:
I have a  unlimited multivalue field image gallery.

Using views i created a page for file entity and got the list of files in the field. The page displays the default original images one by one with a pager.

Created a block for the same view with the files shown as thumbnails, so the user can view all images in the gallery and click on the image he/she wants to see. I can link the thumbnails to content or file which takes me to the original file.

Is it possible i can link them to the corresponding image in the page view.


texts: How to always show Save as ... when download a image file in Webform result?

texts:
If the upload file is an image in a Webform's result, clicking the link will show the image in the browser.

Is it possible to force to popup a Save as... dialog? Such the user downloads the file instead of viewing it?


texts: Switching from one language to another says (Access Denied) using D8's multilingual module

texts:
I working on D8's multilingual website and using the domains as the language detection for instance: es.example.com

My issue is that whenever i am logged in from English site, and then switching to another (for example Spanish site) it says that am not logged in (Access Denied), i want it to be logged in for the rest of the languages once i logged in from English site.

Anyone knows the solution?

Thanks in advance.


texts:
I'm using auto submit in exposed filter and if I changing the form control twice and fast(Before I'm getting answer on the first change)
I will get wrong view list item.
(So it seems to be that the first ajax request overrules the second selection)
How can i fix it?


texts:
with a form I've got the possibility to upload images, this is the piece of code that says where the files go: '#upload_location' => 'public://',

this is the piece of code which generates the rows in my table view:

$rows[] = array(
        'data' => array(
            l($node->id, 'node/'. $node->id),
            $node->url,
            $node->title,
            $icon = "icon'>",
            $node->created,
            $delete = "id/delete'> " . t('Delete') . " | id/edit'> " . t('Edit') . ""
        )
  );

notice '$icon'. $node->icon returns for example usa.gif. But of course the path is invalid.

The question is: how can I use my images? I cant figure it out

There's probably some drupal way to do this, advice is highly appreciated!


texts: Drupal 7 how can I alter page content generated with module?

texts:
I have one module:

function MYMODULE_menu() {
    $items = array();
    $items['mymodule'] = array(
      'title' => t('My Module'),
      'page callback' => 'MYMODULE_view',
      'access arguments' => array('access content'),
      'page arguments' => array(1),
      'type' => MENU_NORMAL_ITEM,
    );

    return $items;
}
function MYMODULE_view() {
   return array(
        '#theme' => 'my_module_theme',
        '#variable' => 'some variable'
    );
}

In the other module I want to alter this content to change the theme and add some variables. How can I do it?


texts: Field help text is printed as input field title, not in separate field

texts:
On Bootstrap theme add field Text, give it any Help text, save it and you get empty field, but if you hover on the field it shows the help text on mouse tooltip.

But if you e.g. make list field (text) and give it help text, it gets printed in separate help-block div under the field. How do I get that for Text fields or all/any fields?


texts: How to create URL alias for node edit page

texts:
Pathauto can create URL alias for node view page, for example, URL from node/nid to project/nid (project is a name of content type), but the link to the edit page is not /project/nid/edit, but /node/nid/edit.

How could I create URL alias (like: /project/nid/edit) for node edit page in Drupal 8?


texts: How to replace text about [node:url] within a Rules Action?

texts:
I'm using the Rules module and have a Rule created that, upon saving of new content, an email is sent out containing the node title, as well as the URL of the node. Pretty straightforward. That said, I want to replace text in the URL before the message that's sent out. I'm using str_replace() but it isn't working.

Any suggestions?

Update:

The path currently look like this:
domain.com/cron.php/newsroom/press-release/[path-to-content]
However, I would need to replace out the "cron.php" from the URL, as that doesn't actually exist.
So the new URL should look like this:
domain.com/newsroom/press-release/[path-to-content]

Here's an export of the rule. I've removed any sensitive information:

{ "rules_press_release_notification_test" : {
    "LABEL" : "Press Release Notification Test",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "php" ],
    "ON" : { "node_insert" : [] },
    "IF" : [
      { "node_is_of_type" : {
          "node" : [ "node" ],
          "type" : { "value" : { "press_release" : "press_release" } }
        }
      }
    ],
    "DO" : [
      { "mail" : {
          "to" : "",
          "subject" : "[node:title]",
          "message" : "We've added a new press release to our Newsroom:\r\n\r\n[node:title]\r\n\r\n\u003C?php\r\n$releaseurl = \u0022[node:url]\u0022;\r\n$releaseurl = str_replace(\u0022newsroom\/\u0022, \u0022\u0022, $releaseurl);\r\n\r\necho $releaseurl;\r\n?\u003E\r\n\r\n[node:url]\r\n",
          "language" : [ "" ]
        }
      }
    ]
  }
}


texts:
I am trying to run a subquery  through views and found this call. I cannot get it to work. Here is how I am using it

function module_name_custom_views_pre_execute(&$view) {
    if($view->name=="view_name") {
            if($view->build_info['query_args'][1]==0) {
            $view->build_info['query']="my subquery";

                //echo ($view->build_info['query'] );
                //var_dump($view);
            }
    }
}

Without to test it I tried replacing the $view->build_info['query'] with the query generated in the view. Instead of a view result I get a blank page. Any other query I put in there myself results in a blank page as well.

I am writing the queries like so:

$view->build_info['query']="SELECT nid FROM node WHERE node.status='1'";

So I am not assigning any array objects values but rather writing the query in as if I would in any other db call. Should I build the query through the means of creating an object?  So something like this to start:

["build_info"]=> array(3) {
    ["query"]=> object(SelectQuery)#752 (21) {
        ["fields":protected]=> array(4) {
            ["nid"]=> array(3) {
                ["field"]=> string(3) "nid"
                ["table"]=> string(4) "node"
                ["alias"]=> string(3) "nid" }
        ["node_created"]=> array(3) {
            ["field"]=> string(7) "created"
            ["table"]=> string(4) "node"
            ["alias"]=> string(12) "node_created" }
        ["og_og_membership_label"]=> array(3) {
            ["field"]=> string(5) "label"
            ["table"]=> string(16) "og_og_membership"
            ["alias"]=> string(22) "og_og_membership_label" }
        ["node_title"]=> array(3) {
            ["field"]=> string(5) "title"
            ["table"]=> string(4) "node"
            ["alias"]=> string(10) "node_title" } }

Is there is another way to implement a subquery in views?

Using Drupal 7 Views 3


texts:
I've installed Captcha and reCaptcha in Drupal 8 because I want to use it on the site contact form. I believe I have all the configuration options set correctly but they are limited. For example, there is no place to tell it what form I want it to appear on.

All modules and core are up to date.

I am logging out to test the form. I know that by default administrators are not presented the reCaptcha.

I'm working with image based reCaptcha v2.

I've looked for a field widget to add to the form but there is nothing. Nor is there anything in the form display settings.

In the old days there was a form list to select from (see screenshots on this question: How do I go about telling Captcha that my form exists? ) but that no longer appears.

The instructions even reference the missing list:

While reCaptha has a stable release for 8, Captcha has only a beta from Feb 2017. So I'm wondering if anyone has this working in 8 at all.

Any suggestions? Further troubleshooting steps I can take?


texts: How to translate a custom user role name?

texts:
I've added a few custom user roles with english names. I need to translate them to other languages now. What is the best way to do this?

According to the user_roles function only "core provided" role names can be translated by default.

I've installed the i18n module and fiddled around but haven't found the correct way yet.


texts: Ajax Response set back to default language instead of current

texts:
On AJAX Call. It set to default language instead of current language. On AJAX route calling below function

public function ajaxList(Request $request) {
    $response = new AjaxResponse();

    $selector = $request->request->get('selector');
    $path = $request->request->get('base_path');

    $current_path = \Drupal\Core\Path\CurrentPathStack;

    $current_path->setPath('/' . $path, $request);

    $build = $this->processData($request);

    $response->addCommand(new ScrollTopCommand("$selector"));
    $response->addCommand(new ReplaceCommand("$selector", $build));

    return $response;
  }

In processData calling my Custom Form

 private function processData() {
    $form_state = (new FormState())
      ->setStorage([
        'rerender' => TRUE,
      ])
      ->setMethod('get')
      ->setAlwaysProcess()
      ->disableRedirect();

    $form_state->set('ajax', TRUE);

    $form = \Drupal::formBuilder()->buildForm('Drupal\my_module\Form\TestForm', $form_state);

    return $form;
  }

It will reset My Form's Label back to English.


texts: Internal links no longer working. Getting MAMP virtual host info instead

texts:
My local site is running Drupal 7.43 using MAMP on Mac OS X 10.10.5. The site was running fine until recently, when all of the links on the front page were no longer working correctly. Each link now opens the same page. Here is a screenshot of that page.

After much digging, I found out that turning off clean URLs allows me to access the rest of the site, which is a CiviCRM installation. I downloaded the files and database from a live site to verify the backup worked. It does work, but only if clean URLs are disabled. Why does it happen?


texts: Where are features displayed after they are created?

texts:
I just created a feature on one site for copying to another and on the site I created the feature it doesn't appear in the list of features, and I am sure I didn't delete it.

When features are created on a site as opposed to being installed do they remain in the UI or do they have to be installed as well to appear in the site's Features UI?

Is there a module that provides a UI for managing the Features which are created on a site but not installed there?


texts: Is it a problem when entity field storage info is not registered in the key_value table?

texts:
This is a Drupal 8 (beta 15) site, basic, few content types. On the status report page it says:

Entity/field definitions
    Mismatch detected
    Mismatched entity and/or field definitions.

After investigation it turned out, this is caused by a few fields. The Drupal\Core\Entity\EntityDefinitionUpdateManager::getChangeList() is reporting them, because their original storage definition is missing from the key_value table for the column-collection: entity.storage_schema.sql

(The column-collection = config.entity.key_store.field_config entry is there for all fields.)

My question is - how can we fix this? All configuration is stored in configuration files (staging directory) - including all fields yml files. The configuration manager reports no difference, export will keep the files the same, and import will not change anything. drush updb will report no updates as well.

Is there a command we should call in an update hook to sync/register this storage info? Any idea?


texts:
Using D7 Views 3.4 and References module.- I have a content type called "Gloves" which has a node reference to a content type called "Glove Type".

What I need is to be able to see other gloves from the same "Glove Type" when viewing a glove node.

Ex:

Glove name = Outback, Glove Type = Mens.
I need to be able to display the names of other Glove Types within Mens while viewing the Outback node.

So somehow I need to dynamically pull the "Glove Type" from the current node, and then display a list of nodes from the same "Glove Type" (excluding the one being viewed)

I've been trying all types of contextual filters, arguments etc but can't get it right.

Appreciate any help.
Thanks!


texts:
Is it possible to add an icon in front of a field name?

I have a field name called Tel and would like to put a phone icon in front of it?

I've searched for a while and can't seem to find an answer to this.


texts: How to reset admin password if account is blocked

texts:
I am using Drupal 8 and I forgot my admin password and have it blocked due to trying to login unsuccessfully 5 times. I am running my website in localhost.
How can I reset it? Is it possible to do with a SQL query?


texts: Instantiating Fields: via UI, API or Drush?

texts:
Are there any benefits of using one method of instantiating over another?

From what I'm guessing, creating field instances via the API (programatically) has benefits over the UI since you get to version control the changes.

Drush commands can be put into a script as well and then version controlled.

Are there any other pros/cons to doing things programatically versus the UI?


texts: Create a multistep Webform and set to "non-linear" with sidebar showing which steps have been completed?

texts:
I have several steps in my Webform that require certain values to pass each step.

This is done by Webform Validation and seems to work fine, however how can I turn the Webform into something that's "non-linear" allowing users to jump to any page they want to complete with ease.

Ideally I'd want to move the titles for each multistep page to a sidebar menu which would show the status of whether that page is completed or not.

Is there any modules that do something similar already?


texts: Can't get narrow stylesheet to load in Omega commerce sub-sub-theme

texts:
I've got a sub-sub-theme of Omega, namely, a subtheme of omega_kickstart_theme, which is in turn a subtheme of omega_kickstart, which is a subtheme of omega.

Here's my .info file (pastebin).

I've stuck the file freshstop-omega-alpha-default-narrow.css in the /css folder, and that's supposed to be all she wrote. It's supposed to load for the narrow layout.

But when I resize my browser and check for this file, it's not there, nor are its styles. Cache cleared, css aggregation off, etc. Firefox.

I've also tried freshstop_omega-alpha-default-narrow.css (note underscore instead of dash).

Hmm. Any deeper tips? Place to start debugging?


texts: Redirect to internal URL after submitting form

texts:
I have tried to redirect after submitting.

public function submitForm(array &$form, FormStateInterface $form_state) {
   $form_state->setRedirect('mymodule');
   $form_state->setRedirectUrl(\Drupal\Core\Url);
}

I get the following error.

  Fatal error: Undefined constant 'Drupal\Core\Url'

Can anyone help me with the redirection?


texts: Allow all OG members to view/edit all content

texts:
I'm pretty new to OG and I'm testing a collaborative intranet site at this moment with Drupal7 and Organic Groups 7.x-2.3.

It is a simple app for a small group where all the members know each other and can be trusted. We're working on a Degrowth Workshop (link to the workshop announcement, in Spanish).

I've used OG to set the organizers in the different work areas (catering, activities, kids, lodging,...), have lists grouped by... groups (of course), and create a customized homepage for the members of the different groups. Everything ok until this point.

Now what I want is that everyone (all registered users - there's NO access to anonymous) have access, can read, write, edit, comment, etc to any node, whether it be of their group or not.

I'm fighting with the Field Settings, Permissions and roles but can't get to achieve it and there's always some hidden content to members of different groups. I've read quite a few solutions to similar issues but can't get a clue.


texts: How to add new component type in webform?

texts: I want to add a reset component type to a webform. Is there any contributed module available? if not suggest me how can I achieve this through code.


texts: How to wrap views-view-fields.html.twig with html container element?

texts:
I have a block view with an image field.

I know how to theme this field :

views-view-fields—my-images.html.twig

How can I wrap this loop with an element like :

I’ve tried different solutions without success.

Theme the block twig template :

If I use block--views-block--slider-images.html.twig

Of course it doesn’t work because there is no possibility to theme the field inside this twig template.

I’ve tried to add my wrapper in the header and footer option in the view but even if it works, it is not perfect since I need to have a better control on the html (I’m doing a slick slider, I know there is a module but I don’t want to use it).

I’m trying to do something I can do in node :

In  node—lorem.html.twig :

{{ content.field_my_images }}

In field--field-my_images.html.twig

    {% for item in items %}

            {{ item.content }}

    {% endfor %}

I’ve also checked all the "rewrite results" options in view but didn’t manage to add a wrapper.

I prefer a solution where I can create my custom html strcucture like the above example with a loop.

EDIT

Here is the HTML structure I need :

your content

your content

your content


texts: How to set the path for the public directory?

texts:
I used to have a Drupal 7 installation on var/www, but I had to move it to var/www/drupal. The problems is that my files are still in var/www/sites/default/files and I am unable to move them.

I need to make Drupal use that directory as default file directory (just on level above). On admin/config/media/file-system, I tried to use absolute file path, without success. I tried to set ../sites/default/files too; it was almost successful, but now I am having problems with the image creation and caching. I have to manually load every single image style; otherwise, it does not find the file.

How can I set up a public file folder which is one folder above Drupal's root folder?


texts: How to update uber cart attribute pricing programatically in Drupal 7?

texts:
I am using the following code to alter a price, but after being saved, and viewing the node, I don't see any changes.

$node = node_load($nid, NULL, TRUE);
foreach ($node->attributes[4]->options as $attribute) {
    $attribute->price = 4363;
}
node_save($node);

I suspect the problem either being how I am trying to update, or perhaps some caching issue.

UPDATE

I fixed this by running a straight forward SQL query:

UPDATE uc_product_options set price = 333 where oid = 111

But it would still be nice to know how to do this the correct way.


texts:
So i have defined a block

case 'foo_post':
    global $user;
    $values = array(
        'type' => 'foo',
        'uid' => $user->uid,
        'status' => 1,
        'comment' => 0,
        'promote' => 0
    );
    $entity = entity_create('node', $values);

    $ewrapper = entity_metadata_wrapper('node', $entity);
    $ewrapper->og_group_ref->set(menu_get_object()->nid);

    $block['subject'] = t('Create a new foo');
    $block['content'] = entity_form('node', $entity, 'add');
    $block['content']['#attributes']['class'][] = drupal_html_class('panel-body');
    $block['content']['title']['#access'] = FALSE;
    $block['content']['form_title'] = ['#markup' => sprintf('<h4>%s</h4>', $block['subject']), '#weight' => -1];
    $block['content']['form_advanced'] = [
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#type' => 'fieldset',
        '#title' => t('Advanced settings'),
        'additional_settings' => $block['content']['additional_settings'],
        'og_group_ref' => $block['content']['og_group_ref']
    ];
    unset($block['content']['og_group_ref']);
    unset($block['content']['additional_settings']);
    break;

Most of the things work already, except the form wouldn't take the user ID of the user submitting the form. What did I do wrong here?


texts:
I have a use case where we need to seed Drupal content with content from another database.

The only access to this database I have is via a Rest API.

The official Drupal.org docs have a link to this article by Lullabot which seems promising:

https://www.lullabot.com/articles/pull-content-from-a-remote-drupal-8-site-using-migrate-and-json-api

Is using Migrate a reliable solution to having never-ending one-way "content sync"? There are about 120,000 items to do an initial import of, and we need to import/update items that were changed in the previous 24 hours (daily).

I figured Migrate should be able to do this, given that it has a lot of fail safes and extension points built in (some data will need to be modified a little on fetch, for example).

edit: Not literally the JSONAPI in Drupal, but the source content is fetched via a JSON API that returns a JSON object response.


texts: Authentication Support with AWS failing to send

texts:
I am trying to fix our SMTP Drupal 7 configuration because I am now getting errors that its unable to send the email. I am using AWS as our SMTP server and I can send a test email from that just fine. I regenerated my SMTP credentials and updated the Drupal SMTP module configuration with that to see if that was the issue but its still erroring sending the email. I've posted pictures below.

I'ved checked to see if the PHP mail() function works, but that just returns false and I never get an email from that either. From what I've read, using SMTP bypasses the mail() function so that shouldn't be causing an issue. I believe mail() may be disabled by our server host.

Unfortunately I don't have sudo to our webbox so I'm going to ask my web host to send me the the apache logs and maillog. Is there any other log files that might be

UPDATE

Edit I have since created a fresh install of Drupal on my own webbox and installed only the SMTP module. From this my AWS email still failed to send, and I'm assuming thats because I cannot verify my domain (Student run site hosted as a subdomain to our institution so I cannot modify our DNS). Instead I figured I'd try setting up a gmail account, which I got working on my fresh install. After copying those same settings to my production environment it still refuses to send. I tried updating the SMTP module because it was a few versions behind but that didnt help. Interesting to note that my fresh install provides way more debug output.


texts:
I have Facebook Oauth set up to receive a few fields.  They are mapped in the Configuration -> Facebook OAuth settings -> Field Mapping to fields I added to the account object.

When a facebook user tries to connect, they are prompted for permissions on these fields, and the user accepts.  However, the fields are not being captured to the fields they are mapped to.

Ideas??


texts: How to rebuild the theme registry on every page?

texts:
I returned to Drupal 7 after a short absence, and couldn't find the option to "Rebuild the theme registry on every page", which is useful while editing templates on a development site. I thought it was in the Performance options but I can't find it there, and searching for it gives unclear or out of date results, mostly around the Zen theme which I haven't used for years. I've definitely used this setting without using Zen.

Where's the Drupal option to rebuid the theme registry on every page?


texts: How to debug users geting automatically logged out for unknown reasons?

texts:
For our Drupal 6 site, we've experienced such issue that logged-in users are getting logged out for around one week or several days.

Firstly I thought this might happen with Boost module, but it seems this issue happens as our test site that runs without boost enabled. We have already set cookie time long as following in settings.php

ini_set('session.cookie_lifetime',  2147483647);
ini_set('session.gc_maxlifetime',   200000);

This site is pretty big and includes a lot of custom modules/code, which make it difficult to debug what's going on. I greb the code, and no luck to find session_destroy code, or user logout code. Maybe I need to set session.gc_maxlifetime as large as session.cookie_lifetime?

Is there some way to debug this issue when users are logged out?


texts: Create list of webforms and number of submissions

texts:
in drupal 8 how do I create a list of all the web forms (I've got about 80) and show the number of submissions they have.
I can do it in Drupal 7 using views but not in Drupal 8.


texts: How to open various files(image,video,txt) as pop-up on the current browser page instead of opening in separate page?

texts:
I have seen on several sites, particularly news sites, If we click on video, the video does not open in the separate page, instead small window in the middle of the screen pops-up and video does play there itself and you can close that and behind that your current page is as it is. Same way when we click the image icon on the stackexchange text form to upload the image, small windows open of drag and drop appears.

Hence is there possible in drupal 7, for images, videos, pdf, txt files, word files etc. which opens on the same screen as pop-up in front of current screen.


texts: Is there a way to change how a form button looks?

texts:
I know how to add a class to a form element and how to add a form submission button, but there are classes that are automatically added to these buttons in my Drupal 8 install.
The form I am editing has two buttons, a submit and a skip button; both the buttons look the same. I would like to add a visual clue to the difference between the buttons. The buttons get an automatic btn-primary class but I want the skip button to have a btn-outline-primary class. If I add that class with '#attributes' => ['class' => ['btn-outline-primary']], the class gets added, but the btn-primary class is still part of the button. The combination of those two classes makes the button text the same color as the button background color, and thus invisible unless you hover over the button.
Is there a way to perhaps not include the button in the template, for example {{ form.actions.skip }} but more verbose? In the sense that takes over some of the Drupal 8 automation?
<button class="btn btn-outline-primary">{{from.actions.skip.something}}</button>