texts: How to unset CSS class for menus in the template.php?

texts:
Lets say I have a menu block in my header region. And by default Drupal gives .active class for links that are active. I need to get rid of that .active class, because the CSS/HTML version of the theme (which I am porting to Drupal 7) doesn't have .active class and its not just .active, there are many more.

I need this because now default Drupal rules like a.active overrides my themes CSS of a simple a rule.

Please, do not recommend !important.


texts: How to place a plugin block to twig template without any contributed module?

texts:
I am using Drupal 8. Have created a custom module, added custom block "LskyTestVideo", created a new page template with its own controller ("LskyOpenTokTestController"). In LskyOpenTokTestController::index action I rendered test-video-page.html.twig . Inside this page I need to place LskyTestVideo block.Here my code:
class LskyOpenTokTestController extends ControllerBase {

public function index() {
$block_manager = \Drupal::service('plugin.manager.block');

$config = [];
$plugin_block = $block_manager->createInstance('lsky_test_video', $config);

$access_result = $plugin_block->access(\Drupal::currentUser());

if (is_object($access_result) && $access_result->isForbidden() || is_bool($access_result) &&
!$access_result) {
  return [];
}
$render = $plugin_block->build();

return [
  '#theme' => 'open_tok_test_video_page',
  '#attached' => [
    'library' => [
      'lsky_open_tok/video-test-window',
      'lsky_open_tok/opentok',
    ],
  ],
  '#test' => $render,
];
 }

}

Here test-video.html.twig

{{ test }}

When the page is rendered, it returns 0.
How I can place a custom plugin block inside twig template. Thanks.


texts: Is there any module I can use to display limited points on OpenLayers using bbox-filtering in Drupal?


texts: Change Taxonomy Page to display first node in full

texts:
By default in Drupal 7, a taxonomy page lists the titles of all the nodes that have been tagged with that term.

Is there any way to make it so the page shows just the first node that is tagged with that term?

I want it so the first node is displayed in full (Ideally, the term page should automatically take the user to the first node).

I know you can use Views to override a taxonomy and control what content is shown. However, I would like to do this without views (i.e. so the user is seeing the acutal node as opposed to a view of the node).

I also want it to happen automatically (i.e. for every term, the first node should displayed. The admin of the site should not have to manually set up this state for each individual term).


texts: Drupal 7: How can I get path for node or term in drupal with php code?

texts:
I must build a block that retrieves children of a specific term id by selecting it through $node->title of a page.
So, I get it with taxonomy_get_termBy_name.
With this $term->tid I can get children of it by calling taxonomy_get_children().
Ok, it returns an array of children.
For each child I must take name and path in order to build an .
How can i retrieve these properties?
I am unable to find a module that performs these operations, so I must build my own block.


texts: How to clear cookie with cookie name on from submit?

texts:
When users fill values in node form input fields I set cookies of those values with help of javascript code, example :

    var date = new Date();
    date.setTime(date.getTime() + (60 * 60 * 1000));

 $('#edit-field-topic-und').on('change', function() {
            var section =  $(this).find("option:selected").val();
            console.log(section);
            if(section){
                $.cookie("section", section, { expires: date });
            }
        })

        $('#edit-field-topic2-und').on("change", function () {
            var topic = $(this).val();
            console.log(topic);
            if(topic){
                $.cookie("topic", topic, { expires: date });
            }
        });

        $('#edit-field-language-und').on('change', function() {
            var language =  $(this).find("option:selected").val();
            console.log(language);
            if(language){
                $.cookie("language", language, { expires: date });
            }
        })

If user does not submits from and next time come to node add form page, I set default values in from with help of form alter:

case 'link_node_form':
      /*show default values from cookie*/
      if (empty($form['nid']['#value'])) {

        if(isset($_COOKIE['section'])) {
          $form['field_topic']['und']['#default_value'] = $_COOKIE['section'];
        }

        if(isset($_COOKIE['topic'])) {
          $form['field_topic2']['und']['#default_value'] = $_COOKIE['topic'] ;
        }

        if(isset($_COOKIE['language'])) {
          $form['field_language']['und']['#default_value'] = $_COOKIE['language'];
        }

      // clear cookies after from submit
        $form['#submit'][] = 'custom_overrides_link_node_form_submit';

      }

Now when user submit form and node got created successfully cookie is not clearing or the cookies got values of last submitted node.

Please suggest how to clear / unset cookies when form get submitted.

function custom_overrides_link_node_form_submit($form, &$form_state) {

  if(isset($_COOKIE['section'])) {

    unset($_COOKIE['section']);
  }

  if(isset($_COOKIE['topic'])) {

    unset($_COOKIE['topic']);
  }

  if(isset($_COOKIE['language'])) {

    unset($_COOKIE['language']);
  }

}


texts:
I have a content type on my site called "Articles".
I created a view that lists the nodes of this content type.  It's path is "/articles"
For that view, I created a menu item in my main menu, "Articles".
I used the pathauto module for all my nodes of this content type to have the path articles/[node:title]

My question is, I want the menu item to remain highlighted if the user is viewing a single article node, or if the user is viewing the view.

I solved the issue by using theme_menu_link() function in my template.php file for my theme (code below).  Being new to the Drupal API, is there a better way to do it?

What I did:

function mytheme_menu_link(array $variables) {

  //Some variables, we're using
  $element = $variables['element'];
  $sub_menu = '';

  //#href is an element inside the item
  $the_path = drupal_lookup_path('alias', $element['#href']) ?: $element['#href'];

  //Compare the path to the actual URI (using sub-function), and if they match, then add a new CSS class
  //either: 'uri-active' or 'uri-active-trail'
  switch(mytheme__menu_detect_uri($the_path)) {
    case 1:  $element['#attributes']['class'][] = 'path-active'; break;
    case -1: $element['#attributes']['class'][] = 'path-active-trail'; break;
  }

  //If there are sub-menu items under this, render those too
  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }

  //Return the output
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}

/**
 * Detect if a given path matches the current URI, as detected
 * from reading the current_path() alias from Drupal
 *
 * @param string $path_to_check  The path to check
 * @param string $check_against  The path to check against (leave blank for current path)
 * @reutrn int   1 = Matches, 0 = No Match, -1 = In Active Path
 */
function mytheme__menu_detect_uri($menu_item_path, $actual_path = NULL)
{
  if (is_null($actual_path))
    $actual_path = drupal_lookup_path('alias', current_path()) ?: current_path();

  //Compare em
  if (strcasecmp($menu_item_path, $actual_path) == 0)
   return 1;
  elseif (strlen($actual_path) > strlen($menu_item_path) && strcasecmp(substr($actual_path, 0, strlen($menu_item_path)), $menu_item_path) == 0)
    return -1;
  else
    return 0;
}


texts: Publishing option is not available for one content type

texts:
I have drupal 6.25. I have some content types like article, editors, slideshow and others.
publishing options are listed normally for all content types except "article" (although i gave "administer nodes" permission to my editors). i have tried some modules like Override Node Options but i still have the same problem for this content type for all users (of course except the admin user, admin can see it normally).
any idea of what might cause this and how to fix it?
Thanks for your help


texts: Modify/hook into admin page of rate module

texts:
I'm creating a new widget type for the rate module with some custom settings. I plan to use multiple instances of the same widget each with different custom settings. Is it possible to hook into rate_widget_form to alter the admin page of the rate module ?

Example :

admin/structure/rate/add?template=widgetname
admin/structure/rate/%/edit

Sample Image :


texts:
I'm trying to use the AmazonS3 service to host videos from my Drupal site. I'm using:

Drupal 7.16

AmazonS3 7.x-1.0-beta7

AWS SDK for PHP 7.x-5.4

Libraries 7.x-2.0

Video 7.x-2.8+3-dev

I've also downloaded the AWS SDK Library 1.5.15 which I've put in my libraries folder.

I configured the amazon module to use the bucket I had set up on Amazon and put in the correct access keys for AWS SDK. I then set up my video field to use AmazonS3, however every time I try to upload a file I get the error:

  "The file could not be uploaded."

When I check the log files the error details are:

  "The upload directory s3:// for the file field field_video_s3 could
  not be created or is not accessible. A newly uploaded file could not
  be saved in this directory as a consequence, and the upload was
  canceled."

I have also set allow_url_fopen = On in my php.ini file.

Can anyone tell me if I am missing something? I have not added any special permissions or additional users to the Amazon bucket, and am not sure what permissions I would need to add if I do.

I would be grateful for any suggestions.

Ben


texts:
I am trying to make an entire Drupal site https.

I tried enabling secure pages, and this seems to work for every authenticated user.

However any anonymous user either gets only http, or possibly an infinite redirect if I wildcard all possible paths.

How do I get https:// to work on every page, for all users, including anonymous?

This is what my current .htaccess has in the mod_rewrite.c section:

  RewriteEngine on

  # Set "protossl" to "s" if we were accessed via https://.  This is used later
  # if you enable "www." stripping or enforcement, in order to ensure that
  # you don't bounce between http and https.
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Make sure Authorization HTTP header is available to PHP
  # even when running as CGI or FastCGI.
  RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]


texts: One contextual filter based on two entity reference fields

texts:
I have two content types.

Doctor
Location

Doctor has two entity reference fields. Both reference Location nodes.

Primary Location
Secondary Location

I need to create a view that appears on a Location node and shows all Doctors that reference the Location node via the Primary Location or Secondary Location fields.

This has turned out to be incredibly difficult.

I've create a contextual filter for Content: Primary Location and set Provide default value to Content ID from URL. This successfully filters the view to Doctors that reference the Location via the Primary Location field.

I now create a contextual filter for Content: Secondary Location and set Provide default value to Content ID from URL. I now have no results.

I can then delete the Content: Primary Location contextual filter and this successfully filters the view to Doctors that reference the Location via the Secondary Location field.

It appears I can't have both at the same time. Thanks for any help!


texts:
I want a module for uploading video files to YouTube from Drupal admin side. Description of  Media Mover module specifying an option "save a file to YouTube". But i couldn't find an option to do the same.

Please help me to check and find if there exits any module or can we use Media mover module to do the same.


texts: Can Commerce be setup to skip Cart/Customer

texts:
Can the module Drupal Commerce (7.x-1.7) be setup so that a user can just click 'Buy' on an item and then be taken to a payment processor such as Paypal to pay? I've tried to find a way to do this but the Commerce set of modules is just a little overwhelming at the moment.
I need to be able to do this as I'm selling a virtual currency to my users and they are used to a quick process and they don't wish to give out billing information.


texts: When should I be using database transactions?

texts: I know this is a question that depends on the details of a specific situation, and a rather open-ended question at that.  But, nevertheless, are there any good guidelines out there about when database transactions ought to be used in the course of everyday module development?  I've begun to worry that I should be doing transactions a lot more than I currently am (which is to say almost not at all), but it would obviously be wrong to go off on a frenzy of wrapping transactions around everything.  Any thoughts out there?


texts:
I'm having an issue with styling my menu mini panel hover.

Here's the site with the megamenu I'm working on:
http://drupal.scienceworld.ca

As I'm rather new to JS, I was wondering what the best way to center the foldout menu in the browser would be?


texts: Copy a user directly in database from another database (from production to dev-site)

texts:
related to this post for Drupal 6 (Adding a new user directly in database), I wanted to ask for help for my problem:

I have a drupal 7 site which is already online ("in use/production"). Users can register there.

To get an up to date dev-enviroment, I download the files (uploaded files, modules and so on) via ftp from my production server to my dev server.
The DB is migrated by "backup and create"-module (export on production server, import on dev-server and vice versa).

As I develop the features in my dev instances, new users register on my production site. If I now import my new backup of the dev-server to production site, the new users registered are lost because the db has been overwritten by the backup.

How can I copy these new user accounts directly to the dev database? what database tables are involved in Drupal 7?

THX in advance
phil


texts: Problem with loading translation of JS file via ajax

texts:
I've got an ajax call that loads some info and a js file with something like Drupal.t('CLOSE HISTORY')

That string, although properly loaded in the database, does not get translated when loaded through ajax.

Are there any issues translating js files that are loaded through ajax?

Any ideas are appreciated!


texts:
The day before yesterday I created a new role (writers), and when, after adding quite a few modules, I wanted to add another earlier today, I discovered there was no way for me to do this anymore, nor to edit the role I already created. Now, I am a newby with Drupal, only started out about 4 days ago, so I probably (un)ticked a box somewhere I shouldn't have, so I hope someone can help me out figuring out how to change this?

I added a screenshot of the page I think the possibility to administer roles should be. :)
(link)

Thanks in advance!


texts: how can I retrieve correct routes for rest resources?

texts:
I installed drupal 8 on my local server.
I enabled all web services modules and installed rest ui module.
I enabled some rest resources, such as entity/menu.
Now, I need to know how to get correct routes for entities.
For example, I tried to get main menu information by requesting http://localhost/mysite/entity/menu/main?_format=hal_json, but I received response 401.
So, there is a way to get a list of available routes for my rest server?


texts:
Drupal 7.x, Garland theme.

I am writing a module that depends on jQuery.  I am seeing that when an anonymous visitor comes by that jQuery isn't being loaded.  How do I load jQuery from my module?

I am not really a Drupal developer.  This is my first module.  I want to maintain Core as is (no hacking) for easy updates and I don't want to change themes from Garland, so I don't really want to edit the theme to force jQuery.

Thanks.


texts: How to change exposed filter select box style in views

texts: i have on exposed filter in views.it in defatult drupal select box style. how to change it like attached screenshot.


texts: How can I alter bundles of commerce_order_item entity type using custom module

texts:
I am trying to alter bundles of commerce_order_item -

core.entity_form_mode.commerce_order_item.add_to_cart_confirmation.yml

langcode: en
status: true
dependencies:
  module:
    - commerce_order
  enforced:
    module:
      - commerce_add_to_cart_confirmation
id: commerce_order_item.add_to_cart_confirmation
label: 'Add to Cart Confirmation'
targetEntityType: commerce_order_item
cache: true

.module file

function commerce_add_to_cart_confirmation_entity_bundle_info_alter(&$bundles){
  $storage = \Drupal::entityTypeManager()->getStorage('entity_form_display');
  foreach ($bundles['commerce_order_item'] as $bundle_key => $bundle_value) {
    if($bundle_key !== 'default'){
      $form_display = $storage->load('commerce_order_item.' . $bundle_key . '.add_to_cart_confirmation');
      if (!$form_display) {
        /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */
        $form_display = $storage->create([
          'targetEntityType' => 'commerce_order_item',
          'bundle' => $bundle_key,
          'mode' => 'add_to_cart_confirmation',
          'status' => TRUE,
        ]);
        // Hide the unit price by default.
        $form_display->removeComponent('unit_price');
        // Hide the quantity by default.
        $form_display->removeComponent('quantity');
        $form_display->save();
        $form_display->enable();
      }
    }
  }
}

But at $form_display->save(); is am getting below error -

Error: Call to a member function getConfigDependencyName() on null in /var/www/drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 314 #0 /var/www/drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(346): Drupal\\Core\\Entity\\EntityDisplayBase->calculateDependencies()\n#1 /var/www/drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php(266): Drupal\\Core\\Config\\Entity\\ConfigEntityBase->preSave(Object(Drupal\\Core\\Config\\Entity\\ConfigEntityStorage), true)\n#2 /var/www/drupal/core/lib/Drupal/Core/Entity/EntityStorageBase.php(434): Drupal\\Core\\Entity\\EntityDisplayBase->preSave(Object(Drupal\\Core\\Config\\Entity\\ConfigEntityStorage))\n#3 /var/www/drupal/core/lib/Drupal/Core/Entity/EntityStorageBase.php(389): Drupal\\Core\\Entity\\EntityStorageBase->doPreSave(Object(Drupal\\Core\\Entity\\Entity\\EntityFormDisplay))\n#4 /var/www/drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(259): Drupal\\Core\\Entity\\EntityStorageBase->save(Object(Drupal\\Core\\Entity\\Entity\\EntityFormDisplay))\n#5 /var/www/drupal/core/lib/Drupal/Core/Entity/Entity.php(377): Drupal\\Core\\Config\\Entity\\ConfigEntityStorage->save(Object(Drupal\\Core\\Entity\\Entity\\EntityFormDisplay))\n#6 /var/www/drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(637): Drupal\\Core\\Entity\\Entity->save()\n#7 /var/www/drupal/modules/custom/commerce_add_to_cart_confirmation/commerce_add_to_cart_confirmation.module(116)

This is annoying because same code is running for hook_confirmation_entity_bundle_create($entity_type_id, $bundle). Please advice what should I do to save the bundle.If there is another way to achieve what I am trying to achieve, please tell me.

Thanks Guys


texts:
I'm in the progress of creating a bulk upload function for a Drupal site. Using flash I'm able to upload the files to a specific url that should be able to handle the files.

What I want to do, is not just to upload the files, but create a node of a specific type with the file saved to a file-field that has been setup with CCK. Since these are audio files, it's important that file-field handles the files, so additional meta data can be provided with the getid3 module.

I've taken a look at the code/doc, but wasn't able on the first round to figure out how to handle this. Ideally, there is some function that I've missed, that can handle most of this for me.

If any one has experience with this I would apreciate some pointers on how to approach this matter.


texts: How can I see multiple terms on a single view?

texts:
I have a content type called "Listing". This listing has a taxonomy reference called "Amenities". A single listing can have several or no amenities and each term has a field on it called "icon".

I want to create a view that shows:

TITLE
Amenity 1, Amenity 2, Amenity 3

Instead of text, I want to show icons.

I was able to figure out that you can use "relationships" to get to the icon field on the term. However, it only shows ONE term from the list. There doesn't seem to be any aggregation or grouping by happening. Which means it shows the same listing over and over, for each term. Instead of showing the listing once, and all the term images below that.

What am I missing?


texts: Create multiple nodes through one mail using mailhandler?

texts: I want to create more than one node, from one email sent to the drupal site, using the mailhandler module. Is that possible?


texts: How can I change the precision of a field used in a field collection or content type?

texts:
I have a decimal field (ie field_testing) with precision = 10 and scale = 8.  I need to change the precision to 11.  I was planning on writing a migration script that does the following:

Update field_config row with field_name = 'field_testing' -- set the 'precision' field to 11.
Alter the field_testing table structure to adjust the precision of the 'field_testing_value' field to 11.

Few questions related to this:

Given that I run this while in maintenance mode, is this safe to do?
Is there anything else I need to do?  The default values is and will still be blank, so changes need to go into field_config_instance, I think.

Thanks,
Larry


texts: The ComplexData plugin does not exist, after upgrade

texts:
After my Drupal 8.51 upgrade, I keep getting this error.

  Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "ComplexData" plugin does not exist."

I have Googled it for two days and haven't found any information about what this is or how to fix it. I get the error while using Panels/Page Manager. I did upgrade both modules to the 4/14 release but that didn't help. Any ideas?


texts: Help with rules - remove shipping option if coupon applied

texts:
I am in a situation where if a coupon code is applied to an order I'd like it to remove a free shipping option, if no coupon is applied then the allow the free shipping option.

I have a rule setup which has a condition to check if shipping address is in UK. I'd like to disable this rule if a coupon code 10off is added to the order but not sure how, any help would be greatly appreciated!

Many Thanks
Max


texts: How to link (a menu item) to the RSS feed?

texts:
In our Drupal installation there is a menu item for the RSS feed, pointing to path de/rss for the German feed.

This path appears unchanged in the frontend and is invalid, hence results in a 404.

The correct URL is /de/rss.xml or just /rss.xml.

Weird thing is, that Drupal accepts the non-working path, while it rejects the correct ones:

  The path 'de/rss.xml' is either invalid or you do not have access to it.

What's going on?

Note: I'm using the i18n module. And when I call /de/rss.xml it gets redirected to /rss.xml.


texts: taxonomy terms view with custom alphabar for not listed language

texts:
I could solve just part of my problem, check "taxonomy terms view with custom alphabar (for Spanish)". I'm working with two languages, Spanish and Mapudungun, so I have Spanish > Mapudungun and Mapudungun > Spanish dictionaries. As you can see at the linked issue I could solve my problem at the Spanish > Mapudungun dictionaries, but I have different needs at the Mapudungun > Spanish ones.
In Mapudungun I have sounds represented by two letters or a letter plus an apostrophe: ch | l' | ll | n' | ng | sh | t' | tr | ü . Beside the normal letters, not all of them by the way, for instance, there is no b, no c without h, no h preceded by a c, no j, no q, no v, no x, no z. Actually this is the complete alphabet for Mapudungun:

a | ch | d | e | f | g | i | k | l | l' | ll | m | n | n' | ng | ñ | o | p | r | s | sh | t | t' | tr | u | ü | w | y

So I'm looking for a way to represent those "special" letters in the alphabar and at the same time give the same order to the entrances at the dictionary, I mean, for instance that the n does not mix up with n' and ng and have them independently ordered as they are totally different letters. At this moment I have:

na
ne
nga
nge
ngi
ngo
ngu
ngü
ni
no
nu
nü
n'a
n'e
n'i
n'o
n'u
n'ü

And I should have:

na
ne
ni
no
nu
nü
n'a
n'e
n'i
n'o
n'u
n'ü
nga
nge
ngi
ngo
ngu
ngü

Any ideas, thanks


texts: Default Redirect after login based on destination

texts:
I have custom routing and a user controller in a module that redirects authenticated users to a private area on a site.

It works fine when users are coming from the login page - redirects them to a dashboard at a custom user page - but I would like users to continue to the page they are requesting if they come to the site from a link.

It is common for users to share links to internal content and they are then having to log in and get to the link from their dashboard which is causing some annoyance.

I have reasonably simple routing for the user page and a controller in my module that redirects users to their userPage. Is their a way to have this not redirect depending on the link they are requesting?


texts: How to create and apply image style programatically

texts:
I need to create and apply image style based on the height and width provided by user. So what I did is, I created image style using Drupal core UI (http://mysite.com/admin/config/media/image-styles/add). I also added scale effect to it. After that I can see the style directory created under [path]/sites/default/files/styles/mystyle

Now programmatically I updated the effect (width and height) and flushed the image style. But after executing my code, its removing the created style directory (mystyle) and nothing happening.

My Code:

  $style = image_style_load('mystyle');

$isid = $style['isid'];

db_delete('image_effects') //deleting existing effect
    ->condition('isid', $isid, '=')
    ->execute();

$effect = array(            // creating new effect
        'name' => 'image_scale',
        'data' => array(
                'width' => $width,
                'height' => $height,
                'upscale' => FALSE,
        ),
        'isid' => $isid,
);
image_effect_save($effect);

$output = image_style_url('mystyle', $uri);

image_style_flush($style);

I'm getting Drupal access denied page when I try to access the return value of image_style_url.
what am I missing?


texts:
I think my question is very simple, but I was searching for long time for a good solution.

How do you integrate in Drupal 7 one views (e.g. page or block) inside or after one single node (e.g. node/10). What is the best solution?

Until now I used the drupal block system to attach one views-block after a single node. But I read, is not a good solution.

Thanks


texts: Export nodes inside Panels by their UUIDs through Features

texts:
In D7, I have a panel page that uses several nodes as content. When I export the panel into a feature on my Dev using UUIDs and UUID Features, and import the feature into my Test environment, Drupal creates new nodes with the UUIDs as expected, but the Panel isn't updated to reference these new UUIDs and their respective new NIDs. Instead the Panel keeps referring to Dev's NIDs.

I've looked high and low for a solution to no avail. The closest I have come to a solution was:
https://www.drupal.org/node/827466
But it has been years and no update. Does anyone have any ideas/solutions? Thanks.


texts: What hook gets called at the formation of a form? (hook_form_alter called for adjusting a form)

texts:
what hook gets called at the formation of a form.

I'm trying to add some additional mime types to form with id file_entity_add_upload but my hook_form_alter is getting called after these are validated, so attempts to upload them fails.

Update - added screenshot to illustrate the problem

Update 2
the mime types list in file_entity_get_upload_validators function in file_entity.pages.inc dictates what can be uploaded - see this screenshot

Specifically, in, file_entity_get_upload_validators, the line that populates the valid mime types with hard-coded values is (my screenshot didn't completely show the line):
$validators['file_validate_extensions'] = array(variable_get('file_entity_default_allowed_extensions', 'jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp'));

Update 3

It would appear that the actual checking of the mime type happens in core module "file", modules/file/file.js : if (!acceptableMatch.test(this.value)) {
        var error = Drupal.t("The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.", {
 I searched the error message shown in following screenshot in the code and file.js was a result - which looks like where the actual validation is taking place.

New error with Andy's answer - maybe it's me will look into it a little later.

Raised as an issue here:
https://www.drupal.org/node/2295671


texts: drupal_get_path function for third party PHP includes files

texts:
I am trying to add some PHP includes files into Drupal 7 site. The files are on this page - https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/connecting_to_the_api_using_php.htm under the "Required PHP Includes" heading. It looks like I need these files: soap-wsse.php, exacttarget_soap_client.php, xmlseclibs.php in my Drupal install.

I will need to use the require('exacttarget_soap_client.php') function in a Drupal custom module.

My question is where to place these files in the file structure of Drupal and what would be the $type using drupal_get_path() function? Should I be using the Libraries API instead?


texts: Add state for Germany and drop-down menu

texts:
How do you change the default fields in the addressfield Module for a given country?

For Germany you have , while for USA you get , including a nice drop down menu with all 51 states.

I want to change the Germany default to have

only one address field (only Address 1)
a field with a drop down menu, showing the states of Germany.

I read on drupal.stackexchange that it should be possible with hook_form_alter or with ctools module, but within 4 hours of browsing and trying, I could not figure out how?

I'm using drupal for 5 months, so I would appreciate a detailed answer, but also any short link, that helps me to solve that issue, is highly appreciated.


texts:
Somewhat weird situation, but it is what it is.

Decreed that user accounts are no longer required for access to spec documents. That's good.

However, we have various editors who will still edit content and will need to log in. The simple thing is to just give them a url to bookmark with the ?q=user added. Works fine.

However, I need to add a logout link so they can actually sign out. So, I need to somehow tell Drupal, based on role authentication, show this link.

I tried putting the default User Login block in the header and checked the domains and roles of the various editors and authenticated web user but they aren't showing. Could this be due to login/logout links of the Primary menu being disabled?

Next, I tried making a block with simple text: logout with the link of logout but it's not showing up in the header either. And yes, I tried other pages using the basic page.tpl.php template to make sure the block was in a used region.

I'm not afraid to slam some php somewhere, but I'd like to think I'm just missing something.


texts: What could cause the Features create page to time out?

texts:
The site I'm working on is timing out when I try to open the admin/structure/features/create page. I'm not experiencing the problem elsewhere in the admin, just there. What does this page do differently that might take more time?

On a related note, does anyone have any tips for determining what Drupal component/module is causing a slowdown aside from "turn everything off and see what happens"?


texts: How to change the order of content types

texts:
How would one go about changing the order of the content types list on a multilingual site or non-english site?

For example, by adding a content type named Émission (with accentuated É), we see the following list on admin/structure/types page:

Article
Page
Émission

Same goes when translating a content type name (E.g.: Show => Émission) and changing language.


texts: count entityreference multivalue field conicidences (make an attendance form)

texts:
This question is similar to this one How to make an attendance form, but i solved by entity refrence view widget module, saving date in a node, and having a field entityreference user relation with unlimited values. Now i have a views table of nodes like:

and now i can not sum how many times a user entityreference appears, ofcourse at the bottom i need to have: John=3, Mary=2, Pete=2
I tryed views aggregartor plus with no luck, please make some suggestions how to achive this.


texts: From where the execution starts in Drupal

texts:
Generally in any HTML file execution starts from index.html and PHP file starts from index.php.

But in Drupal from which file the execution is started, i know that it is started from bootstrap file but what calls the bootstrap file ?

What is the execution sequence when i write http://example.com which will load/install drupal ?


texts: I need to alter the content of a node either before it is viewed or after it is saved. In order alter the fields I will need the create date of the node. I am currently attempting to do this via hook_node_view, but is there a better way?


texts: Where does the profile name on the Status Report come from?

texts: When I click on Reports > Status report, the Install profile field says Snrub (snrub-"1.1) (with exactly one double quote). Where is this value defined?


texts: Entity Reference and nested arguments in Views

texts:
My site has 3 nodes:

Program, which is a list of Course nodes.
Course, which contains basic information about a course you can take
Course Date, a specific instance of a Course. Each Course Date references one Course, and the titles are auto-generated.

The view I'm scratching my head over is

I need a view that loads on each Program node, showing all current Course Dates who's Entity Reference matches any Course in the current Program.

It would be a lot simpler if each Course was only in one Program, but they aren't.

I've tried Relation and found it too buggy for production. I've tried Reference and Entity Reference, and settled on the latter as it seems more featured.

Would it be possible to automate some kind of reverse field reference? Any tips welcome!


texts: Does Drupal 7 Entity Translation Translate?

texts:
I've gone through the process of setting up Entity Translation and get the option for Translation, (for example a basic page). When editing the node, I get the translate tab, but see nothing there that actually translates. It appears that the functionality is the ability for the user or admin to supply the translation, and Entity Translation provides the link to the proper content depending on the translation option(s) specified by the user or browser, or other language selecting trigger.

I was hoping for an actual translation of content. Does that happen, or can it happen?

Modules installed and/or enabled on 7 include:

Entity Translation
Title
Entity
i18n
Variable
Localization Update


texts: Allow anonymous users to load site contact form without granting admin privileges

texts:
I'm including the site contact form on a page with these 2 lines.

  module_load_include('inc', 'contact', 'contact.pages');
  print render(drupal_get_form('contact_site_form'));

The page loads as expected when a user is logged in, but for an anonymous user the page returns a 403.

If I give the "Administer contact forms and contact form settings" permission to anonymous users, then the page will load for anonymous users. I gave the "Use the site-wide contact form" permissions to anonymous users, but they still get an access denied error.

Is there a way to allow the form to load for anonymous uses without giving them admin privileges?


texts: Fatal error: Declaration of ... must be compatible with

texts:
/**
   * {@inheritdoc}
   */
  public function blockForm($form, FormStateInterface $form_state) {
    return [];
  }

in BlockBase.php

vs

/**
     * @inheritdoc
     */
    public function blockForm(array $form, FormStateInterface $form_state ) {
       $form = parent::blockForm($form, $form_state);

       $form['city'] = [
        '#type' => 'textfield',
        '#title' => $this->t('City'),
        '#default_value' => $this->configuration['city'],
       ];

       return $form;
    }

in CustomWeatherBlock.php

Adding array in first argument as typehint of $form gives above error.
I just need to understand why is it giving an error.Is it because BlockBase is an abstract class and CustomWeatherBlock class extends BlockBase hence it needs to copy exactly the methods name and its arguments (including typehint) ?

Error

  ( ! ) Fatal error: Declaration of
  Drupal\custom_changes\Plugin\Block\CustomWeatherBlock::blockForm(array
  $form, Drupal\custom_changes\Plugin\Block\FormStateInterface
  $form_state) must be compatible with
  Drupal\Core\Block\BlockBase::blockForm($form,
  Drupal\Core\Form\FormStateInterface $form_state) in
  /Applications/MAMP/htdocs/d8jsonapi/web/modules/custom/custom_changes/src/Plugin/Block/CustomWeatherBlock.php
  on line 16


texts: Do exposed filters work in Views 7.x-3.3?

texts:
When I create a filter, check the expose filter box, click save, then open the filter up again the exposed filter checkbox is uncheked...

I noticed when clicking save the filter is called: "Content: Assessment (or Unknown) | Settings" instead of "Content: Assessment (exposed) | Settings"

Anybody know what's going on here? I've tried creating an entirely new view and the same thing happens.

The field I am exposing is a simple taxonomy list.

I created a short video showing the issue:
http://www2.intensiveintervention.org/views_issue/

I found a thread on a seemingly related issue: http://drupal.org/node/1343482 but this did not solve my problem.

Downgrading views to 7.x-3.1 did not have any effect.


texts: Error when trying to load taxonomy term name from tid

texts:
I am trying to replace a view name with the name of a taxonomy term that is determined from a url argument.

When I explicitly set $tid, the following works flawlessly:

function hook_views_pre_render(ViewExecutable $view) {
  $tid = 2;
  $term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid);
  $name = $term->label();
  $view->setTitle($name);
}

However, if $tid is determined from my argument, as in:

function hook_views_pre_render(ViewExecutable $view) {
  $tid = $view->args[0];
  // or alternatively $tid = intval($view->args[0]);
  $term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid);
  $name = $term->label();
  $view->setTitle($name);
}

...then I get the following error:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function label() on null in hook_views_pre_render()

...on the line containing $name = $term->label().

I am at a loss as to why this is happening. When I inspect kint($term) in either situation, all of the data for the loaded term appears to be available. I've also verified that:

if   $tid1 = 2;
and  $tid2 = intval($view->args[0]);
then $tid1 === $tid2


texts:
I want to make a frozen copy of a drupal site (D6) and prevent users from making any changes whatsoever (except for the system adminstrator, if possible).  How can I do that?  I want to keep the usernames.

Hiding the login block is easy, but the login url is still available.  I've tried disabling all passwords by setting the hash to 'x', but still, someone could recover access via email, and login.  So, I want to prevent password recovery too.  I could alter all email addresses to something invalid, such as {uid}@example.com.  But I don't want the system to even attempt to send email to these addresses.

The site is used for a yearly campaign/contest.  I want to keep results of previous contests online, for reference, at a different url, and I don't want anybody changing anything.  Ideally, I would structure the site so it keeps previous contest results in the same database, but that requires extensive changes which I don't have the time to do.


texts: Updating core modules independently of core?

texts: We have a vendor that is asking us to assist them in updating a core module independently of core.  Is there such a thing?  For example, could you update Views without updating core?  My understanding is that's not doable.


texts: Drupal 7 Date - Is there a way to change field settings if there is data in it already?

texts:
Currently I am using the date module for drupal 7 and I already have stored data in the existing date field. I want to make changes to the date field by adding "Repeating Dates", but obviously I cannot since I have data in there already. The options I came up with are:

Create a completely new date field for the content type with the additional "Repeating Dates" feature. Then copy all the old dates into the new field (im not sure how to do this easily)
Modify the existing Date field table via phpmyadmin or mysql console.

What is the suggested way to go about updating an existing field that already has data?


texts:
I have installed Drupal. I followed a tutorial in Lynda.com that uses Acquia Dev Desktop, and then the core Drupal inside. (http://www.lynda.com/tutorials/73655-2.html)

I'm not sure if it is the best way to install Drupal. Anyway, it works. But now I need to access to the web from another laptop that is in another room. I can't.

When I see the web in the original mac, I have: http://nameofproject:8082/

From a second mac, to access to the Drupal web installed, I tried and it doesn't work:

http://IPnumber:8082/(This drives me to the generic Acquia Drupal site)
http://IPnumber:8082/nameofproject
http://IPnumber/nameofproject:8082/
http://IPnumber/nameofproject/


texts:
I am building a view with fivestar infos under the voting widget which look like this with the views preview:

But it is rendered without the infos in the page:

In both cases I'm an admin user identified.
 I notice that a whole div with the description class available in the views and including the average/total votes infos is not rendered in the final display.

Is there some configuration to do ? Permission don't seem to be the problem.

EDIT: So the main issue comes from the theme which is hardcoded from scratch and nothing is displayed unless it is willingly preprocessed or regenerated in a view. I found my way out (see below)


texts: How do I use a preprocess function for a custom template?

texts:
The content of this page is taken from a template file called
hello-world.html.twig
In my module file I have created the following
hello.module file
function hello_theme() {
  return array(
    'hello_world' => array(
    'variables' => array('account' => NULL),
    'template' => 'hello-world',
  ),
}

function template_preprocess_hello_world(&$variables) {
  $variables['test'] = $variables['account'];
}

In my controller file I have called the theme as following
function hello_world_browse() {
  $output = array(
    '#theme'=>'hello_world',
    '#account'=>'testing',
  );
  return $output;
}

When I try to print {{ test }} in hello-world.tpl.php twig file it is not printing.


texts: Trimmed body field only show first paragraph

texts:
(update: it not a problem relate to uppercases)
I think I found a bug but not sure which module is causing it. Maybe CCK...

I have a content type with the body field set (through manage display) to be shown as Trimmed to lenght: 400

Then I created a node with 2 paragraphs of text in the body . When I load the full view of the node the trimming only shows the first paragraph

the trimming works fine if I enter this text in the body:

some text, some text, some text, some text, some text, some text, some text, some text

the trimming also works fine if I enter this text in the body (notide that the second paragraph is a short paragraph)

both paragraph are shown
some text, some text, some text, some text, some text, some text, some text, some text

but only the first paragraph is shown if I enter this text in the body (notice that the second paragraph is longer)

only this paragraph is shown
some text, some text, some text, some text, some text, some text, some text, some textsome text, some text, some text, some text, some text, some text, some text, some textsome text, some text, some text, some text, some text, some text, some text, some textsome text, some text, some text, some text, some text, some text, some text, some textsome text, some text, some text, some text, some text, some text, some text, some text

How can I solve this?


texts:
I'm currently working on a drupal module and I want to print a specific form called by a shortcode. So I've use this tuto and here is my code :

Info :

    function custom_shortcodes_shortcode_info() {
      $shortcodes['form'] = array(
        'title' => t('Link form'),
        'description' => t('A simple form.'),
        'process callback' => 'custom_shortcodes_shortcode_form',
      );
      return $shortcodes;
    }

Callback:

    function custom_shortcodes_shortcode_form($attrs, $text) {
      $attrs = drupal_get_form('custom_shortcodes_shortcode_form_attributes');
      return $attrs;
    }

Form :

    function custom_shortcodes_shortcode_form_attributes() {
      $form = array();
      $form['PrjLogement'] = array(
        '#type' => 'textfield',
        '#title' => t('Field1'),
        '#required' => TRUE
      );

      $form['MenageRevenuM'] = array(
        '#type' => 'textfield',
        '#title' => t('Field2'),
        '#required' => TRUE
      );

      $form['MenageApport'] = array(
        '#type' => 'textfield',
        '#title' => t('Field3'),
        '#required' => TRUE
      );

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

      return $form;
    }

Now the thing is that every time I'm calling the form with the specific shortcode the output is just "Array".
Is there any way to print this form ?
Thanks in advance for your help.


texts: No data returned when SSL enabled for REST server via services module

texts:
I am running a LAMP stack on CentOS with Drupal 6 and the latest Services module. Over HTTP the REST server I have running works fine and behaves as expected.

When I installed an SSL certificate I forced all port 80 traffic to 443 (SSL). This worked fine for Drupal but has caused the REST server to return no data. Naturally I have removed the force SSL and allowed both HTTP and HTTPS for the time being.

I am testing via Fiddler, which when used to access the endpoint over HTTP, returns the expected data. Testing over HTTPS I receive no data. Do I need to make a configuration change to the REST server?


texts: Override default profile view with profile2's profile fields

texts:
I have made 2 profile 'A' and 'B' with profile2. Profiles are searchable by all users including 'anonymous' user type.

A user search for user named 'a' then search result appears. When I click on that result, it shows default user profile view (Only History: Member for) not the profile2 fields associated with user 'a'.

As I want to show profile2 field in search not the just default one. Please help in this regard.


texts: How to place a users role after username in Forums

texts:
On my site, i have the Forums module enabled.

Please is it possible to put a users role in parenthesis next to the users username in the Forums?

For example "Brian (Student)" and David (Teacher)".

Thank you.


texts: How to run module code on a specific page/path?

texts: So, I'm working on an implementation where users will be redirected to a specific path on a Drupal 7 site with query parameters appended to the URL in an Oauth2 scenario (e.g. www.mysite.com/mypath&code&scope) which the D7 should process and respond to. How does one specify within a custom module to run the code a particular path? Would this be achieved through a code block?


texts: How to use Views to make a Block that displays a field from the author's profile?

texts:
using Drupal 7.

I have added a field in the user account settings called "author summary" (field_author_summary)

When a user is editing their profile, they can enter a brief description of themselves into this field.

Now, the goal is to display this information as a block, directly under the content they are the author of.

I can't figure out the proper contextual filters and/or relationships.

Any ideas?

Thanks!\


texts: How to display translated options for list(text) fields with field_view_field()?

texts:
I have set up a list(text) field with translated content.

In display admin interface (admin/structure/types/manage/***/display), I have set up it to "Default translated" in "format" column. Then if I display the node, the options are well translated.

But when I try to load this field programmatically, I have always the main language displayed (instead the translation).

Here is the way I proceed.

$specialisations = field_view_field('node', $node_object, 'field_sp_cialisations_liste', array('type' => 'i18n_list_default','label' => 'hidden'));

render($specialisations)


texts: How can I add code that will call the javascript within a block every minute?

texts:
I have a block that contains javascript which calls a website that sends an ad to this block (see below: Note: I changed the domain name to adserveringwebsite).
How can I add code that will call the below javascript every minute so that a different ad will show up every minute instead of just one ad at page load?

<script src="http://www.adserveringwebsite.net/1e-kn99655"></script>


texts: How to specify Google Chart API options for altering generated charts when using the views integration?

texts:
I have a series of pie charts being displayed through Views and the Views Dataviz module. I've also experimented with other chart modules that use the (interactive) Google Charts charting engine.

When these charts are generated through their integration with the Views module, I wonder how I can alter the chart output by using the options in the Google Chart API (options such as colour, legend, font size, etc).

I've looked in the code of individual charting modules, but I'm not sure where I can customize the output of the charts.


texts: Using drupal_add_css to dynamically add inline CSS based on term reference

texts:
I'm trying to create a CSS class called .bg-unit-color which will change depending on the taxonomy reference chosen

I've set up a course category taxonomy and then set up a color field within it using jQuery Colorpicker module.  I've got to the point where I can render the color in my node--example.tpl.php file with the following:

<?php
$term=taxonomy_term_load($node->field_example_category['und'][0]['tid']);
$category_color=field_view_field('taxonomy_term',$term,'field_example_category_color');
echo render($category_color);
?>

I've also used the drupal_add_css function in my template.php file, so this works:

$new_color='black';
drupal_add_css(".bg-unit-color {background-color: $new_color;}", 'inline');

However I can't marry the two together to create what I'd like to do which is this:

drupal_add_css(".bg-unit-color {background-color: $category_color;}", 'inline');

Any help would be massively appreciated. Thanks in advance


texts: How to display elements responsively side by side using Bartik theme, similar to bootstrap grid?

texts:
I am developing a module for Drupal 8, currently using the default Bartik theme. My module defines some pages through twig templates. As I am displaying several sections of a dashboard, I would like to show two DIVs next to each other side by side.

I am looking for something similar to the Bootstrap Grid. I am even thinking to just try to use Bootstrap inside my module regardless of the Drupal theme, as I used Bootstrap before but I am new to Drupal theming.

Is there some way the Bartik theme (or different Drupal 8 theme) provides to display elements responsively side by side?


texts:
I'm trying to build a system where I have people, departments and facilities but they must link through a triple join table.

Basically, a person can belong to multiple departments OR can work multiple locations, but a department can be at multiple facilities (imagine a sub company with multiple locations at different buildings).

I'm wondering what is the best approach to build this in Drupal. Should I use a custom entity to tie these content types together?

I tried using Entity Reference but it doesn't seem to solve my problems as I was hoping for. I thought about creating another content type for Person-Location-Department but I was thinking on having these relationship get generated on the fly when creating a person.


texts:
I wrote a simple module that uses hook_theme().

/**
* Implements hook_theme().
*/
function test_theme() {
  'upload_page' => array(
  'template' => 'templates/upload_page',
  'arguments' => array(
    'uploadurl' => NULL,
    'options' => NULL,
    'title' => NULL,
    'user' => NULL),
   )
}

I still have an error.

  Warning: include(./sites/all/themes/test/templates/upload_page.tpl.php): failed to open stream: No such file or directory

How do I change this path to ./sites/all/modules/test/templates?


texts: How to make a complex grid layout with the Omega theme?

texts: How do I make a complex grid layout with the Omega theme where regions can be embedded in regions? I included an image of how I want the page layout to be set. Right now I'm thinking that I will use the CSS property in the Views UI to manually set the grid-[columns] and alpha or omega properties of the Views block. Is there a better way of doing this so the code is in a logical place and not a hack?


texts: Get labels from fields ordered on block plugin - Drupal 8

texts:
I'm trying to create a block with a label list using all labels of a specific field type, entity_reference_revisions.

I created a Block plugin and load the EntityTypeManager service.
I tried:

    $values = array(
      'targetEntityType' => 'node',
      'bundle' => $bundle,
      'mode' => $view_mode,
      'status' => TRUE,
    );
    $entity_view_display = $this->entityType->getStorage('entity_view_display')->create($values);
    $fields = $entity_view_display->get('fieldDefinitions');
    $labels = [];
    foreach ($fields as $field) {
      if($field->getFieldStorageDefinition()->getType() == 'entity_reference_revisions') {
        $labels[] = $field->get('label');
      }
    }

The problem is that I get the fields in a wrong order, and I can't get the weight attribute.


texts: Adding jQuery UI selectmenu() to Drupal form

texts:
I'm trying to add a styling to the select form elements in my Drupal form using jQuery UI. I'm using Drupal 7 so the usual way to add jQuery UI would be something like this:

 drupal_add_library('system', 'ui.accordion');
 drupal_add_js('jQuery(document).ready(function(){jQuery("#accordion").accordion();});', 'inline');

However, when I try to add an effect that isn't bundled with Drupal 7 core, like this one, that approach doesn't work. Has anyone come across this problem before, and if so, is there a "standard" Drupal way of solving this?


texts: how to use hook_cron_queue_info in a custom module?

texts: I am retrieving remote data by clicking an update button. I want to make it automatic. I read many articles about it but I didn't find a good example for using hook_cron_queue_info in my module. can anybody help me?


texts: How to add up all items of a field collection field using Rules?

texts:
I have a field collection with unlimited values.

Inside this field collection, there is a field called Price (field_price).

I would like to addup all prices that are inside the field collection to get the total value (which I will then set to the total value field that is inside the content type).

I know I can get all the prices like this:

But the tricky part is adding them up.

I tried adding Calculate a value to the loop but for data selectors I only get something like this:

And list-item:field-price is not available either.

All signs point that this is not the right approach.

Race ya to the answer.

  And list-item:field-price is not available either.

Turns out that I was in the right path all along, the reason this was not available to me when I tried to do calculate a value is because I had changed my price_field type to text-field. You can't do calculations on non numeric fields. After I changed it back to decimal, I was able to use list-item:field_price.


texts:
I'm using the Entity Reference module to relate different unique, particular pieces of equipment (identified by unique serial numbers) to different orders.  Equipment and orders are content types.  On the Order content type, I have an entity reference field with an inline entity form widget (autocomplete) for the user to scan in the serial number and form the relationship.

The problem is, the serial numbers could be in Hexidecimal or Decimal format, and the users should be able to use both interchangeably.  Thus, if a user is creating an order and scans in the decimal serial number, the system should be smart enough to associate that with the correct piece of equipment, even if that serial number was entered in hex.

Entity Reference seems to have a limitation here, in that all of the widgets I've found seem to only reference the "title" attribute of an entity.  Is there a way to make this attribute support multiple values, or to have Entity Reference reference nodes using multiple uniquely-valued fields (or maybe a single field with multiple globally-unique values)?


texts: What is the menaing of print t(); in following code?

texts:
I was referring the html.tpl.php to learn the theming guide for drupal 7, and found following code line in html.tpl.php,

<a href="<?php print $skip_link_target; ?>" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?>

Can anybody let me know what is the print t() in <?php print t('Skip to main content'); ?>.
Is it translation function or something else?


texts:
I'm trying to create a pager in Views from content structured by entity reference fields.

I have content Types Stories and Chapters. Chapters reference Stories so you have multiple Chapters organized per story. They chapters are sorted by an integer field in Chapter as Chapter number so it goes.

stories/Story ID(SID/Chapter ID(CID).

Now, part of my navigation is a drop down menu that shows all chapters that reference the same story sorted by chapter number.

What I need is the next/prev pager links that go one foreward and one back. I could use some help figuring this out if anyone has any ideas on this. I'm not sure how to create that part of it.


texts: How to find out which context reaction is firing?

texts:
im creating some pages that have specific layouts for tablets and mobiles, to send a targeted view and template im using context, context breakpoints and delta.

But i need some way of seeing which context reaction s being fired as on some pages an endless auto-reload is occurring, i think it might be due to some paths having multiple reactions, so im looking for some way to see which reaction is being fired and getting buggy


texts: display suite: limit field - determine what bundle values?

texts:
In display suite, there's a field to limit which bundle it's being displayed on.

How do you know what bundle / value to enter?

Is there a way to list all available values or find out all the values? Or does it go by the machine name?


texts:
Is there a way to let visitors to my site watch a video via a live stream?

For example, I want to let students watch a course in which a professor lectures live?

How can I do this easily?


texts: Can you filter views user list result based on the current users role

texts:
Is it possible to have the result of a views user list only contain users with a specific role that the current user also has?

I'm not familiar with Views, but it seems to fit the bill for making a better looking and more usable user list than the one that comes standard with Drupal. However, I need to have the user list filtered.

I setup multiple user groups that are identified by a specific role (like groupmember - group A). Admin users of that group have an additional admin role (like group manager), but they should only see users in their own group when using the view.

Can something like this be done? I'm writing modules so I could use the api if that is the way to go. I'm using Drupal 7.


texts: What are recommended modules or processes which support rating based comments or reviews?

texts:
I am new to Drupal and I am planning a directory site where users can review and rate the service of a shop or company.

I'm thinking of something like this (taken from yelp.com):

Any recommended modules or processes which support such feature in Drupal 7, i.e. for rating based comments or reviews?


texts: Can I use panels (page_manager?) to layout create/edit forms pages for arbitraty entity?

texts:
I am new to panels and display suite both and trying to figure my way around those modules.

In "Display Suite" with "Display Suite Forms" you get an extensive list of all entities and bundles and can override any of the create/edit form layout.

In "Page Manager" I see only 'node add form', 'node edit form' and 'user edit form' context out of the box. Is there a way to generalize it and use "Panels" functionality with other entities on the site like Display Suite does it? I mean, without writing code.

What I want is to take existing entity, say 'commerce_customer_profile' and automatically have its 'X edit form' and 'X add form' contexts available in Panels. Or something equivalent.


texts: Override Taxonomy Term Path to Contextually Filtered View

texts:
This may be highly specific, but I still think it has value for sizable number of applications in the wild, so here we go:

I have a View established using Contextual Filters
The Contextual Filters run against Taxonomy Terms
The Taxonomy Terms are fields in a Field Collection
The results of the View are also Grouped by the Taxonomy Terms which are displayed as a Rendered Taxonomy Term (which links to the Taxonomy Term page)

I want to override the default linking in the Rendered Taxonomy Term to initiate the Contextual Filtering -- rather than visiting the Taxonomy Term page (which has no relevancy here).

I tried, what I thought should work, and overrode the Taxonomy Term paths (url alias) -- only to end up with the oft encountered "page not found" issue.

My other option is to remove the link in the Rendered Taxonomy Term to avoid confusing visitors; however, the value of being able to carve the master list (it's a phone directory - hence Field Collections and not full custom Content Type entries) into segments is appealing.

Anybody have any ideas or suggestions?

I have overridden the template using taxonomy-term.tpl.php to remove the link (as noted in How to remove link from rendered node title in view? -- see the comment from @smile for concise directions.). Still open to suggestions on path overrides though.


texts: How to display a default value for minute field of Time fieldtype

texts:
I have a Time component in my webform. When I go to my form I see Hour is selected by default in the Hour field but I see 00 is selected by default in the Minute field.

How I can set Minute as the default value in the Minute field?


texts: Drupal Commerce: How to select the product Variation by it's own thumbnail?

texts:
Want to select the product variation by it's own thumbnail instead it's color.
The module Fancy Attribute only shows separate images or colors, but not the thumb from the product variation it self.

Example:
http://www.amazon.de/dp/B00WGEQ7OQ


texts: How to disable webform select box with jQuery without resetting selection value to default

texts:
I have a webform, below's a section of the form (the selection field)

<select id="edit-submitted-bring-alcohol" name="submitted[bring-alcohol]" class="form-select">
    <option value="yes" selected="selected">Yes</option>
    <option value="no">No</option>
</select>

I now use jquery to dynamically setup this field.

if (age < 19) {
    $('#edit-submitted-bring-alcohol').val('no');
    $('#edit-submitted-bring-alcohol').prop('disabled', true);
}

This works great. When user entered their age, this method automatically change the selection to 'no' (if they are under 19), and disabled by itself.
However, the problem I have now is that the submitted value I received is 'yes' when the selection field is disabled (apparently it chooses the default value).

So could anyone help me out?


texts: implementation of hook_menu() is not working

texts:
I want a page where a user can create 3 different content types : "Machine" , 'Equipment" or "Services" .
My goal is to implement 3 tabs for each content type node creation form.

I implemented hook_menu like below :

function MyMODULE_menu() {

  $items['instrument'] = array(
    'title' => 'Instrument',
    'type' => MENU_NORMAL_ITEM,
    'menu_name' => 'main-menu',
  );

  $items['instrument/machine'] = array(
    'title' => 'Machine',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => 'product_node_form',
  );
  $items['instrument/equipment'] = array(
    'title' => 'Equipment',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => 'equipments_node_form',
  );
  $items['instrument/service'] = array(
    'title' => 'Service',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => 'member_profile_node_form',
  );

  return $items;
}

After enabling my module, I expected that the menu item should be in main menu, but it wasn't there and I got a 'page not found error' when targeting "mywebsiteaddress/instrument" .

Where is my mistake?


texts: Force a single value base field to be in a separate table?

texts:
I have a custom entity type (eg: myentitytype), and I would like to add a new base field to it via hook_entity_base_field_info(). As I understand it, single value fields (with a cardinality of 1) will create new columns in the myentitytype_field_data table, but multi-value fields will create a new table.
My question: is it possible to force a single-value field to be stored in its own database table, rather than adding columns to the myentity_field_data table?


texts: How does the global variable $user work?

texts:
Here is my scenario:

I create a new user and dynamically create for him some content on which he is the owner.

Each user can log in, see his content and edit his profile. I use a block in which I have a menu links to each content and to his profile.

The theme output of the block function uses global $user; to get the current logged user.

However, the strange thing is that $user->uid return the last created user in the system and not the current logged user. Also the $user->language is of the last created user in the system. Why?

The user logs out with user/logout; this is the command to log out, right? Do I need to do more after user logout such as GLOBAL variable resets?


texts: Access Views fields in a module/template.php file

texts:
I am using View template files to do custom theming of my views.

My custom code is a bit complex, so I want to put it into a function in a custom module (or even my template.php* file). That way, I can keep my template file clean and re-use the same code between multiple Views templates.

In a Views template files, fields are called with the following code:

   <?php  print $fields['field_name']-> content ?>

However, this code cannot be used inside a module.

How can I call a Views field inside a module/template.php file?

At the moment, I have created Variables in my function. Then when I call the function inside a views template, I assign the Views fields to the variables. However, this makes the code quite complex. It would be better if I could just call the fields from the module.

*By template.php I mean the file called template.php and not a tpl.php file.

Example

I have a field called body text. In my views tpl.php file, I would render it with the following code:

 <?php  print $fields['field_body_text']-> content ?>

How can I call that Views field inside a module function, and then call that function in the Views tpl.php file, so the field renders?

Extra info:

In my project, I have two list based fields called call_to_action_setting & second_cta_setting. I also have several text fields, but not all of these are rendered on every page. In my views-view-fields--view-name.tpl.php file, I check the value of the list fields and then display the appropriate text field, using views_field_compare_value.

Here is the code that I use in my views-view-fields--view-name.tpl.php.

It is quite complex for a template file. Plus, I am using it in several template files, so I want to make it a function that can be stored in a module.

Here is how I have put it into a module. I can then call it inside views-view-fields--view-name.tpl.phpn using the following function:

<?php
$cta_settings = $fields['field_call_to_action_setting'];
$cta_settings_2 = $fields['field_second_cta_setting'];
$custom_text =  $fields['field_call_to_action_button']->content;
$custom_link = $fields['field_call_to_action_link']->content;
$custom_prompt =  $fields['field_call_to_action_prompt']->content;
$custom_text_2 = $fields['field_second_custom_button_text']->content;
$custom_link_2 = $fields['field_second_cta_link']->content;
legendarysettings_call_to_action($cta_settings, $cta_settings_2, $custom_text, $custom_link, $custom_prompt, $custom_text_2,  $custom_link_2);
?>

This function, though, is quite complex, so it would be better if I could call the Views fields directly from the module.


texts:
i have made a custom theme "Custom_stark" and
made changes into .info file and added the triptychs

regions[triptych_first] = Triptych first
regions[triptych_middle] = Triptych middle
regions[triptych_last] = Triptych last

in Custom_stark.info.

But when I see with block " Demonstrate block regions (Custom_stark) "

i can see only in this default format.

And how can i get the triptych in desired format mention in below image

And below is the code for page.tpl.php

<?php if ($page['triptych_first'] || $page['triptych_middle'] || $page['triptych_last']): ?>

      <?php print render($page['triptych_first']); ?>
  <?php print render($page['triptych_middle']); ?>
  <?php print render($page['triptych_last']); ?>


texts: Body Class, Drupal 7, change language name programmatically

texts:
I am trying to add a the language being displayed in the html body class. Drupal 7 for example, when i open firebug  it displays the body class  with these values

body class=html not-front logged-in no-sidebars page-node page-node- page-node-187 node-type-page toolbar toolbar-drawer i18n-el show-grid no-rgba

Is it possibe to add the language as lang-el instead of il8n-el?
Which file is it responsible for outputting these values?


texts: I have a batch job that uploads articles to Drupal using the S3FS module. I come across this error and I am not sure how to fix this. Is there a way to fix this issue? I am using Drupal 7.


texts: How to provide link to styled image in a services feed

texts: On our Drupal 7 site, we use the the services module to provide a feed for our internal news to pick up. With services, you create a view for all the data to provide. It is current giving the location of the original image for our images field (File: Path) that comes out http://oursite.com/sites/default/files/post.jpg. We want to provide a link to the styled image (already resized) that should look like https://oursite.com/sites/default/files/styles/downpage_art/public/field/image/solar_panels700x425.jpg?itok=P4VrgCIH. I don't see this as an option in the view we have for our feed.


texts: Is it possible to show notification in MacOSX or Safari?

texts:
I'm using Drupal latest version with lot of modules.
As you know, websites can Show notification in Notification center and/or Safari in Mac OSX.
I see that, Wordpress has a module for this.

Is it possible to do it for Drupal?


texts: Toggling not working properly in node--contenttype.tpl.php file

texts:
I am theming a node of type "test".
I am using toggling in this "node--test.tpl.php" file.

Below is my code in "node--test.tpl.php":

Property

    MLS #:

    <?php echo $node->field_listing_id['und']['0']['value'];?>

code in javascript file is

 (function ($) {
        $('#block1 > a').click(function()
       {
        $("#block1_content").toggle("slow");

         });

  })(jQuery);

Loading the java script files in template.php

drupal_add_js("themes/bartik/custom.js", $type = 'file', $media = 'all', $preprocess = FALSE);
drupal_add_js("themes/bartik/jquery.min.js", $type = 'file', $media = 'all', $preprocess = FALSE);

jqueries and jquery plugins are enabled in modules.

but toggling is not working.

How to do toggling using jquery


texts: How to reorder Book module menu through Database?

texts:
How to re-order Book menu faster, optionally through Database?

I have a big problem to reorder menu/ navigation for Book module....

It is supposed by drag-and-drop - I have 318 items in list , some 100 items to drag down for some 200 items; dragging seems refusing to work, as well as assigning weights....

(dragging was working on other menus, still taking a lot of time, because they are placed by default alphabetically not as submitted)

Is there any way to arrange those navigations faster or in database?


texts: How to show a Views Slideshow block on a basic page with images from only one node

texts:
I have a page with an URL like this: example.com/albums
On this page i'd like to show a Views Slideshow with all images from the latest album node and JCarousel pager items.
This Slideshow would for example show all the pictures from an album node that was added yesterday. When a newer album node is added, this one will be displayed in the slideshow.

The goal is to have a featured album slideshow, show at the top of the page of for example an event that took place yesterday.

The problem i'm having is that my Slideshow and JCarousel is showing the images from every album node, instead of just the ones from the latest one.

Normally I would add a Slideshow on the node page itself, so that I could use the Contextual Filter -> Content: nid -> default value -> ID from URL.
But I cannot get the ID from the URL, because the Slideshow is added as a block to my /albums page with no ID in the URL.

Setting the pager to only show '1' item is not an option either, because then the slideshow will only show one image. When I set it to 'Display all items' it shows all images from every album node again though.

Is there a different way to get only the data from one unique node without looking at the ID in the URL?

View image if it helps:

Thumbnails is used as pager for the slideshow
Content: Sfeerimpressies is the images field.
Both have 'Display all values in the same row' unchecked.


texts: How do I load taxonomy terms basing on the current language?

texts:
I am using the following code.

$language =  \Drupal::languageManager()->getCurrentLanguage()->getId();
$terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree('category', 0, 1);

How can I change it so it load the taxonomy terms basing on $language?


texts: How to extract data from DB into fields?

texts:
How would I go about extracting the data from a DB into fields? I would like to display information on a page using Views, but the information isn't on the website, instead it is in a separate database. Is this possible?

I get that in order to use Views I need to have fields, but how do I extract this?


texts: Redirecting %20 Based URL to Non %20 based URL

texts:
I have a URL suppose http:www.domain.com/somepath%20%20

When i open the above URL, it exist with both URLs http:www.domain.com/somepath and http:www.domain.com/somepath%20%20

I would like to know how can I redirect %20 based URL to Non %20 based URL

P.S I have made this page using Panels.


texts: Gift Certificates for Ubercart 3 & Drupal 7

texts:
We would like to add gift certificates to our Drupal 7 site running Ubercart 3.  There was a module (UC Gift Certificate) for Drupal 6, which has not been ported to 7.

There appears to be some talk about using UC Discount Coupons, which has been ported to 7, to achieve this functionality, but I am very skeptical (because it was not designed for this, and one immediate problem with it is that there does not seem to be a way to partially redeem a discount coupon.)

Has anyone successfully setup gift certificates on Drupal 7 with Ubercart 3?  If so, how?


texts:
I would like to receive some input on how you guys would approach the following:

We have an internal Projects Database application that was intially developed in ColdFusion and Microsoft SQL, approx. 5 - 6 years ago.

We now want to rebuild the entire application on the Drupal platform (with entities) and of course a Mysql Database, so far so good.

Now,

I am wondering how we approach the datamigration from one platform to the other.
Basicly we want to migrate all the database records to the new Drupal database structure once the project is finished.

-> Do we need to try and match the database structures when we are developing the platform in Drupal? Or will we have to write a migration script that matches all records one-by-one anyway?

-> Are there tools out there that can assist us in this project?

Developing the new, empty Drupal platform is not a big deal, it's a lot of work (a lot of fields and views basicly), it's the data migration from the old one to the new one that i would like to receive some opinions on.

Thanks for your advice in advance!

Best Regards,


texts: How to install certain modules only for specific site using Acquia Desktop

texts:
I am using Acquia Desktop for creating multisites.
Problem is whenever I am installing a module it gets replicated in everyother site.
What i need to know is that if i want to have a module only for specific site do i need to first manually create a modules folder inside the site folder such as practice.localhost\modules (where practice.localhost is the site name) folder as the modules directory is not created by default for any of the subsite folder.? Is my approach correct
Moreover I have also heard that if we create modules for specific sites then we are going to find it difficult to export sites to FTP for making the site go online.?


texts: How do I disable the "Continue to payment" button before the shipping method is selected?

texts:
How do I disable the Continue to payment button before the shipping method is selected?
I use #states to disable the button, but it doesn't seem to work.


texts: How do I split a contact form into multiple pages?

texts:
I have a huge form that's way too large for a single page. I would like to split this form up into a few separate pages.  What are my options?

Edit: Still haven't figured out how to do this with Drupal 8.


texts:
I can't understand how to install Owl Carousel module for Drupal 7.

I installed module from here - https://www.drupal.org/project/owlcarousel
And downloaded additional files from here - https://owlcarousel2.github.io/OwlCarousel2/

Put this folder in "sites/all/libraries" and managed fields for my content type. I can see few images on my page, but carousel doesn't work.

Here is the error from chrome console - "Uncaught TypeError: o.owlCarousel is not a function"
"GET https://mysite/owl.carousel.min.js?p44xlt net::ERR_ABORTED"


texts: Auto Complete for product variations use

texts:
Is there a way, when hiring for Attribute field setting

  (admin/commerce/config/product-variation-types/bags-cases/fields/field_color)

to add an additional choice added.

I need urgently an auto-complete feature in the frontend for the field type term reference.

For a very large amount of product variations, it is otherwise with a 5 meter long drop down menu very user unfriendly (+4000 zip codes for a single service).

With the Finder module, I could not solve the problem unfortunately.


texts:
We can find many discutions on how to sync ldap to drupal, or use ldap to auth drupal users, but my goal is totally different :

My goal is this :
Use drupal to manage user accounts (add/edit/delete users), then
use LDAP to share drupal users with an other website (redmine)

So the idea is that drupal send users to LDAP then redmine website use LDAP for login.

Drupal users don't have to ssh login into my server of course...

I've found no doc, no tuto on how to setup drupal LDAP module to match with my use case. So here i am.

Considering :
I have installed openldap on my debian server, and also ldap authentification module in drupal. More over i have setted up drupal and can querry my ldap server from drupal admin panel.

Questions :

1) Is there a doc or tuto somewhere explaining how to sync drupal users to LDAP?

if no

By default posix user template contains useless attributes for me, like homedirectory or loginshell

2) So, do i have to define LDAP templates to match with drupal?

3) i've made some tests to sync users, but drupal display no info, what is going wrong? how to debug?


texts: How to make my site's categories appear in Google results?

texts:
I would like my site's categories to appear in the Google results.
For example the bbc.co.uk has the categories "News","Learning English", etc.

Is there any module for this? Has this to do with RDF, microformats, or rich snippnets?


texts: Always prompt for a shipping address even if there are no shippable products with Ubercart

texts:
I manage a site selling online classes. Some classes include shipped items (books, posters, etc); for these classes, the cost of shipping is included in the class price.

Ubercart products are configured as non-shippable, as automated shipping quotes through UPS should not add any additional cost.

I'd like to configure Ubercart (6.x-2.4) to always prompt users to enter a shipping address, without returning an error message when products in the order are not flagged as shippable.

At present, Ubercart will always prompt the user for a shipping address if "Hide shipping information when possible for carts with no shippable items" is unchecked in "Checkout settings." However, it looks like the UPS module will always try to calculate a shipping quote if shipping details are prompted for, regardless of whether items are shippable or not. If this is the case, an error message is displayed informing the user that a shipping could not be calculated.

Is it possible to configure shipping settings to still prompt for a shipping address, while preventing shipping modules such as UPS from returning an error message if no shippable products are configured?

For example:

    Order A: (works with UPS shipping module)
         Shippable_product_A  $10 (shipping $5)
         Shippable_product_B  $20 (shipping $8)
         --------------------------------------
         Total order cost: $30 + $13 => $43

    Order B: (does NOT work with UPS)
         Shippable_product_A    $10 (shipping $5)
         Non-Shipped_product    $15
         ---------------------------------------
         Total order cost: $25 + $5 = $30


texts: On the user edit page, how can I show the "Help text" for my fields after the "Label" and before the selection widget?

texts:
I have a field on the user edit page that looks like this:

Label: What kind of fruits do you like?

(checkbox) Apples
(checkbox) Bananas
(checkbox) Grapes
(checkbox) Oranges
(checkbox) Pears

Description: Check all that apply.

The actual list of checkboxes is quite long (20 or so items) and so I would like to put the description after the label and before the checkboxes-- preferably for all fields displayed using the checkbox widget provided by the select (or other) module.

How can I adjust where the description is displayed?


texts: How to change the revision uid on node save

texts:
I need to change the revison uid of 7000 nodes on a site. So I am using Views Bulk Operations to perform this action, by publishing or saving the the 7000 nodes concerned. Then I use the hook_node_presave to update all contents. But unfortunately, the field revision_uid isn't properly updated. By cons the field log is properly updated..

$field_uid = field_get_items('node', $node, 'uid');
    if($field_uid){
         $node->log = $node->uid;
         $node->revision_uid = $node->uid;
    }

The revision id is still the one I'm using to make this operation (1 to admin..). How can get around this problem??


texts:
Yes, something like that. If block and it's content are loaded in the page (so I guess detect by ID or something) it would load the .js, but if block is not loaded, it wouldn't load the .js.

I need this, because now each time when the block is not loaded, it still always loads the .js from theme in every page no matter what and that code interacts for some reason with other javascript elements like flexslider and it disables it for some reason and etc. Which is bad.

So it should load the .js only when the block is rendered/printed.


texts:
I want to add extra css for my images (I just want to set float:left to them).

I've checked where I need to add my CSS i.e.<div class="field field-name-field-gallery field-type-image field-label-above">.

So should I directly add this class name in style.css file or should it go somewhere else?


texts: Targeting a Specific Contact Form for Altering

texts:
I'm writing a custom module to format the email I receive from a user who fills out a contact form. I've created two contact forms and I want a separate email format for each form.

Code

I'm using this code as the basis of my module

But, I'm having trouble targeting a particular form. This is the code I'm trying to use, but it doesn't seem to be working:

    // further restrict mail_alter to machine name of a particular contact form
    if ($message['params']['contact_form']->id() ==
    'contact_message_contact_technical_support_form') {
    ...code to format message... (from linked article)
}
elseif ($message['params']['contact_form']->id() ==
'contact_message_feedback_form_form') {
    ...code to format message... (from linked article)
}

Question

Would someone please tell me how to properly id my forms so I can target them?


texts: Render a menu differently based on region

texts:
I use Drupal 7 and I’d like to have two menus rendered different: one in the nav bar showing dropdowns links for child pages, and another that simply lays out all links in the sidebar. While I can get this sidebar functionality by targeting a specific menu name, I’d like to apply these rules more generally by targeting any menu that gets placed into the region. Is it possible to select regions in theme_menu_link?
Also open to the idea that I’m totally off on my approach for this.


texts:
I'm confused about the following:

I'm working on a module that creates a interactive Google Maps background, I've added the Javascript to my module ( which is run at hook_init), but when I try to load the page, the maps background doesn't show up.

Before I decided to create a module, I used the same Javascript code which was called on page load through the header-section (through script>src) in my page.tpl.php file, and everything worked as it was supposed to.

So I'm suspecting that, because I call the module with hook_init, my Javascript cannot show up because the API key hasn't yet been validated/declared by the page.

What's the best way to tackle this problem? Can I declare the API key in my .module file? or even my module.js file? Or should I change the hooks to something else, in that case, is there a hook that lets me call the module.js file after the head of my page is loaded?

<?php function maps_markers_init() {
$markerAantal = 0;
$latitudes = db_query('SELECT field_latitude_value FROM {field_data_field_latitude}')->fetchCol();
$longitudes = db_query('SELECT field_longitude_value FROM {field_data_field_longitude}')->fetchCol();

json_encode($latitudes);
echo "<br>";
json_encode($longitudes);
};

And to load the Javascript:

function maps_markers_page_build(){
drupal_add_js(drupal_get_path('module', 'maps_markers') .'/maps_markers.js');
};


texts: Error when attempting to create sync directory

texts:
I'm installing Drupal 8 with using Composer. During the requirements verification phase I receive this error.

Requirements problem
Errors found
Configuration directory: sync
An automated attempt to create the directory ../config/sync failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.

As I understand it, the full path to the sync directory should be project_root/web/sites/default/files/config/sync, but if I run chown myuser:www-data to the project_root directory, Drupal will literally place the folder as in the error message, project_root/config/sync in my case.
I've never installed Drupal 8 via Composer, but this appears wrong and I can't find any relevant information.


texts:
I'm using Drupal 6 and FB Connect module, but I can't change Facebook login button design.

What it looks like, now.

What I want it to be.


texts: How do I rewrite attached file field output in Views to override the filename?

texts:
I am trying to build a simple Views Accordion view to display support documents. I created a simple content type with three fields: Group (my category), Document Title, and File. The only way I can get the attached file to appear is by inserting the field Content: File. That links to the file and displays the little PDF icon, but shows the actual filename as the hyperlink text. I would like to use the Document Title field contents as the hyperlink text, but can't figure out the proper way to do this. I have tried hiding the file from display and rewriting the output of the Document Title field to be something like:
    [title]
However, it appears Drupal is rendering the link to the file instead of inserting the path to the file, as it shows the PDF icon and the filename.

Is there a way to override the hyperlink text when showing an attached file?


texts:
I'm trying to apply this to each block in a region:

http://figure-w.co.uk/zebra-striping-in-php/

He is generating zebra striping per div here, which is fine, but I'm wondering how I would apply this to each block in a given region.

Would I use something like block_list($region)?

This code is supposed to go in template.php

function likemind_zebra($id = 'global',
                     $odd_class = 'odd', $even_class='even') {
  static $cursor = array();
  if(!isset($cursor[$id])) {
    $cursor[$id] = 1;
  }
  return $cursor[$id]++ %2? $odd_class: $even_class;
}

I'm just trying to figure out how I would get it to apply to each block in a region, rather than the whole region.


texts: Using PHP namespace hybrid for Drupal modules

texts:
I've been getting into PHP namespaces and had a thought about how to clean things up a bit in my custom modules. I was thinking that for hooks I could use the traditional Drupal method of defining functions in the global namespace with the module name prefix but for all other functions and classes I could define them inside a PHP namespace. So, for my module "donut_win" a file would look like this:

<?php
namespace {

function donut_win_menu()
{
  $items['donut/win/%'] = array(
     'title'           => 'Hey, there!'
    ,'description'     => "Eveyone wins when donut wins."
    ,'page callback'   => 'Donut\\Win\\render_page'
    ,'page arguments'  => array(1)
    ,'access callback' => true
    ,'type'            => MENU_CALLBACK
  );

  return $items;
}

function donut_win_cron()
{
  # magic!
}

} # namespace global

namespace Donut\Win {

function render_page ($bingo)
{
  # so much magic!
}

}

I'm interested in what potential pitfalls would be with this method and any other disadvantages or advantages. Is this a good idea or am I crazy?


texts: Add terms for a specific role not working

texts: I want to add permission to add new term in Vocabulary. I have used vppr and Taxonomy access fix but not worked.


texts: How to ensure successful update after system failure during updb causing the site to remain in maintenance mode?

texts:
Running drush updb to upgrade drupal core or other modules, puts the site in maintenance mode. I recently faced an issue (probably an edge case) where the site was stuck in maintenance mode after running updb in a pipeline of a containerized infrastructure. Here is the sequence of events:

Run drush updb -y
Container terminated (system failure or unknown reason)
Re-attempt at drush updb
drupal returns "no updates were required" (this tells me that the step 1 may have completed the update in the background?"
Site remains in maintenance mode.
I manually bring the site back online.

After all this it looked like the update was successful.
How do I ensure the integrity of the system when this happens without restoring a backup and running the updates again? When running subsequent drush updb that says "no updates required" does this guarantee the previous updates were successful.


texts: How to get rid of added URLs when printing a Bootstrap-themed page?

texts: When I print a page from my Bootstrap-themed site, all the links (and images with attached urls) have a printed representation of the link inserted into the printed page, right after the linked object.  I can see some situations where this would be helpful, but for now it's just messing up my printed layout.  I smell jQuery at work here, but I can't figure out where it is or how I can turn it off.  Any hints out there?  Thanks!


texts: Commerce Kickstart - items won't float side by side

texts:
I'm developing a store using the new Commerce Kickstart 2.  All of a sudden my items in the store are floating one on top of the other instead of items within the same collection floating side by side. For example I have multiple headings of "Notebook Computers" above each notebook computer product and they all float one on top of the other all the way down the page instead of One header and all the products floating side by side.

I took my CSS back to the default and it didn't make a difference.  Has anyone else come across this? I'm not sure if a module I may have installed caused this or a setting within the view may have caused this.  I'm hoping someone else has come across this.
Thanks!
Candace


texts: What to do when a theme doesn't show up in the enabled or disabled themes?

texts: I am moving from one server to another a Drupal 7 site. I have Drupal set up on the new server and modules installed. However, I would like to enable a theme (shoppica, in particular). I have followed the instructions in placing the files in ./sites/all/themese/shoppica, however it does not show up in the list of themes. What other steps am I missing in order to get this theme to show up?


texts: How can I have the site name with a span html tag without hard-coding it in a template? [ex. Good4You]


texts: How can I give relation once content type to other. Eg If I have a product and the product sub items. I need to make a product content and a product_sub_item content type. Also need to select the product while creating the sub item. How to achieve this relation


texts: Filter a Drupal View by a Taxonomy Term Reference

texts: I have a view that generates a block on all taxonomy term pages under a specific vocabulary (lets call this vocabulary 'pages' for now). That specific vocabulary has a field added that is a term reference to a a vocabulary we can call 'pagetype' (you can only select one value). I want my view to display all 'pages' that have the same 'pagetype' as the one that I am currently on. The problem is I cannot figure out how to use the current term's 'pagetype' for the contextual filter instead of the current term ID. Any help with this would be awesome.


texts: How to set value programmatically for mobile number module's field using entity wrappers?

texts:
how do I set value for the mobile_number field using entity wrappers?
Currently, this field is attached to an entity and I'm trying as below.

$entity_type = 'mp_customer';
$entity = entity_create($entity_type, array('type' => 'mp_customer'));
$wrapper = entity_metadata_wrapper($entity_type, $entity);
$wrapper->field_phone = "0777123456";

This gives an PDO Exception .... field_phone_value cannot be null....

Adding more
This field needs more data to store in field_data_field_phone,
those are:
{field_phone_value}
{field_phone_country}
{field_phone_local_number}
{field_phone_verified}
{field_phone_tfa}

This field was created using this module : https://www.drupal.org/project/mobile_number


texts: How do I add a custom script on a specific page?

texts:
I wanted to add custom JavaScript code on certain nodes.
I have written this code in the html.tpl.php template, but this doesn't work. (donate is the path alias for a node.)
<?php if(arg(0) == 'DONATE'): ?>
  <script>
    (function() {
      // ...
    );
  </script>
<?php endif; ?>


texts:
i made a site through artisteer and i wanted to have a different background on each page, i did this with themekey and it worked.
My layout is a header, content and left sidebar with main menu.
The problem is that when i'm on the home page the home menu item is correct and located in the sidebar...when i 'm on the other pages the home menu item is located above the contentblok instead of the left sidebar....what can i do to remove from every page the home item so it only appears in the menul ist in the left sidebar..
Thx in advance
Greetz
fred