texts: How to use Migrate module to import Videos?

texts:
I have a bunch of blog posts from an old site, some of which have .flv videos. I'm using the Migrate module to migrate all of these blog posts and the videos are the only piece left. I'm using the Video module for the embedded videos in my blog posts.

How do I use the Migrate module to import those videos into drupal?


texts: Create node, register, then activate using email and then publish

texts:
I am not sure if this is a rhetorical question but I have not found an answer yet.

I am trying to build a review system.

I have a node - A and and using nodereference url widget I have node - B, which is used to write review about a specific node - A.

Now, when I in permissions set the creation of node - B by only normal users, its all good.

But, I want to engage anonymous users too. So, I was trying to implement, in steps:
1. The nodereference url to be visible (which it shows to registered users) on node - A to be visible to anonymous users too. I have tried to fake it but it doesnt work and takes to login page which I do not want.

Anonymous user should be able to fill up the node - B and when click submit then,
Take the user to registration form, fill it up and,
Due to sites requirement, we have email verification, so when the activation email is clicked by that anonymous user then we publish the content.

I have tried modules,
1. Create and registration
2. r403
3. Anonymous publishing etc.

But nothing seem to be what I want.

I tried achieving this with rules but no success.

Now, I am thinking of creating a custom form and than when the user verifies then use the user hooks and publish it in actual node - B.

Or if I get a new solution here?

Thanks in advance.

anyone?


texts: How can I stop Google Analytics from tracking a certain user?

texts: I have the Google Analytics module installed. How can I prohibit the code snippet appearing on pages served to a particular user. Say user #15, for example?


texts: How to extend ArgumentPluginBase and have it recognized by Views?

texts:
I'm wanting to create a Views argument plugin that extends ArgumentPluginBase in order to overrides one of the form elements in the buildOptionsForm(). I've pasted my plugin below. However, it doesn't seem to be recognized by Views. How do I make Views aware of this plugin and to make use of it?

<?php

namespace Drupal\my_custom_taxonomy_validation\Plugin\views\argument;

use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Resize the override text field.
 *
 * @ingroup views_argument_handlers
 *
 * @ViewsArgument("my_custom_taxonomy_validation_argument")
 *
 */
class MyCustomTaxonomyValidationArgument extends ArgumentPluginBase {

  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);

    $form['title'] = [
      '#maxlength' => 355,
    ];

   }

}


texts:
i am theming a template and currently working shopping cart section. The commerce module provides a view 'Shopping cart block' out of box. I am trying utilize this view, however, i am unable to rewrite the html code from the UI the way i need. So, i am looking to do the same in code using hooks.

function theme_views_pre_render(&$view){
    var_dump('got in pre view');
}

Is this the proper hook? Where is the output markup stored for views? Is there a render array of view output available that i could manipulate before its rendered? Thank you


texts:
hello i am trying to validate the content of the node body for certain text having some trouble with it. it outputs an message "array".

function test_form_alter(&$form, FormStateInterface $form_state) {
  // Custom validate function.
  $form['#validate'][] = 'submitForm';
}

function submitForm(array &$form, FormStateInterface $form_state) {
  $author = $form_state->getValue('author');
  $body = $form_state->getValue('body');
  $title = $form_state->getValue('title');
  drupal_set_message('Thanks for submitting the form! you typed in the following as author:' . $author . ' . body:' . $body . '. title:' . $title);
}


texts: I have an existing view to which I would like to add some contextual filters if my module gets enabled. In D7 this was possible using hook_views_default_views, but I can't seem to find the equivalent in D8. Is this possible in D8?


texts:
I have a registration form :

{{ form.status_messages_user_register_form }}

{{ form.field_first_name }}

{{ form.field_last_name }}

{{ form.account.mail }}
{{ form.account.name }}

{{ form.account.pass.pass1 }}

{{ form.account.pass.pass2 }}

{{ form.form_build_id }} {# required #}
{{ form.form_token }}{# required #}
{{ form.form_id }} {# required #}
{{ form.actions }}

Now i want to add custom validation for the registration.I have a custom ajax handler for registration using form alter:

$form['actions']['submit']['#ajax']  = [
         'callback'    => 'custom_register_form_ajax_validate',
         'event'       => 'click',
         '#attributes' => [
           'class' => [
             'use-ajax',
          ],
         ],
       ];
       $form['#attached']['library'][]      = 'core/drupal.dialog.ajax';
       $form['#attached']['library'][]      = 'core/drupal.ajax';

       $form['#prefix']                     = '

';

And this is my function :

function custom_register_form_ajax_validate(&$form, $form_state){

$response = new AjaxResponse();

  $form_state->setTemporaryValue('entity_validated', TRUE);

  $firstname = $form['field_first_name']['widget']['#default_value'];

  $email = $form_state->getValue('mail');

  $pass1 = $form_state->getValue('pass1');

  $pass2 = $form_state->getValue('pass2');

    if($firstname == ''){
         $text = '
Firstname is required.
';
          $response->addCommand(new InvokeCommand('.form-text', 'css', array('border-bottom', '2px solid red')));
      $response->addCommand(new HtmlCommand('#email-valid', $text));
    }
    if($lastname == ''){
         $text = '
Lastname is required.
';
          $response->addCommand(new InvokeCommand('.form-email', 'css', array('border-bottom', '2px solid red')));
      $response->addCommand(new HtmlCommand('#email-valid', $text));
    }
    if($email == ''){
         $text = '
Email field is required.
';
          $response->addCommand(new InvokeCommand('.form-email', 'css', array('border-bottom', '2px solid red')));
          $response->addCommand(new HtmlCommand('#email-valid', $text));
    }
}

I want to validate "Firstname is required" condition.But when i submit and  validate the form,always showing "Email field is required".

How can i solve this issue?


texts:
I'm trying to alter a Drupal view format settings dynamically, and I am currently using the following code.

 function mymodulenamehere_views_pre_render(&$view) {
   if ($view->name == 'view_name_here') {
     $view->display['panel_pane_5']->display_options['defaultView'] = 'Setting here' ;
   }
 }

This doesn't change anything. I can manually alter the view and the changes I want work. I can then look at the changes through features and see the line of code required, which I then use in hook_views_pre_render() as above.

Any pointers would be appreciated.


texts: How to properly implement sections in site

texts:
I am about to create a Page with a Main Menu which is about three levels deep. Each item at the first level should divide the whole page into visual distinct sections.

What would/could be the best choice to implement that with regards to:

users should not be able to add/delete sections
possibly no configuration (css classes etc.) should be applied from within the backend, so that each section can only be added in code and put under version control

My first shoot was to create Menu Items from within a module like that:

//modules/<mod>/<mod>.links.menu.yml

<mod>
    title: 'Galery'
    parent: standard.front_page
    route_name: <front>
    menu_name: main

What works, in such terms that it creates a Menu Item, but:

users can set a different parent node
the main problem of adding css classes, script, etc. depending on the link is not solved

I am a bit lost how to go on from here, I would appreciate any help ore ideas!


texts: Template file not recognized when moved to module theme folder

texts:
I have a template file in my custom module folder which I am using to theme a form. Everything works fine when the template file is in the root of my custom module folder. However, I would like to move this template file to another sub-folder in my custom module folder, so that I can basically put all the template files in one folder. My directory structure is such that in the root of the my custom module folder I have (/sites/all/modules/mycustommodule):

mycustommodule.module
mycustommodule.info
mycustommodule.install
mycustommodule_admin.inc

In /sites/all/modules/mycustommodule/mycustomthemes:
mycustommodule-example-form.tpl.php
mycustommodule-example2-form-tpl.php

This is my hook_theme:

'mycustommodule_example_form' => array(
  'template' => 'mycustommodule-example-form',
  'file' => 'mycustommodule_admin.inc',
  'render element' => 'form',
),

I would like to know what I would need to do to make the path clear to Drupal that the template file is in that sub-folder. Thanks.


texts:
I know how to install a single instance of Drupal very well but I want to create a number of sub-sites under my Drupal installation.
My file structure is as follows:
drupal7_main
 -sites
   --drupal7_sub1
    settings.php
   --drupal7_sub2
    settings.php

I'm developing on my localhost and the plan is to duplicate the structure on the production server.
However, only drupal7_main works. When I visit localhost/drupal7_main, Drupal is ready and configurable as usual; when I visit localhost/drupal7_sub1, I get the following error.

Not Found
The requested URL /drupal7_sub1 was not found on this server.

I get the same for drupal7_sub2.
I'm trying to learn this process and would appreciate some help.


texts: In Drupal 7, how do I allow users to see their own unpublished content?

texts:
This Drupal page says that for Drupal 7 to allow users to view their own unpublished content to check "view own unpublished content" in permissions.

I have this checked, yet when someone clicks on 'admin/content' it says permission denied.  Of course I don't want to give them permissions related to admin content.

Currently I have the override node options module enabled, and when a user unpublishes their content, they can no longer get back to it to continue editing and then publish it.

I cannot use the 'view unpublished' module as many threads suggest as it gives an entire role access to all unpublished content related to that role.

What I am leaning towards is a view. Currently I have a very good working block that allows people to view their PUBLISHED content while on their profile page. I cloned this and simply switched the filter "published: yes" to "published: no" and it won't work. I tried setting the view permission to view own unpublished content, and it will not work.

Is 'view own unpublished content' broken in D7? Drupal core says I should be able to allow users to view their own unpublished content. How can I do this without all this hakery and dependency on a 3rd party modules?


texts:
I was wondering if it is possible to switch between different databases on one Drupal installation.

I have a different DB which another application uses it. Both DB are on the same server (localhost) and I was wondering if it is possible to temporarily connect to that DB in order to READ and WRITE data from/to it, using Drupal.


texts: Programmatically adding registration type (Entity Registration module)

texts:
I am trying to programmatically add a registration type using the Entity Registration module and Drupal 7.

Currently I am using the following code:

$bundle = array(
    'type' => 'flake',
    'label' => $t('Flake'),
    'base' => 'registration',
    'custom' => TRUE,
);

$registration_type = registration_entity_set_default_settings($bundle);

registration_type_save($registration_type);

Among other thing, I have tried 'name' instead of 'label' and 'entity_registration' instead of 'registration'.

As you can probably gather, I am new to creating types of any sort. I started by working off a tutorial for creating a regular content type and did not run into any problems. Figuring out how exactly that differs from the entity registration type has been a little challenging.


texts: Where should I download libraries for modules through composer?

texts:
I've started to use Drupal 8 and some modules requires some libraries.
For example search api solr. When I'm installing these libraries via composer it downloads the libraries into directory of the module.
For example modules/contrib/search_api_solr/vendor.
I don't think that it's correct because contrib modules should be stored in clean state.

What the right way to install libraries for modules via composer?
Where should I store them?


texts:
I am running a d6 website with i18n and I have multiple domain on it working very fine. Now I want to add another domain but for an existing language so what is the best solution for that.

In fact, this additionnal domain is for the mobile version of the website and because menus depends on language domain selection, I cant' get my menus using the mobile domain but the default domain, that's why I want to add another language but I can't :)

Maybe there is a simpler solution?

Thanks


texts: Creating a token for the image field file path with node reference nid

texts:
Since there is not support for fields in Drupal 7 tokens, how do I create the code to replace a token in an image field file path?

EDIT:
First, this is with the Node Reference URL widget so the NID of the referenced node is loaded into the form array as long as the link was clicked on the referenced node.

I realize that there isn't any context to load the information to pass to the token module because there isn't any information about the node by the time token_replace() is called. This is before the NID of the referenced node is added to the form.

Adding the file path by using hook_form_FORM_ID_form_alter() works, but it's not very safe. The user might not use the Node Reference URL widget to access the page in which case the node is saved with a reference while the image path didn't have access at any point for know about the NID of the referenced node. And, if the node is then edited it will change the path on creation as it will then know about the referenced node making a mess of the place.

Here is the simple code which isn't very safe. I wouldn't mind a better solution.

Update:

It turns out that the node reference URL widget can be set to return a page not found if the referenced node's URL is not in the URL, which would make this function a little safer as it forces the user to only be able to create the node if they clicked the create node link on the referenced page.

/**
*  Implements hook_form_FORM_ID_form_alter\
*/
function HOOK_form_photo_node_form_alter(&$form, &$form_state) {
  $lang = $form['language']['#value'];
  $form['field_business_photo'][$lang][0]['#upload_location'] = 'public://photo/' . $form['field_reference_business'][$lang][0]['nid']['#default_value'];
}


texts:
I created a user login page, and used the login destination module to redirect my user to a new "front page" I created using views.

On this "front page" I call all the nodes created by the logged in user, so a user can see newly created nodes.

My question is, how do I call a message or view which tells my user when a node has been deleted or edited?  This "front page" acts as a 'notification wall', which the user can see everything that is added or edited.  It will become more complex later where admins will be able to edit user nodes.  So I need to let the user know when he/admin has edited or deleted a node.


texts:
I am checking of a particular field type in the schema using:

drupal_get_schema('MY_FIELD');

I see in the database the field type is int, but when I check after:

$schema[$table]['fields']['MY_FIELD']['type']

is giving me always 'datetime'.

I assume is a cache issue: I am using:

cache_clear_all('schema', 'cache');

but still no luck.


texts: How to export entity instances created with ECK?

texts:
I have created my custom entity types (and bundles) using ECK module.
Is it possible to export entities from website, for example using Features?

I have found this thread but as I understand, it is concerning
exporting of entity type configuration. But I would need to export entity instances. Is it possible to use Features or any other Drupal module to achieve it?


texts:
I'm using Simple Payments to handle PayPal processing in a module I'm building (See previous question).

The first part is fine -- it sends data to PayPal okay, but now that users can pay, I need to write the post-transaction handling code (which will ultimately store that the transaction succeeded in the database.). I'm supposed to use hook_simple_payment_process, but there's very little documentation. In its entirety:

/**
 * Passes a completed payment to the module that created it for processing.
 *
 * @param $payment
 *   A payment to be processed.
 *
 * @return
 *   TRUE if the payment was successfully processed.
 */
function hook_simple_payment_process($payment) {
}

What am I supposed to do with this...?

Thanks!


texts: Cookies change when I navigate to another page (Using jquery cookie)

texts:
For example, the user can change the font size, and it is remembered in the cookies. Say I am on the product page and change the font size there and add the cookie. Everything looks fine, but when I go to the front page, the font size is back to normal. Going back to the product page, the cookie is applied. How can I make the cookies work site-wide instead of per page? Or is there something wrong with what I am doing?

How I do it is, when the user checks a checkbox:

$.cookie('font', 'x2');

And on $(document).ready() I simply check the cookie and apply the css so:

if($.cookie('font') == 'x2') {
  $(body).css('font-size', '200%');
}

Or something like that. I don't think the problem is in my code though anyway, since it works, is this some kind of Drupal behaviour or...?


texts: Confirmation message not getting rendered when printing the elements seprately in twig and ajax is enabled

texts:
Iam using the following twig code in webform-submission-form--newsletter-signup.html.twig

                            {{ form.elements.url }}

                                {{ form.elements.email }}

                         {{ form.elements.actions }}

                    {{ form.form_build_id }}
      {{ form.form_token }}
      {{ form.form_id }}

and Iam using the following code in webform--newsletter-signup.html.twig

 <form{{ attributes.addClass('subscribe-form') }}>

  {{ title_prefix }}
  {{ children }}
  {{ title_suffix }}

</form>

When I try to use the default webform templates the message gets displayed after ajax request infact the message is returned as part of the data in response but when I use these templates the message is not present in ajax response what am I doing wrong here please help


texts: How to restrict completion of only one field within a field group

texts:
Is there a simple way to have several fields within a field group; such a way that only one field in the group can be populated.

Example use Case
Field group is called 'Insert Media'.

The group contains
- an image field
- an audio field
- a video field

The user may complete one field, but can not complete multiple fields within the group.


texts:
I am using Drupal 7.

In one of my requirements i need to create related node to specific node.

For ex. I have created a node of content type "article". For particular node of "article" node

say nid:9 then i would like to add related node to this node.

So when i view nid:9 at that time it should also display related nodes, and also when i view the newly created node, at that time nid:9 should be displayed in related node display

So both nodes should be displayed vice versa in each others detail view.


texts: View of all users and their relationship(s) with the current one

texts:
I've been trying to create a view of all users, showing their relationship to the current one. I can't figure out a way to display all of them. By adding the Contextual filters User UID or Requester user, the views results are restricted only to users having a relationship (with the current one), therefore not showing the ones not having one...

I have also been trying to use the Relationship "Requester user is current user", but without success.

Here an example of the expected result: http://i.imgur.com/UbvupO8.png

Am I missing something? thanks in advance for your help


texts: Using replace in my twig returns a blank

texts:
I have what I think is a rather simple statement here

{{ (content.field_url.0)|replace("http://","") }}

but then I get an error

  Warning: strtr() expects parameter 1 to be string, array given in
  twig_replace_filter() (line 482 of
  vendor\twig\twig\lib\Twig\Extension\Core.php).
  twig_replace_filter(Array, 'http://', '') (Line: 57)

Changing it up a little

{{ (content.field_url.0)|replace('http://',"") }}

and then I get this error

  Warning: Invalid argument supplied for foreach() in
  Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension() (line 148
  of core\lib\Drupal\Core\Asset\LibraryDiscoveryParser.php).

One more change up

{{ (content.field_url.0)|replace({'http://':""}) }}

and this returns nothing, nada, no value at all.


texts: $form_state->setError on autocomplete field

texts:
I have a form with custom validation and an autocomplete field. I have no problem to set errors for text fields, for example for a List (text) field I can say

  $fss = $form_state->getValue('field_substructure') ;
  if (! $fss || $fss[0]['value'] == '_none')
      $form_state->setError($form['field_substructure']['widget'], 'Insert a value for the substructure') ;

For my autocomplete field, using ksm($form) I see that the widget appears to be at $form['field_structure']['widget'][0]['target_id'], so I write

  if (! $form_state->getValue('field_structure'))
      $form_state->setError($form['field_structure']['widget'][0]['target_id'], 'Insert a value for the structure') ;

If I left the field empty, the error appears, but the field is not marked with the red border. Just to be on the safe side, as first argumente to setError() I also tried to use $form['field_structure']['widget'][0], $form['field_structure']['widget'] and $form['field_structure']. Maybe the autocomplete field misses a css?


texts: Composer update : Package "drupal/module_name" listed for update is not installed. Ignoring

texts:
After hours of struggling to update Drupal with Composer (see my solution here), I have now some difficulties to update some modules. I was able to update with composer update drupal/bootstrap:3.11 --with-dependencies, but I could not update a module with composer update drupal/pathauto:1.1 --with-dependencies, which returns the following error.

  Package "drupal/pathauto:1.1" listed for update is not installed.
  Ignoring.
  Nothing to install or update.

The content of the composer.json file is the following.

{
    "name": "drupal/drupal",
    "description": "Drupal is an open source content management platform powering millions of websites and applications.",
    "type": "project",
    "license": "GPL-2.0+",
    "require": {
        "composer/installers": "^1.0.24",
        "wikimedia/composer-merge-plugin": "^1.4",
        "drupal/views_slideshow": "^4.6",
        "drupal/metatag": "^1.4",
        "drush/drush": "dev-master",
        "drupal/core": "~8.5",
        "drupal/pathauto": "1.1",
        "drupal/bootstrap": "3.11",
        "drupal/token": "1.1"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },
    "extra": {
        "_readme": [
            "By default Drupal loads the autoloader from ./vendor/autoload.php.",
            "To change the autoloader you can edit ./autoload.php.",
            "This file specifies the packages.drupal.org repository.",
            "You can read more about this composer repository at:",
            "https://www.drupal.org/node/2718229"
        ],
        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "merge-extra": false
        },
        "installer-paths": {
            "core": ["type:drupal-core"],
            "modules/contrib/{$name}": ["type:drupal-module"],
            "profiles/contrib/{$name}": ["type:drupal-profile"],
            "themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/contrib/{$name}": ["type:drupal-drush"],
            "modules/custom/{$name}": ["type:drupal-custom-module"],
            "themes/custom/{$name}": ["type:drupal-custom-theme"]
        }
    },
    "autoload": {
        "psr-4": {
            "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
        }
    },
    "scripts": {
        "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
        "post-autoload-dump": [
          "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
        ],
        "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
        "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ]
}

I tried with composer update drupal/token, but it gives the following error.

  Nothing to install or update

composer install drupal/token gives the following error.

  Invalid argument drupal/token.
  Use "composer require drupal/token" instead to add packages to your composer.json.

Instead, composer require drupal/token gives this error

  Using version ^1.1 for drupal/token
  ./composer.json has been updated
  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Nothing to install or update

I checked the composer.lock file and its content is the following.

    "name": "drupal/token",
    "version": "1.1.0",
    "source": {
        "type": "git",
        "url": "https://git.drupal.org/project/token",
        "reference": "8.x-1.1"
    },

So, it seems thats it is correct, but the module page still shows it as requiring to be updated.

How can I solve this and install these modules?


texts: Translation view path broken after upgrade to 8.5.1

texts:
After upgrading my site from Drupal 8.3.5 to Drupal 8.5.1, the token {{ path }} is not translated anymore in the selected language.

Does anyone have a suggestion or solution?


texts: Use another language than "default" as standard

texts:
We're currently building a rather large website that will be release in swedish initially, but other languages later on. For this reason we've built everything in english and then translated everything to swedish. For the release, only swedish should be accessible. This is where the problem begins.

-We don't want / can't use language URL prefixes for different reasons (PURL clashes, uglyness, won't need once the site is available in more than one language)

-We can't use Swedish as default language because that will break all of the translations (string translations will then consider swedish as the original language). Since everything from fields, labels, content types, help text etc. are in english originally this is not an option.

-We can use browser detection, but that isn't really fool-proof and doesn't cover all cases. A lot of users in sweden use english as browser language.

-We could use IP location, as an addition to the above, but it's not fool proof either.

What we would really need is to use Swedish as the default language but somehow use english as the language of origin. Is this possible somehow?


texts: How can I resend the commerce email from the admin orders screen?

texts: Is there any way of allowing site admins to resend the default order email that commerce provides to the user after a completed order?


texts:
I want want to create page for vocabulary. I mean not vocabulary term, but vocabulary name.

mysite.com/myvocab

rather than

mysite.com/myvocab/term

That page should also have possibility to display text (how can I add text field to vocabulary and not vocab term?)

Thanks!


texts: Using REST to create user with CAS username

texts:
I would like my CAS server to POST an account to my client site when a new user registers. My CAS server is using D7, clients are using D8.

Using the entity/user endpoint I can create a new user, assign roles and  complete custom fields. It all works well apart from adding the cas_username.

When trying to pass the CAS username I get en error:

  "InvalidArgumentException: Field cas_username is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 586 of /mysite/html/core/lib/Drupal/Core/Entity/ContentEntityBase.php)."

Is it possible to POST a user with cas_username field via the create user endpoint?

Do I need to create a custom endpoint that extends the functions of the default entity/user endpoint?


texts: I am writing some php code to update an external database with the shipping and billing information after the order is complete, so I am writing a rule on checkout complete that adds the customer information to the database.  I need to figure out what is contained in the variables that I want to use (eg. $commerce_order->???) how would I figure this out, and is there a reference list anywhere that I can use?


texts:
I have just begun development on a Drupal 7 site in a team of three and I am trying to determine the best practice for versioning. This is causing me a bit of a headache because much of the work on a Drupal site is made in the database as well as the code.

I have installed the 'Features' module which allows for exporting views, content types, rules, ect. into an XML file which can them be included in the checkin, but we need to ensure that whenever we add a new module it is enabled on our machines before a feature is imported in case there are dependency issues.

When modules are added to our local machines, both code is added and the module is enabled in the database, so checking in the code to our git repo takes care of half of the problem, but we are left with the possibility of crashing each other's site if we fail to contact each team member notifying them of the manual changes to be made.

I have searched but I have failed to find a module or any other solution to this problem. Ideally there would exist a module that would create an XML file of which modules are enabled on one machine, then after checkin a second machine would be able to read this file and ensure that the two sites were in sync.

Has anyone found an elegant solution to this problem?


texts:
I am using the Edit Profile module.

This module takes all the fields attached to a user profile and displays them on a separate tab located at yoursite.com/user/[USERID]/edit-profile.

I would like to theme the fields on this edit profile page. How can I do it?

I have tried two approaches but none seem to work:

Approach 1: Tpl.php suggestion from theme developer

Theme Developer suggests to use the following template: page--user--edit-profile.tpl.php
This however has two problems:
1) It affects the whole page and not just the user profile form.
2) It doesn't seem possible to access the fields on the user profile from this template.

Approach 2: template.php

The form ID of the user profile edit form is edit-profile-user-profile-form so I used the following code in my template.php file to override it:

function THENAME_theme(&$existing, $type, $theme, $path) {

    return array(
        'edit-profile-user-profile-form' => array(
            'arguments' => array('form' => NULL),
            'template' => 'templates/edit/user-profile',
            'render element' => 'form',
            ),
    );

}

This, however, only over rides the main user profile page and not the fields on the edit tab. Can anyone help?


texts: Should I use Drush or Drupal Console with a new site?

texts: Between Drush and Drupal Console, which seems to have similar functionalities, which one should I install?


texts: How can I stop the full HTML editor from deleting my  paragraph?

texts:
https://drupal.slack.com/archives/C1BB308HH/p1602318464360700 Link to slack question in #support
JSFiddle of the offending html: https://jsfiddle.net/tyeth/xr4ohast/
Demo Video showing the paragraph beneath second image being removed: https://www.youtube.com/watch?v=Hw9NACmMsps [Was private, now just unlisted, sorry]
Hi supportive people, you must get this one a lot. I'm aware of the filter options and have customised the Full-Html mode to not use the 3 offending filters, and cleared cache, but I'm still losing content.
I'm using the drupal 8(and 9) add a custom body block using layout designer, I then use the WYSIWYG editor in full-html mode with the filters (strip bad html/convert newline br+p/convert images -- see screenshot) disabled.
However it is DELETING html from the end of the editor. I wonder if it's technically an empty paragraph as that has been mentioned in other issues (it isn't but has a link inside so doesn't have it's own text content).

Also, which module is actually doing the rich editing these days?


texts: changing php version on acquia dev desktop?

texts:
I am using acquia dev desktop and my site was using PHP 5.2.17. When I installed the Rooms module it would not enable as it requires PHP 5.3
On the dev desktop I switched to PHP 5.3.
However when I look at the Status report it is still showing that the dev site is using 5.2.17?
Dev desktop shows 5.3 - Site shows 5.2.17
Any ideas?


texts: Custom Drupal field widget causing check_plain() error

texts:
I'm working on a custom field widget for Drupal 7. Everything appears to be working correct, but now I'm getting this error:

  Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1565 includes\bootstrap.inc)

My .module hooks:

<?php
/**
 * Implements hook_field_widget_info().
 */
function MYMODULE_field_hook_info() {
  return array(
    'CUSTOM_field' => array(
      'label' => t('Custom Text Area'),
      'field_types' => array('text_long'),
      'behaviors' => array(
        'multiple values' => FIELD_BEHAVIOR_DEFAULT,
        'default value' => FIELD_BEHAVIOR_DEFAULT,
      ),
    ),
  );
}

/**
 * Implements hook_field_widget_form().
 */
function MYMODULE_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  switch($instance['widget']['type']) {
    case 'CUSTOM_field':
      $element['text_long'] = array(
        '#type' => 'textarea',
        '#attributes' => array('id' => 'MYFIELD', 'rows' => '5', 'cols' => '3'),
        '#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : '',
      );
      break;
  }
  return array('value' => $element);
}

My guess is that it's something in the way Drupal is attempting to validate my value with check_plain(), but I can't figure out what's wrong.


texts: Only show result when the author has a relation with the current user

texts:
You might already suspected it, I'm talking about groups. I've a content type what represents groups, the node/group is referred in a field (field_group) on the user entity. With this relation I want to define "permissions" in views.

For example the blog I build now displays content of all groups, no matter what group you are in, the view will always display all blog nodes. Now I want only to display the nodes what have an author with a field_group value equal to the currently logged in user its field_group value.

How should I do this in views? Some people mentioned to use contextual filters, I tried some common options but it didn't resulted like expected...

Please, let me know if you know a working setup.

Thanks ~ F.


texts:
I have created a autocomplete field with
function _autocomplete($string)
but, I want this field result show in views.

do I use from alter_query?
I use from D7 and views 3.

thank you so much


texts:
I am spinning up a site that will have 18 different organizations interacting together.  Each organization has a president with access to specific forms and parts of the site.  I would like them to be able to create/add users from their own organization.

Where I am stuck is that each president should only be able to edit/remove users from his own organization (aka that he created).  Do I need to create 18 different roles for each president and 18 different roles for members from their organizations, or is there a more convenient way of managing this.

I have reviewed the following modules without success:
Protect_critical_users, role_delegation, administerusersbyrole

Thanks.


texts:
My problem with anonymous users caching. in my site there is functionality of changing country selecting from drop down box. for now there is 2 countries "A & B" and default is Country A. when i am selecting country B from drop down it will change country B and load data according to that country.

I have done this by change event of drop down box in jquery.

When logged in user can go for change country it will working fine. But anonymous user can not change country it will load previously selected country data. means my default country is A and i am going to change Country B it will not change to Country B.

And when I am clear cache from admin and first time change country for anonymous user it will change country but than after it will not change country until I clear cache from admin.

below code i used for changing country

$(document).ready(function(){
           $('#selCountry').change(function(){
                var country = $(this).val();
                if(country != ""){
                    createCookie('userCountry', country, 30);
                    window.location.href = '<?php echo $GLOBALS['base_path']; ?>';
                }
            });
        });


texts: Why hook_preprocess_html() isn't working?

texts:
Why hook_preprocess_html() isn't firing in my module file? Is it only works in theme_hook?

EDIT:

function my_module_preprocess_html(&$variables) {
  if (current_path() == 'user') {
    $variables['head_title'] = implode(' | ', array(drupal_get_title(),  variable_get('site_name')));
  }
}


texts: How to make a field required using JavaScript injector

texts: I have a field that is part of a content type that I need to make required by using a JavaScript injector.  The reason that I can't just make it required while setting the rules for that field is because I have to parse a string that will display on the same page whether or not I need to make it required.  Any thoughts?


texts: How to use unique taxonomy term for nodes in Drupal 7?

texts:
I have unique categories assigned to nodes via taxonomy module. now I want the path to be something like this:

root/taxonomy-vocabulary/taxonomy-term/node-titel

Any ideas?

This question has already been asked for Drupal 8 but I am running Drupal 7. So there might be a module or setting for this?


texts: Image field causes #access to reset to default

texts:
I am using ajax to show/hide a field based on a date field. I set the default access to TRUE. If the user selects a date of birth over 18 years old, $is_younger and consequently the access switch to FALSE.

function mrpeanut_form_record_node_form_alter(&$form, &$form_state, $form_id) {
    // some other stuff here
    $is_younger = TRUE;
    $values = !empty($form_state['values']) ? $form_state['values'] : array();
    $dob_date_combo_element = &$form['field_dob']['und'][0];
    $dob_date_combo_element['#ajax'] = [
      'callback' => 'mrpeanut_form_record_node_form_minor_agreement_callback',
      'wrapper' => 'minor-ajax',
      'effect' => 'fade',
    ];

    if (!empty($values['field_dob']['und'][0]['value'])) {
      $dob = new DateTime($values['field_dob']['und'][0]['value']);
      $now = new DateTime();
      $age = $now->diff($dob)->y;
      $is_younger = $age < 18;
    }

    $form['field_minor_agreement']['und']['#access'] = $is_younger;

This is working great until the user selects and uploads an image on a separate image field. Then, $is_younger switches back to TRUE, regardless of whether they are over 18 or not. I can't seem to figure out why.

I think the error is happening on this line:

if (!empty($values['field_dob']['und'][0]['value']))

After I upload an image, I get this error if I try to watchdog the value.

  Notice: Undefined index: field_dob in
  mrpeanut_form_record_node_form_alter()

I think $values is getting overwritten after the image is uploaded and therefore date of birth can't be calculated again and it reverts back to $is_younger = TRUE.

Here's my callback:

function mrpeanut_form_record_node_form_minor_agreement_callback($form, $form_state) {
  $commands = array();
  $commands[] = ajax_command_replace('#edit-field-minor-agreement-wrapper', drupal_render($form['field_minor_agreement']));
  return array('#type' => 'ajax', '#commands' => $commands);
}


texts: How to generate more than one pdf from a node?

texts:
I need to generate two or more PDF from the same node with different templates.
e.g.: from a reservation page of a accomodations site I would generate a PDF for client, a PDF for owner and a PDF for agent

I'm currently using Print module.

How can I do?


texts: Node blog dislpay all content type blog in theme

texts:
I have content type page with node called blog(page blog) and I want to display all content type blog in it(content of page blog). how can i do this in theme without using block or views.I'm try to do it by using this code:

<?php
$build = array();
$query = db_select('node', 'n')->extend('PagerDefault');
$nids = $query
    ->fields('n', array('nid', 'sticky', 'created'))
    ->condition('type', 'blog')
    ->condition('status', 1)
    ->orderBy('sticky', 'DESC')
    ->orderBy('created', 'DESC')
    ->limit(3)
    ->addTag('node_access')
    ->execute()
    ->fetchCol();

if (!empty($nids)) {
    $nodes = node_load_multiple($nids);
    $build += node_view_multiple($nodes,'full');
    $build['pager'] = array(
        '#theme' => 'pager',
        '#weight' => 5,
    );
}
else {
    drupal_set_message(t('No blog entries have been created.'));
}

    print render($build);
  ?>

and set it in body field for page blog. And when display blog page it's content nothing (or empty page!). I'm test my code and execute it in php code it work and print all blog that I have.
Any way to do this in Drupal theme?


texts: Tracking how long it takes a user to submit a node edit form?

texts:
For a quiz node, I want to track how long it takes a user to submit a node form (the time from Drupal generating the form until the time that the user presses submit), and I want to store this duration in a field on my node.
Use case
Each node of content type Quiz is a 10 question quiz.  I want to track the time that users spend filling out the node in order to track their improvement in speed over time.
I do NOT want to track the time spent on the website in general; for that, I already use Google Analytics with scroll tracking, and there is also the Time Spent module.
What I tried
On my node, I added an Integer field, Duration.  My thought was that I could calculate the interval from the timestamp when the form was generated until the time the node was saved by adding code in hook_node_presave():
  $original_time = ??? // How do I get the time when the node form was generated?
  $current_time = \Drupal::time()->getCurrentTime();
  $duration = $current_time - $original_time;

Where I'm stuck is I don't know how to get the time when the node form was created.
I tried to add a Datetime field to my node with a Default date of Current date, but the current date is not set until the node is saved, so that doesn't work.
So, how can I track the time from generating a node edit form until the time the user presses submit?


texts: How to update content type field programmatically

texts:
I try to update content type field MYFIELD with code

$update = db_update('field_data_field_MYFIELD')
    -> fields(array('field_MYFIELD_value' => $result))
    -> condition('entity_id', $nid)
    -> execute();

I see changes in database but they not reflected in node view. Also I applied this code to field_revision_field_MYFIELDtable and got the same result. How can I update MYFIELD programmatically?


texts: How to redirect user using Rules when user visits a link with view?

texts:
I have a rule that redirects a user when visiting a view. But it does not work with the event "view page" or "Drupal is initializing".

Here is the rule:

{ "rules_uid_141" : {
"LABEL" : "uid=141",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "redirect manager" ],
"REQUIRES" : [ "rules", "pathrules" ],
"ON" : { "node_view--page" : { "bundle" : "page" } },
"IF" : [
  { "data_is" : { "data" : [ "site:current-user:uid" ], "value" : "38" } },
  { "pathrules_checkpath" : { "path" : "team", "operation" : "equals" } }
],
"DO" : [ { "redirect" : { "url" : "team?field_manager_uid=38" } } ]
  }
}

Any suggestions?


texts: Give a basic page a different appereance by rendering it with views

texts:
I'd like to render a basic page to look somewhat different for my mobile site.
Now I have come up with a combination of views-view--mobile-aboriginalartsfestival.tpl.php, page--mobile-aboriginalartsfestival.tpl.php & html--mobile-aboriginalartsfestival.tpl.php to change the appareance of my mobile-aboriginalartsfestival view. Now, the page contains certain elements that I would like to alter, in particular I would like to get rid of the <h2> title on top of the content (but not all h2 elements on the page!) and I would like to replace the image, too. How do I best go about it?

edit 1

So far, I have a  couple of arrays on top of my page. One contains strings to search for $searchstr and the other one $contentstrcontains strings to replace the search strings with. Then, where to content gets rendered in my page--mobile-aboriginalartsfestival.tpl.php, I implemented a few lines like:

        <?php $i = 0;
              $contentstr = render($page['content']);

              foreach ($searchstr as &$value) {
                $contentstr = str_replace($value,$replacestr[$i],$contentstr);
                $i++;
                }
              print $contentstr;
        ?>

and even thought, that approach seems to work fine, I doubt that it's the best way to go about it, does any one have a better idea for this?


texts: Showing only certain product attributed in a view rather than them all in Commerce

texts:
I am using Drupal Product Pricing, Product Options and Product attributed modules.

I have created a number of different attributes for products but my issue is that when including them in a view it just displays all of them.

This is an issue since I am using Billy Mail PDF module which uses a line item view. So when I include the attributes in the view it just displays them all. This includes an image and potentially alot of text which could be inputted by the customer.

I just need to include 1 of the product attributes but this does not seem to be possible as there is no option for this inside the fields settings in views.


texts: How can I add a new value to a multi-value field programmatically?

texts:
I have a multi-value textfield that stores the user agent string.  I want to store the user agent every time the user logs in (this may not in fact be a good idea, but for sake of example).

The following code will save the user agent, but only in the first position. It replaces the old value instead of creating a new one.

function MYMODULE_user_login($account) {
  $account->set("field_useragent", $_SERVER['HTTP_USER_AGENT']);
  $account->save();
}

How can I add a new value each time this is called?


texts: How can I programmatically get a checkbox value?

texts:
I need to check if "Close this ticket after replying" checkbox is checked or not. The value $ab is not getting displayed. This is a comment type created from Structure > Comment Type.
function helper_ticket_comment_submit(&$form, FormStateInterface $form_state)
{
          $ab = $form_state ->getValue('field_close_this_ticket');
           \Drupal::logger('CheckBoxValue')->notice($ab);

 }

Error:


texts: Displaying a Block on 2nd level pages but not 3rd level

texts:
I have a block that I would like to only display on documents/* but not on /documents//.

I have set 'Show block on specific pages - only the listed pages' 'documents/*' but this displays the block on all children of documents.

How do I set it to only display on documents/company (etc) and not documents/company/board?


texts:
I have a problem using #limit_validation_errors for a submit button on which I dont want all the validations to run. Here's my custom submit button :

$form['actions']['draft'] = array(
     '#type' => 'submit',
     '#value' => 'Save as draft',
     '#submit' => array(''),
     '#limit_validation_errors' => array(
       array('title'), // Validate $form_state['values']['title'].
     ),
);

It works perfectly in the sense that it checks the validation on the title field only, but the weird thing is, it does not submit any other field's values when submitted. I wrote a custom submit handler to check that. However, the values are present in $form_state['input'] but not in $form_state['values'].

What I want simply is, this form will submit with just the values given and overlook the validations when this custom submit button is clicked.

FYI : I can get $form_state['values'] perfectly in my custom validate function.

Any ideas? What am I doing wrong here?


texts: How to obtain a token based on a entity_reference field?

texts:
I have a node type A with a entity_reference field named "field_subnode" pointing to a node type B:

A -> B

I'm using pathauto, with the following patterns setted up:

URL path for nodes of type A:
books/[node:title]

Now I need something similar to:
books/[node-type-A:title]/[node:title]
as path for my nodes of type B, to obtain urls like the following:

books/my-car-book/chapter-1

Which token I have to use to obtain what I want?

I've tried different tokens like for example:

books/[node:field-subnode:1:title]/[node:title]

but without success.

Thank you for helping me.


texts:
when adding content (node/add/article in UI) i get this error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '147' for key 'PRIMARY': INSERT INTO {node} (nid, vid, type, language, title, uid, status, created, changed, comment, promote, sticky, tnid, translate) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array ( [:db_insert_placeholder_0] => 147 [:db_insert_placeholder_1] => 147 [:db_insert_placeholder_2] => article [:db_insert_placeholder_3] => fa [:db_insert_placeholder_4] => rewq [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 1354548748 [:db_insert_placeholder_8] => 1354548748 [:db_insert_placeholder_9] => 2 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 [:db_insert_placeholder_13] => 0 ) in drupal_write_record() (line 7114 of /var/www/vhosts/******/httpdocs/includes/common.inc).

I've read if I upgrade my php to 5.4 (from current 5.3) it will be solved
Is there not any easier option? ( well it wont be easy for my upgrading php on this particular server right now)

I also changed node table structure, set vid default value from NULL to 0 ( it was mention somewhere on drupal.org) but no change

tanx in advance


texts: Summary or trimmed body field formatter does not display anything when the trim length is anything below 888

texts:
I am creating a view for blog items to be displayed on the home page.

Obviously I would not want the whole blog to show on the home page and I want a summary of this to be displayed.

Whenever I set the summary to anything less than 888 it seems to delete the markup completely from the page.

Does anyone perhaps have a solution for me? Thank you in advance.


texts: Call form validation function by clicking link

texts:
I want to be able to click a link on my form and have it call the form's validation function (but not actually submit it!).

Here's what I've got that's partially working:

in form_alter:

$form['my_field'][LANGUAGE_NONE][0]['value']['#field_suffix'] = "Validate";

in js file:

Drupal.behaviors.my_form = {
    attach: function(context, settings) {
        $('#link_validate', context).click(function () {
            $("#edit-preview").click();
        });
    }
};

If you access the form from the node edit page, then this way works. However, if you access the form normally, it won't work the first time the page loads. If you hit Refresh, then it will work, but not on first load. I know the Javascript is getting called, as I've put an alert() statement in the above click function and it shows up, but it's like Drupal is blocking the .click() on first load for some reason. I've also tried .mousedown() and .trigger() without luck.

Any ideas?


texts: Depending on the argument passed in url go to specific content type

texts:
I have a link "Add Details". suppose when I click on the Add Details, I will send arguments to the urls. such as in url "http://localhost/drupal/video" video will be my argument. When I click on "Add Details" link if argument is video then I want to go to "Video content type".

When I click on "Add Details", if argument passed is "image" in url("https://localhost/drupal/image), Then I want to go to "image content type".

When I click on "Add Details" link depending on the argument passed in URL I want to go to specific Content type.

How to achieve this.

Any help is appreciated.


texts:
I've got a css issue that I can't get my head around, and could really use some help.

I'm trying to style flexslider on a drupal 7 installation and some but not all of my list styles are being applied to the images, then it seems like the application is random.

In the flex slider on the bottom of this page:http://www.multibrand.visionmix.us/for-her-all

each LI item has a border but each li is also supposed to have a inset shadow applied to it.
Some LIs do but most don't, and I can't figure out why.

I'm using:

Flexslider 7.x-2.0-alpha3

jQuery Update 7.x-2.3+6-dev set to 1.8

Drupal 7.23

Any ideas would be very welcome


texts: What is Calendar Legend block for? enabled but shows nothing

texts:
Playing around with Calendar + Date.

There is a block called Calendar Legend, but shows nothing. What is it for? Where should I configure?, I checked the block configuration and views setup, no clues.

Thanks.


texts:
I am running a large script using batch api. I am sending newsletter mails to users. Mail sending is in bulk. I mean the mails is going to 8000 users. For testing I sent it to 1000 users and it worked fine. But for 8000 users it showing me this error :

An AJAX HTTP request terminated abnormally. Debugging information follows. Path: /batch?id=34485&op=do StatusText: ResponseText: ReadyState: 4

Or is there any other way to do the same? Following my code :

<?php
function testingmail() {
    $batch = array(
        'title' => t('Sending Mail...'),
        'operations' => array(),
        'init_message' => t('Connecting'),
        'progress_message' => t('Processed @current out of @total.'),
        'error_message' => t('An error occurred during processing'),
        'finished' => 'skeleton_batch_finished',
        'progressive' => FALSE
    );
    $result = db_select('customsendemail', 'c')->fields('c')->execute();
    $userslist = array();
    while($users = $result->fetchAssoc()) {
        $userslist[] = $users;
    }
    for($i=0;$i<count($userslist);$i++) {
        $userslist[$i]['user'] = explode(",", $userslist[$i]['user']);
    }
    $finallist = array();
    foreach($userslist as $value) {
        foreach($value['user'] as $key => $value2) {
            $finallist[] = array('mail' => $value2, 'subject' => $value['subject'], 'message' => $value['body']);
        }
    }
    foreach ($finallist as $userdetail) {
        $batch['operations'][] = array('skeleton_batch_worker', array($userdetail));
      }
    batch_set($batch);
    batch_process('<front>');
}

function skeleton_batch_worker($userdetail, &$context) {
  if(!isset($context['results']['processed'])) {
    $context['results']['processed'] = 0;
  }
  $context['results']['processed']++;
  $context['message'] = 'Sending Mail to '.$userdetail['mail'].' and subject '.$userdetail['subject'];
  $params['subject'] = $userdetail['subject'];
  $params['body'] = $userdetail['message'];
  drupal_mail('custom', 'mynewsletter', $userdetail['mail'], language_default(), $params, 'my@email.com', TRUE);
}

function skeleton_batch_finished($success, $results, $operations) {
  if ($success) {
    db_delete('customsendemail')->execute();
    $message = format_plural($results['processed'], 'One email sent.', '@count email sent.');
    variable_del("customnewsletter");
    watchdog("Custom Newsletter", "Custom Newsletter end.");
  }
  else {
    $message = 'Somer error in newsletter sending.';
    variable_del("customnewsletter");
    drupal_mail('custom', 'mynewsletter', 'my@email.com', language_default(), array('subject'=>'error in newsletter sending', 'message'=>'sending error'), 'my@email.com', TRUE);
  }
  drupal_set_message($message);
}


texts:
In a Drupal 8.5.3 installation I have set up the following configuration:

I created a basic page, its node path is /node/42.
Under Administration » Configuration » System » Basic site settings (/admin/config/system/site-information) I have set the Default 404 (not found) page to /node/42.

Now I expect a non-sensical URL to show the contents of /node/42 for the 404 page. However, I still only get the generic 404 page.

The theme we are using does not have a custom 404 template or anything like that. What other reasons could there be, that the default 404 page is not the one set in the config?


texts: Entity reference field on select show some data about entity

texts:
consider i have a customer content type with fields (name, phone, address) and i have a feed back content type with an entity referenced field to customer.

When  the user select the customer i want to show the phone and address somewhere near the field.

Is there a module for this? Or how do i do this?


texts: Custom module update with project status url

texts:
My .info file is the following.

name = {some_name}
description = This will contain all {some_name} related information
package = {Package_name}
core = 7.x

; Information added by Drupal.org packaging script on 2014-10-03
version = "7.x-1.1"
core = "7.x"
project = "{project_name}"
project status url=http://domain.com/{project_name}/7.0/sub_module
datestamp = "1432104957"

I uploaded the sub_module.zip and the sub_module.tar.gz files, as well as the sub_module folder to the above project status URL, with .info version set to 7.x.2.1.

Still I'm not getting any updates for my custom module.
Can anyone help me with this?


texts: How to create a view based on taxonomy term of a node reference

texts:
I have a taxonomy vocabulary called "Sports" that lists out a number of sports terms (Football, Tennis, etc).

I have one content type called "Team". I have a "Sports" taxonomy term reference field set as I associate a sport to the team. The field is called field_sport.

I have another content type called "Fixture". It has a node reference to "Team". The field is called field_sport_team.

That is:

a Fixture has a Team.
a Team has a related Sport.

Question:

How can I create a view with a contextual filter based on a "Sports" term that returns all related "Fixture" given that the "Sports" term is associated to a "Team" node reference?

Been stuck over the past few days...

Thank you for your help in advance!


texts: Change title head of the pages in Drupal 7 by path

texts:
I need to change the title head of the pages in Drupal 7 by path.  NOt to all content type.  I need to change the title head to a specific page generated with views.

For example, I have a site http://www.mysite.com

<title>My favorite website </title>

I need the  for pages:

http://www.mysite.com/test

<title> My test today </title>

http://www.mysite.com/examples

<title> My examples for share </title>

Thanks.


texts: Git flow feature in branch on stage server

texts:
I am testing out a git feature and pushed the branch to the staging server to show the client.
Because it is a drupal feature, I think I need to revert the feature on the branch on the stage server.

My question is if I am in feature/branch and I revert the drupal feature to allow the updates to show up. When I checkout develop will that whipe away the revert I did on the feature/branch?

Thanks


texts: field collection value not worked with entity form when using conditional field

texts:
I have created one entity form with conditional field and field collection in it but when I see the saved entity after submission, my values are not coming.

1) In first step user see the selection radio button with value A and B.

2) When A is selected, some files are visible some are not because I used conditional field in this.

3) Now when I fill the step 1 of multi-step form (Field collection in first step) and go to step 2 and fill the values and submit the form, the form values are visible in submission.

4) Now when I select the B and fill the form in first step using field collection and go to next step. After filling submit in submission step 1 of B selection is not coming only the value added in the second step of B are visible in submission.

How can I solve this as I have seen on drupal.org there is some issue in field collection with entity form. I tried many patches but no success.

My entity form structure is like this;

1) Multipagegroup

2)select A   ----   B with conditional field

3)multipage1------------------------------------step 1 of form

   4)Text field------------------visible in step 1 when selected A only

   5)Field collection 1-----------visible in step 1 when selected A only

   6)Field collection 2-----------visible in step 1 when selected B only

7)multipage2------------------------------------step 2 of multi-step form

   8)Common text fields for both A and B for the second step--(common field)


texts: How to verify a token in the url of a drupal 7 site against an external web service and skip the login form all together?

texts:
Context

We have this JSON web service GET https://api.my-domain.com/accounts/me (and a bunch of other endpoints). It takes a token in the header. When that token is valid it will return

{
  "email": "me@my-domain.com"
}

That JSON web service is used by a web application. That web application links their users to a Drupal forum. We don't want them to log in again.

The simplest solution we could think of is to link the users to:

https://drupal.my-domain.com?token=123456789

The Challenge

Our challenge is for our Drupal instance to:

Read that token from the URL https://drupal.my-domain.com?token=123456789
Call our web service GET https://api.my-domain.com/accounts/me with header Authorization: token 123456789
If it responds with a status 200 response and {"email": "me@my-domain.com"}, have Drupal pick up the email value.
Drupal matches it against the drupal users.
When the user doesn't exist in Drupal, it has to be created.
And the user is logged (SSO) into the Drupal forum.
No login form was ever shown. The token was either correct (status 200 from the web service) or incorrect (status 403 or whatever) and some drupal node/page should show that an invalid token was used accessing the forum.

I have done some investigation but none of the solutions that I found quite matched this use case. Most show how to build a module and have the login form check against an external system. We don't need the form. Just a token in the url validated without a form. I don't want to build a fully fletched CAS-Server, OpenID or OAuth2 provider at the web service. We'd like to keep it simple and just verify one token in the URL against our web service.

Can we use a module for this? And how would the simplest version of this module look like?


texts: Why are only a few actions available on my triggers page?

texts:
I'm customising the content publishing flow of my site using actions and triggers. Unfortunately I've got a problem that not all the actions are show on the triggers page.

For example on
I have: ["Choose an action", "Make content sticky", "Make content unsticky", "Promote content to front page", "Publish content", "Remove content from front page", "Unpublish content", "Change workflow state of post to next state", "Ban IP address of current user", "Block current user"]

Whereas on all other trigggers I only have these actions available:
["Choose an action", "Delete archived revisions", "Publish the most recent pending revision", "Change workflow state of post to next state", "Ban IP address of current user", "Block current user"]

Does anyone know why all actions are not shown for all available triggers?

Thanks


texts: Compare two views that present two different content type and delete nodes

texts:
this question is like this: How to delete a content in a view with view rules?

I didn't know why but i make this question with another account that i cannot got access now
So the problem is: I got two views. View A and View B. View A rapresent contents of type A (30 contents for example) and view B rapresent contents of type B (30 contents for example). By comparing the various nodes contained in these two views i want to found (among the nodes contained in the view B) contents with the same title of some nodes caontained in the view A and delete them. After this operation, View A got 30 nodes and View B got 3 nodes because got 27 nodes with same title of some nodes in the View A. I try to do this in a Rule with view loop but i didn't know how to delete nodes with the same title. I try with VBO but i cannot make this process i think, cause i need to delete nodes selectively

Thanks and sorry for the duplicate post (i need to do this cause i cannot reply with old account)


texts: different widget depending on content type

texts:
When two different content types shares a field, and you choose a widget for that field. Drupal 7 will show the same widget for both content types.
What i'am trying to achieve is to use a different widget for one of those content types.
Just like date_select for one and date_popup for the other one.
I don´t know how to do this... a hook in themes template? maybe a custom module?
Aproaches:
I have been digging a little bit and fouund this function:

function MY_MODULE_field_widget_form_alter(&$element, &$form_state, $context) {
}

Maybe with a few conditionals like, if $form_id is... and content type is...
if $context[instance][widget][type] = date_popup;

Thanks a lot.

Edit:
I have tried this code into a cuestom module but it doesen´t work, don´t know why.

    function ftte_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'informals_node_form') {
    $form['field_tria']['#attributes']['class'][2] = field-widget-date-popup;
     }
}


texts: Model view and labels are not displayed correctly

texts:
I created a model view and labels are not displayed correctly when I export with the module: "Views data export".

Here are the contents of my model views-view-field--sitemap--views-data-export--field-image.tpl.php :

<?php

$fields["field_image"]->content = '<image:loc>' . $field->original_value . '</image:loc>';

echo $fields["field_image"]->content;

the result is :

&lt;image:loc&gt;http://www.domaine.com/xxx.jpg&lt;/image:loc&gt;

instead of :

<image:loc>http://www.domaine.com/xxx.jpg</image:loc>


texts: How to send promotion email after quick registration

texts:
In my project there are two types of user.

Normal User
Lawyer

I create a registration form using profile 2 module. Now problem is I want to send promotion email to Lawyer after registration so I create Action for send email and then create trigger for user. In send email I choose [user:profile-lawyer-registration:user:mail] for email address. registration has done successfully and receive email about registration link, but not receive the promotion email. They gives following error:

  Error: Unable to send e-mail. Contact the site administrator if the problem persists.

Status message:

  Success: A welcome message with further instructions has been sent to your e-mail address.


texts:
I'm using the default taxonomy tags with nodes. If users forget to enter the commas to separate the words it will generate one really long tag.

What's a good way to do a validation?


texts: How to create dynamic select option field in webform module

texts:
I have created a web form in drupal 7, i have one select option with two values and one input text box.
When i click on one value input text box should appear nothing so that anybody can write some text but when i click on 2'nd value, input text box should appear 6 drop-down values

How i can achieve this?


texts: How to make the subscriptions module produce notifications on a screen?

texts:
Really struggling with subscriptions on my site or users.

I'm currently trying the subscriptions module, but I am unable to have the user notified on the site iself. I can see it can send emails to the users which is good, but I also would like to have a little notification at the top like stackexchange has.

Anybody point me in the right direction?


texts: Transforming the external link with in the site

texts:
sorry if the title is not apt, I'm new to Drupal. Here I'm working in drupal 7 the site has a news feed module, automatically updates the contents (links). When these links are clicked the corresponding links will be opened in the new tab or in the same tab (closing our actual site). So to avoid this, I would like display the corresponding link's page with in our drupal site. so that our drupal site will be active and the corresponding newsfeed link will be opened within our site (like wise displaying the web page in an iframe)

I tried of using iframes, but couldn't get what i wanted. I came across a module 'Fences' which looks good, but i couldn't know completely about the usage of fences module.

Can any one list out how to solve the issue.


texts: How do I programmatically create a view whose structure is defined at runtime?

texts:
I know I am able to create a view programatically here: "How do I programatically create a view?" - only this requires knowing the structure of the view (e.g. which fields / filters / relationships to use) already.

How can I dynamically create a view at runtime?  Either the view would get stored in the same place as typical views (in the views database) - or it could exist 'In code' except the code is dynamically generated.  E.g. is it possible just to create views ad hoc in hook_views_default_views()?


texts: Getting front page blocks to show on redirected front page

texts:
Here's what I did

I have working content pages I like
I want to have the latest of these display as the front page of my site
When that node displays as the front page, I'd like a few additional blocks to display.    This was easy to solve by configuring the blocks to only show on <front>
I built a view to show the latest page, creating a "node page" display, with "single node" as the style (from Top Node module). I sort by Node: post date. I give it the path "latest"
I set "latest" as the front page of my site.
The front page now goes to the latest node, but the front page only blocks do not display. When I check the source, the body tag does have class "front", but the blocks aren't showing. I tried setting the block configuration to show on page "latest", but that didn't work either.

How do I get the blocks to show? I don't want to build an all new front page using views because I have some programatic things in my template.


texts: Is it possible to use rules to set user profile pictures?

texts:
I would like to use the rules module's Set a data value action to set a user's profile picture whenever that user uploads an image of an "image" content type that I have created.

However, the user profile picture does not appear as an option in the data selector for site:current user.  Is there another way to set the user profile picture using rules or am I out of luck?


texts: How to post the node link in social networking if node is published?

texts:
I want to post the node link along with its title in social media (Twitter, Facebook, and Google+). Node link should be posted only if the content is published.

I have used the HybridAuth and Facebook OAuth (FBOAuth) module for Twitter, Google+, and Facebook login.

How can I achieve this?


texts: How to add the input text field in node view page

texts:
How can i add the field(input filed) for particular content type in submitted node view page.Using this field i can add some text to the particular node. Please suggest me is there any module for this or custom code.....

I think I've made it clear, please answer


texts: How can I custom the grid for each gallery in node gallery?

texts:
I'm working on d7 with the node gallery module.  It works fine, however by default all galleries created with node gallery display with the same number of columns configured in the view.  If in the view the grid has 3 columns all galleries created with node gallery will have 3 colums.

I want for example the gallery1 has 3 columns and the gallery2 has 4 columns, and the gallery3 be 5 columns, etc.

Thanks in advance for your help.


texts: Views Block displaying above node content

texts:
I created a block using Views which is displayed on some particular content. However the block is being displayed before the main content. I tried changing the row weight for the block but this was no use.

All I need is to display the block after the node content.


texts:
I am intermediate in PHP. To polish my skills I start learning Drupal 7. While learning Drupal architecture concepts, the terms hooks and bootstrapping puzzled me a lot. I read the "Pro Drupal development" book, and some documentation on drupal.org, but it is so advanced for me to learn how hooks work in Drupal to display the web page.

Can anyone tell me what hooks are in simple words?


texts: hook_block and rendering a form in content section

texts:
Basically, I have tabs on my modules admin page, I need to show a different form per page.
The node type and forms have been created and the first form on block[0] shows correctly, while the first part of block[1] shows correctly, it also icludes some fields from block[0] and this shouldn't be so.

Here is my hook_block, maybe someone can spot my mistake and point it out to me.

function svm_mail_block($op = 'list', $delta = 0, $edit = array()) {

switch ($op) {
  case 'list':
    $blocks = array(
      0 => array(
        'info' => t('Add New Account'),
        'status' => 1,
        'region' => 'content',
        'visibility' => 1,
        'pages' => array('admin/settings/svm-mail/add-account'),
        ),
      1 => array(
        'info' => t('Update Mail Statistics'),
        'status' => 1,
        'region' => 'content',
        'visibility' => 1,
        'pages' => array('admin/settings/svm-mail/ymlp/update'),
        )
      );
    return $blocks;
    break;

  case 'view':
    if(user_access('create mail account')) {
    switch ($delta) {
      case 0:
        //render node form from http://api.drupal.org/api/drupal/includes!form.inc/function/drupal_get_form/6
        module_load_include('inc', 'node', 'node.pages');
        $node_type = 'svm_mail_account';
        $form_id = $node_type . '_node_form';
        global $user;
        $node = new stdClass();
        $node ->uid = $user->uid;
        $node ->name = (isset($user->name) ? $user ->name: '');
        $node ->type = $node_type;
        $block['subject'] = t('Add New Account');
        $block['content'] = drupal_get_form($form_id,$node);
        dvm($block);
        return $block;
        break;
      case 1:
        module_load_include('inc', 'node', 'node.pages');
        $node_type = 'svm_mail_groups';
        $form_id = $node_type . '_node_form';
        global $user;
        $node = new stdClass();
        $node ->uid = $user->uid;
        $node ->name = (isset($user->name) ? $user ->name: '');
        $node ->type = $node_type;
        $block['subject'] = t('Update Mail Statistics');
        $block['content'] = drupal_get_form($form_id,$node);
        dvm($block);
        return $block;
        break;
    }
    break;
}
 }
}


texts: Error: Maximum function nesting level of '512' reached when injecting custom service to webform (6.x) handler

texts:
I'm trying to use my custom service in the handler like this (in webform 6.0-beta1):
class TriggerAutomationWebformHandler extends WebformHandlerBase {

  /**
   * Ecomail.
   *
   * @var \Drupal\ecomail_automation\EcomailInterface
   */
  protected $ecomail;

  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
    $instance->ecomail = $container->get('ecomail_automation.ecomail');
  }
?>

mymodule.services.yml file looks like this:
services:
  ecomail_automation.ecomail:
    class: Drupal\ecomail_automation\Ecomail
    arguments: [ '@config.factory', '@logger.factory' ]

My Drupal\ecomail_automation\Ecomail class in constructed like this (\Ecomail class is different class in a global namespace - see https://packagist.org/packages/ecomailcz/ecomail):
  public function __construct(ConfigFactoryInterface $config, LoggerChannelFactoryInterface $logger_factory) {
    $this->config = $config->get('ecomail_webform.settings');
    $this->logger = $logger_factory;
    $this->ecomail = new \Ecomail($this->config->get('api_key'));
  }
?>

This leads to error (shortened to important parts):
Error: Maximum function nesting level of '512' reached, aborting! in Drupal\Component\Plugin\PluginBase->__construct() (line 53 of core/lib/Drupal/Component/Plugin/PluginBase.php).

Drupal\Component\Plugin\PluginBase->__construct(Array, 'trigger_automation', Array) (Line: 141)
Drupal\webform\Plugin\WebformHandlerBase::create(Object, Array, 'trigger_automation', Array) (Line: 43)
Drupal\ecomail_automation\Plugin\WebformHandler\TriggerAutomationWebformHandler::create(Object, Array, 'trigger_automation', Array) (Line: 21)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('trigger_automation', Array) (Line: 76)
Drupal\Component\Plugin\PluginManagerBase->createInstance('trigger_automation', Array) (Line: 81)
Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('trigger_automation') (Line: 35)
Drupal\webform\Plugin\WebformHandlerPluginCollection->initializePlugin('trigger_automation') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('trigger_automation') (Line: 40)
Drupal\webform\Plugin\WebformHandlerPluginCollection->initializePlugin('trigger_automation') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('trigger_automation') (Line: 40)
Drupal\webform\Plugin\WebformHandlerPluginCollection->initializePlugin('trigger_automation') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('trigger_automation') (Line: 40)
...

What am I doing wrong?


texts: Assigning custom entities to other entities

texts:
I will like to create a new entity, Job, in my site which can be assigned to other entities, such as Customers.  This would be similar to how Comments are related to Nodes.

In my particular example, the site is for a Local Electrician.  Customers are users (with a particular role). They will be assigned a Job by the administrator. The Job will have it's own attributes and fields like status date, available time slots, Assigned Engineer, etc.

On the Customers Profile, Jobs can be added, emailed, and SMS, similar to a CRM application.

How do I display a Customer Profiles with assigned Jobs attached?


texts:
I have setup a Batch work which looks the following (dump at run time).

The method called for each batch is a public static method, so that is not a problem.

All operations performs perfectly, my nodes are imported in the system, this I'm sure.

The problem is that the Batch progress bar never reaches the 100% and after a few seconds, goes back and forth forever. This clearly happens after all my nodes are processed.

My finished callback is never called and I'm stuck on the Batch API progress bar for years :-)

Any idea on what I could be missing?

Thank you.


texts: Acquia Dev Desktop, PHP 5.6 and SSL certificate issue on local MacOSX

texts:
I am having problems authenticating to SalesForce using the Drupal SalesForce Suite module https://www.drupal.org/project/salesforce

Error opening socket ssl://ap2.salesforce.com:443

I am running Drupal using DevDesktop 2 (Built: Nov 22 2015 12:34:41) on my local MacOSX machine with PHP 5.6 with SSL turned on. On a Ubuntu server I can get the salesforce module to authenticate without an issue using the exact same settings as what I have on the Mac.
When I run this additional test on the Mac I get a similar error:
fsockopen('ssl://google.com',443,$errno,$errstr) ? print("UP") : print("DOWN:".$errstr);

Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in test.php on line 2
Warning: fsockopen(): Failed to enable crypto in test.php on line 2
Warning: fsockopen(): unable to connect to ssl://google.com:443 (Unknown error) in test.php on line 2
DOWN:

When I view phpinfo() I can see that the setting for "Openssl default config" is  /Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/openssl.cnf
This version of Dev Desktop is supposed to support SSL for local development. From the DevDesktop documentation:
https://docs.acquia.com/dev-desktop/sites#https

Using HTTPS (SSL) with local sites
The Local site URL link for local websites provides a Use https check box. When you select the Use https check box, Acquia Dev Desktop serves your site using the HTTPS protocol and uses a self-signed SSL certificate to simulate secure traffic. This enables you to develop and test secure websites locally without requiring you to duplicate the SSL certificates you use on your production site.

Has anyone encountered this before and how do we get DevDesktop to point to the self-signed SSL certificate that is mentioned?


texts: display 2 instances of same block - performance

texts: I need to use the same block on one page on different locations at once. What would be the best option to achieve it, so it would be best for performance? I use context module and I can duplicate block using multiblock module. Is there any better option or printing 2 instances of the same block perform about the same if printed in template or placed using context. Thank you.


texts: Drupal 7: customise archive view to show only blogs from one user

texts: How can I customise the archive view in views 3 so that each user blog page has an archive relating to that page. The default view is for the whole site.


texts: How do I change store based on location?

texts:
I need to have different prices for same products based on country. I was advised to use Price list module and to have different store per each country and I did that.
I.e. I have Swiss store and Serbian store.
For Swiss store for supported billing countries I selected only Switzerland and for Serbian store only Serbia.
Swiss is default one and prices in product variations are defined in CHF. Now I'm trying to override prices for Serbian store (in RSD).
So, I created Serbian price list and added alternative prices for products. Problem is that those alternative prices are used only if I include also Swiss store for that Serbian price list (so price list is active also for Swiss store). If I select only Serbian store, as it suppose to be, then price list is not used (I see default prices in CHF).
I read here: https://drupalcommerce.org/blog/42419/commerce-2x-stories-stores
.. that stores are actually representing billing locations. But that confuses me because product and their prices are displayed before customer enters billing address?!?
What I'm missing here? Why Serbian store is not automatically active if I'm testing from Serbia? Do I need some GEO IP module or something? Even when I'm testing as a logged user (location entered before) I still use default Swiss store instead of local Serbian store.


texts: Cannot create custom translated path alias for /user/login

texts:
I cannot create a path alias for spanish translation.

When I try to create, it says Route is invalid or you don't have access

Saw this but it doesn't have an answer: https://www.drupal.org/project/drupal/issues/236915

How can I translate the /user/login path?


texts:
I have setup a views slideshow, but is anyone able to help me with centering the images in the middle of the slideshow? Some images are not very wide and they are aligned to the left of the slideshow. I would like all images to be in the center to make it look better.

The site I'm working on is here

I have tried adding the following codes to my css but none of them work:

.views-field-field-image-fid img { border-style:solid; border-width:1px; display:block; margin-left: auto; margin-right: auto; position:relative; text-align:center; }

and

.views-field-field-slideshow-image {
     display:block;
     margin-left:auto;
     margin-right:auto;
}

I still cant seem to get it working, I've tried a few other css selectors that I found online as well. Im new to drupal views and quite new to Drupal.

Thank you.


texts:
I am facing a pretty strange problem. I have installed Drupal 7 on my site. Whenever I install a module and tries to access the module's configure page after enabling the module, it leads me to simply /admin/config page without showing the option for that particular module configuration.

sometimes when I do a clear cache the problem gets resolved and then I can access the module's config page. but sometime after installing a module, clear cache gives Internal Server Error 500 .. also I tried to flush the cache manually by making a php file into / directory with the following code:

<?php
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_flush_all_caches();
?>

but this also gives Error 500.

When I disable the installed module, clear cache works as usual...
please help me.


texts: How to print a field in node.tpl.php without labels or markup?

texts:
In Drupal 7, you can render a field in a tpl.php file like this:

But that prints it out with it's label and HTML. Is there a way to get just the raw value of the field.

I know you can do the following:

Override the field markup in the field.tpl.php file (or field--FIELDNAME.tpl.php)
Turn off labels in the admin interface
Use a module like Fences to control mark up in the admin interface.

However, all of those involve extra steps. I was wondering if there is a way to do it directly in the node.tpl.php file. That way, all the changes are contained in a single place. (Plus if you change themes to one that requires the labels, you have to go back in the admin interface and turn them back on).


texts: Issue with "Content: Has taxonomy terms (with depth)" with a content type with a repeated taxonomy

texts:
I have and issue with the view filter "Content: Has taxonomy terms (with depth)".
In my view I'm filtering a content type who as two fields represented by the same taxonomy, and that view filter (Content: Has taxonomy terms (with depth)), do the filter of the union of all the values in the two fields of the same taxonomy. For example:

Taxonomy "Subjects":

deparment1

subject11
subject12
...
subject1n

deparment2

subject21
subject22
...
subject2n

deparment3

subject31
subject32
...
subject3n

Custom type: Annual enrollment

Fields:

...

Subjects enrolled on first period (reference to term Subjects and multivalue)

Subjects enrolled on second period (reference to term Subjects and multivalue)

...

View: Filter for enrollments

...

Content: Has taxonomy terms (with depth)(exposed)

...

For example, in this case, that filter (associated with a Taxonomy and not a content type field) will filter the results for the departments in both subjects enrolled on first and second period, and what I want is that the filter only affects one field (in my real case, I need two of these filters, one for each field).


texts: Image style don't create thumb image and it get error "Division by zero"

texts:
My site is Drupal 7.36
Image style cann't create all images and it get 2 error messages

Division by zero in theme_image_style_preview() (line 804 of /Users/snappy/Sites/betterpack/modules/image/image.admin.inc)
array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line 806 of /Users/snappy/Sites/betterpack/modules/image/image.admin.inc)

and I did:

sudo chmod -R 777 sites/default/files/styles

It not work
Help me please.
Thank you everyone and sorry I write weak in English but I can read good English.

ls command in sites/default/files/styles

ls -l
total 0
drwxrwxrwx  3 _www  staff  102 Jun  7  2014 cover_article
drwxrwxrwx  3 _www  staff  102 Mar 28 19:47 cover_product
drwxrwxrwx  3 _www  staff  102 May  9  2014 large
drwxrwxrwx  3 _www  staff  102 Jun  5  2014 medium
drwxrwxrwx  3 _www  staff  102 Jun  6  2014 node_porduct
drwxrwxrwx  3 _www  staff  102 Jun  6  2014 related_product
drwxrwxrwx  3 _www  staff  102 Jun  7  2014 thumb_gallery_article
drwxrwxrwx  3 _www  staff  102 May  9  2014 thumbnail


texts: Drupal multisite: Same theme, different colors

texts:
I am looking for an answer to a quite specific theming question:

I have a Drupal multi-site installation. (Well, not yet actually, but I want clarity on my question first before I procees. Just asume that I have one.)

I have a team, called 'Theme', which has various files in the directory /sites/all/themes/Theme. In this folder, there are the .tpl.php files and a few folders like css/ and scripts/.

Then, I have 2 sites, which use the same theme: Theme. These sites are located in /sites/default and /sites/alternative.

What I want to do now is providing a file, colors.css in each sites directory (so /sites/default/colors.css and /sites/alternative/colors.css with something like:

@base: blue;
@light: lightblue;
@dark: darkblue;

This file should be read and these 'variables' should replace the variables in the css files located in /sites/all/themes/Theme/css so that I simply can define the colors in each site, without having to modify or to overwrite bits of the css files located in /sites/all/themes/Theme/css.

I already tried a few things, one which could work but I didn't like enough, so I am looking for a general, good and most important, fast method.

What I already have achieved and what (I think) is very usefull:

function theme_css_alter(&$css) {
    $css['sites/all/themes/Theme/css/colors.css']['data'] = conf_path() . '/colors.css';
}

This function changes the default colors.css provided in /sites/all/themes/Theme/css/colors.css and replaces it with /sites/default/colors.css OR /sites/alternative/colors.css, depending on where you are.

I have already tried the following:

Used PHP to get the correct colors.css file and use PHP-variables all over my CSS-files. This should actually work. But I don't quite like it because you end up with a lot of .php files which are actually .css and a lot of ugly php-syntax in the css files.
I tried the lessphp drupal plugin. This did it's work for replacing the variables but the caveat was this: If I want to include the correct colors.css file, I need to use php. Therefore, my less file needs to have the extension PHP. LESS is build so that you can only 'parse' files with the less extension, so this wouldn't work. I quite liked this though, it used some nice caching which would also be the quickest way. What I could do here is dive into the lessphp library and change the code that says 'only .less files please!' to also accept .less.php files.

So, my questions are:

Does anybody see a different approach that would also work and is fast?
If yes: please elaborate
If no: Which of my previous methods do you fancy and why? What would be the best approach?


texts: Don't show block until after a number of comments

texts:
I have created a block and I don't want it to display until there are a number of comments posted on the node because if I just display the block the site will look ugly.

How would I go on to make it that when the node has lets say 6 comments the block or some content will show but when the node has less than 6 comments the block wont show.


texts: When emails are sent from my dev drupal site to new users the sender is listed as the first part of the site's email address ("info" from "info@mydomainname.com.au" (screenshot below)). Ideally I would like it to be the site's name. How can I control this? Thank you.


texts:
My new drupal theme zeropiont isnt showing up in drupal 7.
I placed zeropint drupal theme in the /sites/all/themes or sites/default/themes directories.
It is not showing into appearance.


texts: Redirect rule doesn't contain all the query parameters

texts:
I`ve set up a Rule to redirect a user after log in.
The Rule works redirecting the user to the URL specified, but it doesn't contain all the query parameters after "?".

This is the URL value:

user/login?destination=node/4?cid1=[entity-fetched-household:0:contact-id]&cs1=[entity-fetched-household:0:hash]&cid2=[account:civicrm-contact:contact-id]&cs2=[account:civicrm-contact:hash]

But the user is redirected to the following one:

user/login?destination=node/4?cid1=[entity-fetched-household:0:contact-id]

just containing the first query parameter cid1.

I've checked the other parameters, cs1, cid2, cs2, contain the correct values.

This is the export of the Rule:

{ "rules_add_parameters_to_url_related_to_contact_id" : {

"LABEL" : "Add parameters to url related to contact id",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "path" ],
"ON" : { "user_login" : [] },
"DO" : [
  { "entity_query" : {
      "USING" : {
        "type" : "civicrm_contact",
        "property" : "display_name",
        "value" : [ "account:civicrm-contact:household-name" ],
        "limit" : "1"
      },
      "PROVIDE" : { "entity_fetched" : { "entity_fetched_household" : "Fetched entity" } }
    }
  },
  { "redirect" : { "url" : "user\/login?destination=node\/4?cid1=[entity-fetched-household:0:contact-id]\u0026cs1=[entity-fetched-household:0:hash]\u0026cid2=[account:civicrm-contact:contact-id]\u0026cs2=[account:civicrm-contact:hash]" } },
]
  }
}

Any help will be really appreciated.


texts: Programmatically set Panelizer View Template on Node

texts:
I have panelizer installed so that I can panelize the full content views on a node by node basis on my content types. For example I have a news content type but I have a default panelizer view mode and I have a 'press release' version meant for the news nodes that are considered press releases.

I'm attempting to perform a query on them so I can programmatically set the view modes in bulk instead of having to go through each node and do it manually, but I'm having trouble. The machine names of the views are 'news' and 'press_release' and I'm attempting to change them like so

$node->panelizer->view_mode = 'press_release';
$node->save();

But it doesn't seem to have any effect. How would I programmatically change the panelizer view mode on a node?

UPDATE:
I used $node->panelizer->getValue(); and this is what I received.

string(4) "news"
array(2) {
  [0]=>
  array(3) {
    ["view_mode"]=>
    string(4) "news"
    ["default"]=>
    string(4) "news"
    ["panels_display"]=>
    array(0) {
    }
  }
  [1]=>
  array(3) {
    ["view_mode"]=>
    string(4) "full"
    ["default"]=>
    string(13) "press_release"
    ["panels_display"]=>
    array(0) {
    }
  }
}

It seemed like instead of getting the view_mode that is set I got every view mode which made me think Iwas on the wrong path.


texts: Restrict block to specific pages is broken when using view pagination

texts:
I have a block I want displayed on a view page, which has filtering and pagination. The block shows fine when you change the filter, but if you go to page 2 (or any other page than the first), the block disappears. In the block config I have the following under "Only the listed pages":

myview
myview/*

How do I make it appear on all the pages in the view?


texts: How to create a Search API search box that redirects you to the search page

texts:
I am using Drupal 8 and the Search API. I have created a search page using the API and views (basically modified the view that came prebuilt when you install the search API). Everything works as expected when you are on the search page doing a search.

The problem I am having is that I would like to create a search block identical to the one the default Drupal Search creates with the same behaviour. Meaning that when you enter a search term, it redirects you to the search page displaying the search results. I can't figure how to do this (assuming it is possible to do so).

I have created a search block but it wants to display the results of the search in the block itself. I don't know how to make the search block redirect to the search page.

I know when using the default search block you can implement the following hook:

function mytheme_search_box_form_submit($form, &$form_state) {
   $form_state['#redirect'] = 'path of redirect';
}

Is there something similar for the Search API?


texts: How to override subtheme settings (inheritance)?

texts:
I am having some difficulty overwriting my subtheme code using my own theme.css file (located in sites>all>themes). I can find the code that results in the display of whichever css style property I'm trying to change (e.g., font-family in the header region) easily, using the chrome DevTool, but when I go to target that area in my own css file it seems not to have any effect on the display. Is there any general methodology with which I can go about inheriting my adjustments to the theme styles? FYI I have renamed my subtheme's files so that is not the issue.

Any help would be wonderful.