texts: Allowing unlimited values for a field in programmatically defined form

texts:
I am trying to insert a custom form into a page in my Drupal 8 site. This form has 2 fields which need to accept unlimited values (one textfield, one fieldset).

In my current implementation, I have declared this form as a class, defined in the src folder of a module, and my .module file adds this form to the $build array via hook_node_view_alter():

$build['myform'] = \Drupal::formBuilder()->getForm('Drupal\my_module_hook\Form\MyForm');

My class constructs the form using public function buildForm(array $form, FormStateInterface $form_state). I am not sure how to set up a field such that it can accept unlimited values.

I'm aware that tutorials and answers on this topic using Ajax exist such as this and this, but all such examples are using $form_state as an array, which breaks my code as $form_state is an object.

Is building this form as a class the wrong way to do it? If not, how exactly do I accomplish what I'm trying to do without using $form_state as an array? If so, how can I insert my form into the page otherwise? I'm not understanding how other answers and tutorials on the subject are accomplishing this since these functions are usually shown out of context.


texts: Update user profile picture using entity_metadata_wrapper

texts:
I am trying to update the user profile picture using entity_metadata_wrapper. But I am getting

  "Unknown data property picture." error.

When I check the user property info, I cant see the picture field as well. Below is my example code:

$user = entity_metadata_wrapper('user', $form_state['entity_id']);
if (isset($form_state['values']['user_profile_pic'])) {
   $file = file_load($form_state['values']['user_profile_pic']);
   $file->status = FILE_STATUS_PERMANENT;
   file_save($file);
$user->picture = $file;
}

Thanks in advance.


texts: Set value on newly created node using Rules

texts:
This is what I have now:
Content type 123 has a Entity Reference field referencing content type XYZ.
If new content is created of type XYZ then Rules creates new content of type 123.
So by creating 1 new node (of type XYZ) I get one extra of type 123.

This is what I'm missing:
How do I set the Entity Reference field of 123 correctly by using Rules?


texts: Error in Views override template "Notice: Undefined offset: 1 in include()"

texts:
So I am theming a View with a template in my theme folder.

I am getting this error message:

"Notice: Undefined offset: 1 in include()"

This is the code:

<?php print ($fields["title"]->content); ?>

I've tried adding an IF statement like below (is my syntax correct???) and clearing the cache but the issue persists:

<?php if ($fields["title"]->content) { print ($fields["title"]->content); } ?>

P.S. the field is printing, it's just that there is an error message displayed in addition.

Also, by the way, I am using views-view-fields.tpl.php


texts:
I have an RSS feed going into mailchimp for my website (www.abercynonprimary.org.uk), feeding off the News page which is a View of teasers. The feed address is the website address with "/news.xml" on the end.

The problem I have is that mailchimp needs the tag :

<content:encoded>

somewhere in the feed, in order for me to properly use the mailchimp rss tag of full_content. At the moment, as mailchimp cant see the content:encoded html tag in my feed, it treats it as summary content, and generates a Read More in my Newsletter which doesnt work (links to nothing).

I'm just using the Views setting of Content (not fields) in my News View for the feed (see screen shot attached). I have also attached the note back from Mailchimp Support.

Mailchimp Support - *"I checked the feed for the your account and it appears that there's "content:encoded" within the feed, but it is not explicitly spelled out in the tags as

<content:encoded>

In order for MailChimp to read this as expected, this tag needs to display exactly as stated in the Merge Tags article on the feed.
Once these tags are added, things should work as expected and you would only need the default "read more" link that comes with the Merge tag. "*

can anyone help me get my feed to show full content instead of defaulting to summary, and therefore causing Mailchimp to generate a Read More which doesnt work.

thanks


texts: In Drupal Commerce, what is the difference from a product, product type, and product display?

texts:
I'm coming from ubercart and want to transition to drupal 7 commerce 1.x, but its very confusing on how this all relates to one another. First off I just want to clarify, what the difference from a product, product type, and product display?

I read a few online tutorials, but its not very clear on distinguishing how each one relates and how it is setup.


texts: How make a standalone field with no Entity or Bundle?

texts:
I want to add a custom configuration form to my module; I don't know if making a custom schema is better or if I should make a standalone field and use its different field APIs to deal with the value.

Can I create a standalone field with no entity or bundle? If I can't, what would be the alternatives?


texts: How to sort solr search results by most matching keywords?

texts:
I'm using apachesolr in drupal commerce site. If user searches for a book spring, it returns all results which contain the word spring. But If I search for Spring Sofia or Spring by sofia (sofia is author name), It should return the book Spring by Sofia first and then show the rest of the results. Right now it's shown somewhere in the middle.

How can I make it to sort results keeping in view all the keywords?
Thanks for help.


texts: Module dependent on field configuration in another module

texts:
I have two modules that rely on the same field; A simple boolean field that represents a state for taxonomy terms. My problem is my configuration management for this. My ideal situation would be to put this field storage configuration in my site's config directory and then both modules' info files specify a configuration dependency (using the field config's ID) on this field. But I cannot get it working.

This is what I have tried to far in both my module's info files:

dependencies:
  - taxonomy
  - config:
    - taxonomy_term.field_my_field

and

config_dependencies:
  - taxonomy_term.field_my_field

For both of these methods, the field.storage.taxonomy_term.field_my_field.yml file is among the rest of the site's config. I can move it to either module's config/install directories and it makes no difference.

My field's storage config file is as so:

uuid: 8e23dc90-2da9-4824-9783-093181987869
langcode: en
status: true
dependencies:
  module:
    - taxonomy
_core:
  default_config_hash: pr_yX1hCVsd_ni59pjsAQh5n7hCJ2eAnPNzJCBCHJig
id: taxonomy_term.field_my_field
field_name: field_my_field
entity_type: taxonomy_term
type: boolean
settings: {  }
module: core
locked: false
cardinality: 1
translatable: true
indexes: {  }
persist_with_no_fields: false
custom_storage: false

So my question is, what is generally the best practice for managing a single piece of configuration that's required by 2+ modules?


texts: Views rewrite output including the wrapper divs?

texts:
I have 3 fields in a view and I want to rewrite the output in a fourth field.
like this

[field1][field2][field3][field4]

But I want to have a wrapper div around each field like in the field settings.
The problem is I could do something like this:

[field1]

[field2]

[field3]

[field4]

But with this even if the field is empty the divs with the css classes will stay alive.
I dont want that. If the field is empty dont display it with the
.

If I just display the field, there are no wrappers at all.


texts: Programmatically get menu block & alter classes

texts:
I'm invoking a menu block programmatically using:
    module_invoke('menu_block', 'block_view', 13);

What I want to do is change and add classes to the wrapper & ul tags of the menu block, is this possible? I can't seem to find a class_array to add  & have spent a significant amount of time looking through documentation & online but not come up with a solution.


texts: Modify form elements based on current select box value in same form?

texts: I'm writing a custom module and I have a select box in a form with two values, Test and Production.  I want to remove a specific fieldset from the form if Production is selected, and add it back if Test is selected.  Is there a straightforward way of doing this?


texts: "You are not authorized to access this page." immediately after logging in with any user

texts:
I'm getting the seemingly famous You are not authorized to access this page. message whenever I log in to my local development environment from /user or from /user/login. I'm on Drupal 7.26, PHP 5.6.3, running under XAMPP 3.2.1.

I've tried clearing all browser history, truncating flood and session tables, making sure I'm not defining $cookie_domain. I'm sure I've tried other things, but nothing seems to work. What should I try next?

This is one of those "this worked yesterday" things that became one of those "I was sure I fixed this but I have no idea how" things.

edit: So I ran the following to disable most of the modules and then logging in worked again:

drush @alias pm-list --type=Module --no-core --status=enabled | sed 's/.*(//' | sed 's/).*//' | sed '/^ *$/d' | sed '/^.*views.*$/d' | sed '/^.*entity.*$/d' | sed '/^.*ctool.*$/d' | sed '/^.*ctool.*$/d' | sed '/^.*date.*$/d' | sed '/^field_collection$/d' | sed '/^link$/d' | sed '/^youtube$/d' | sed '/^block.*$/d' | tail -n+2 > modules.txt; cat modules.txt
drush @alias dis `cat modules.txt`
drush @alias cache-clear all

I did have some issues such as Fatal error: Call to undefined function entityreference_get_behavior_handlers() in entityreference_schema(), which is why that command is so ugly. (I'm sure there's a neater sed command.) Now I'm turning on the modules one at a time.

edit: Disabling all modules and then re-enabling all modules except for the libraries module and modules that depend on allows us to log in again. However, enabling that module breaks logging in. This problem is only in our local development environments, not our hosted environments.


texts: Cannot update my website from 7.60 to any higher version

texts:
My website is currently running on the agov-7.x-3.x-dev core and the 7.60 drupal core version. I tried to update the site to Drupal core 7.61, but site showed a fatal error.

  Fatal error: Class 'MediaReadOnlyStreamWrapper' not found in
  /home/####/public_html/dev.####/sites/all/modules/media_oembed/includes/MediaOEmbedStreamWrapper.inc on line 12

I uninstalled the media_oembed module and tried again to update the site to Drupal core 7.61; another fatal error is now displayed and still the site is unusable.

  Fatal error: Class 'Class entity' not found in
  /home/####/public_html/dev.####/sites/all/modules/fb_autopost/includes/...
  on line 138

So I uninstalled the fb_autopost module and all its dependencies, and tried again to update the website to the Drupal core 7.61, but also another module displayed a fatal error and the website became unusable at all.

  Fatal error: Call to undefined function libraries_load() in
  /home/#####/public_html/dev.#####/sites/all/modules/colorbox/colorbox.module on line 224

I have tried the solution listed on the (Registry Rebuild Module) page hoping it will help but with no avail:

How To Use Registry Rebuild Without Drush

  This isn't a module, but it's just packaged as a module download to
  make it so it's easy to find and people can download it as a package.

I cannot update my website at all. Can anybody help?

Note that all contributed modules are up-to-date; before any Drupal core update, the website used to work just fine.


texts:
Below I check for file existence and its exists.

$path = libraries_get_path('nusoap') . '/nusoap.php';
if(file_exists($path)) {
    print file_get_contents($path);
    die;
}

But when I try to include it I get 500 Internal server error.

$path = libraries_get_path('nusoap') . '/nusoap.php';
if(file_exists($path)) {
    require_once $path;
}

Owner and Group of all files are www-data

EDIT

[Mon Dec 24 12:59:12 2012] [error] [client 2.146.17.144] PHP Fatal error:  Cannot redeclare class XMLSchema in /sites/all/modules/fedora_store/nusoap/nusoap.php on line 2049, referer: http://127.0.0.1/fedora/store/transaction/2/mellat


texts: Vague error message on config import: Config x depends on x that will not exist after import

texts:
I don't understand what is missing. It's just a simple blogpost content type that I created before I reset the db and tried to re-import it. All the modules requires are enabled and I did try to clear the cache. Run updb Tried drush cim --partial. nothing has worked. This is the error:

Import the listed configuration changes? (y/n): y
Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.                                                         [error]
Configuration field.field.node.blog_post.field_post_category depends on the field.storage.node.field_post_category configuration that will not exist after import.
Configuration field.field.node.blog_post.field_post_featured_images depends on the field.storage.node.field_post_featured_images configuration that will not exist after import.
Configuration field.field.node.blog_post.field_post_video depends on the field.storage.node.field_post_video configuration that will not exist after import. in Drupal\Core\Config\ConfigImporter->validate()
(line 737 of /var/www/localvolumes/html/core/lib/Drupal/Core/Config/ConfigImporter.php).
The import failed due for the following reasons:                                                                                [error]
Configuration field.field.node.blog_post.field_post_category depends on the field.storage.node.field_post_category configuration that will not exist after import.
Configuration field.field.node.blog_post.field_post_featured_images depends on the field.storage.node.field_post_featured_images configuration that will not exist after import.
Configuration field.field.node.blog_post.field_post_video depends on the field.storage.node.field_post_video configuration that will not exist after import.


texts:
On submitting a form getting error as

Error: Call to a member function format() on null.

Here is the function:

public function submitForm(array &$form, FormStateInterface $form_state) {
  $exp_date = $form_state->getValue('expire_date')->format('H:i:s');
}


texts: Add user's role as a class to all user links

texts:
My goal is to attach a users role as a class to their user name anywhere it is displayed so I can color the link based on role.

I can get roles of every displayed user link using MYTHEME_username_alter:

function MYTHEME_username_alter(&$name, $account) {
  $user = user_load($account->uid);
  // I can get the roles of each user link through $user
}

Is this the most efficient way to get the role for each user link?
What is the best way to go about adding the role as a class to every user link?
Am I way off track and overlooking an easier way to complete my goal?


texts:
I manually update an order using the following code.

db_update('uc_orders') // Table name no longer needs {}
  ->fields(array(
    'order_status' => 'payment_received',
  ))
  ->condition('order_id', $order->order_id)
  ->execute();

Then I visit /admin/store/orders/view, but the value for the order still shows a Pending. If I clear the cache, the new status is Payment received, as it should be.

How do I clear the specific order cache so that it updates immediately?

The following code does what I want, but I would prefer clearing the cache for the specific order that is manually updated.

$orderEntity = Order::load($order_id);
$orderEntity->setStatusId('payment_received');
$orderEntity->save();


texts: Custom login form with signin button -- POSTing registration

texts:
I have added a "register" button to the login form which is shown as a block on my homepage. I want the button to simply redirect to the registration page but it's POSTing to login and error'ing -- any ideas?

  function MYMODULE_form_user_login_alter(&$form, &$form_state) {
    $form['actions']['register'] = array(
      '#type' => 'submit',
      '#value' => t('Sign Up'),
      '#submit' => array('_user_login_register_submit')
    );
  }

  function _user_login_register_submit($form, &$form_state) {
    drupal_goto('user/register');
  }


texts: Integration with Windows Azure Active Directory

texts: My client want to integrate Azure Active Directory with Drupal.  Is this possible?  What is the best starting point for this process?


texts: add a block of related products to any search result item

texts:
What I want is , when a user searches for a special product , for each single search result a block of similar products show up (containing products image and product title as images alt).

I do have a taxonomy vocabulary called usability with terms gaming , light weight and ... ,

so if a search result is of kind product , the block of related products should be seen under it

So my questions are :

how to alter search result view so I can place my block
how can I fetch data of an result item to pass it to view filter


texts: Difficulties with the #ajax form item attribute

texts:
My form item is the following one:

$form['foo'] = array(
  '#title' => t('Foo'),
  '#type' => 'radios',
  '#options' => $options,
  '#description' => t('Lorem ipsum.'),
  '#required' => true,
  '#ajax' => array(
    'callback' => 'foo_get_js',
    'wrapper' => 'foo-wrapper',
    'event' => 'click',
    'method' => 'replace',
  ),
);

My AJAX function is the following one:

function foo_get_js($form, $form_state) {
  return mktime().'<xmp>'.print_r($form_state['values'], true).'</xmp>';
}

My wrapper will get updated the first time the ajax call is made, but after that it will stay the same: the time and $form_state don't get updated. If I use the 'append' method instead of the 'replace' method then everything works as intended.

Is it the supposed behavior?


texts: What is best for setting up the vocabulary for ubercart products?

texts:
I'm setting up an Ubercart store on drupal 7.

I've created a new product class "tire" and I'm adding custom fields to the "tire" content type.  Some of these fields such as brand and speed rating should to pull their values from a vocabulary.

What is best for setting up the vocabulary?

Option 1)
Tires -> Type -> All-Season, Winter, etc...
Brand -> Good Year, Dunlop, etc...
Speed Rating -> S, T, H, etc...

Option 2)
Tires -> Type -> All-Season, Winter, etc...
Tire Properties -> Brand -> Good Year, Dunlop, etc...
Tire Properties -> Speed Rating -> S, T, H, etc...

Option 3)
Tires -> Type       -> All-Season, Winter, etc...
Tires -> Properties -> Brand        -> Good Year, Dunlop, etc...
Tires -> Properties -> Speed Rating -> S, T, H, etc...

I've started with option 3 already, but I've noticed that when I go to add a new tire the drop-downs are allowing values from the entire vocabulary, not just a specific child-node such as everything below "brand".

I'm not really sure what the best-practice is for setting vocabularies for custom fields using the CCK module.


texts: Organic Groups Admin can't edit own group's user's profiles?

texts:
Using D7, does OG lack a very basic permission like administrate users of own group?

All I want is that a OG administrator can edit the user profile of the group members - but this doesn't seem to be possible.

I can give all authenticated users the permission access user profiles. Then the user profile page can be called and viewed by anyone else. I don't want that. And I cannot give the administer users permission to anyone.

I just want to have administrators of a group edit their user's profiles.

Did I overlook anything? Is there a group specific permission anywhere? All the OG permissions do not work here.

Only thing I found is this - but this seems hackish and not really a solution (and for D6).

Thanks in advance.


texts: login destination redirect to previous page adding #

texts:
The following code works for me to redirect the user back to the previous current page after he/she logs in.

 <?php
    print l(t('Please Log in'),'/user/login', array(
    'attributes' => array('title' => t('Log in page')),
    'query' => drupal_get_destination()));
    ?>

However, how can I add # to the previous current page?

For example, if the user was on /node/1 and go to the login page.
Then How can I redirect this user to /node/1#article_1 ?

(How can I add this #article_1? )


texts: Views exposed filter for children terms when on parent term page

texts:
I have created a views with multiple exposed filters and I need another filter that is based on taxonomy.

My taxonomy structure is:

term 1

child 1.1
child 1.2

term 2

child 2.1
child 2.2

What I want is the following;

path: site.com/taxonomy/term/1

Exposed filter that can filter shows only;

child 1.1
child 1.2

How I have a filter that shows all taxonomy structure or when using depth it shows all child terms? Like this;

child 1.1
child 1.2
child 2.1
child 2.2

I'm sure there must be a way to only show the related child terms when on the parent term page.

thanks


texts: How to create navigation menu on sidebar with different navigation links displayed on different pages?

texts:
I am using Drupal-7.

I have created Dropdown menu with Megamenu.
Now, I wanted to create navigation menu on left side that menu items will be different on each page.
I have created navigation block region for left side bar and wanted to create dynamic left side menu for each pages.
For example:

If our page structure is:

1.0
1.1

    1.1.1

1.2
    1.2.1
1.3
    1.3.1
    1.3.2
    1.3.3
        1.3.3.1
    1.3.4
    1.3.5
    1.3.6

So, on 1.0 page on left side menu should appears like this:

1.0
    1.1
        1.1.1
1.2
    1.2.1
1.3
    1.3.1
    1.3.2
    1.3.3
        1.3.3.1
    1.3.4
    1.3.5
    1.3.6

On page 1.1 left side menu - It should be only - 1.1.1
On page 1.2 left side menu - It should be only - 1.2.1

On page 1.3, it should be like this:

1.3
    1.3.1
    1.3.2
    1.3.3
        1.3.3.1
    1.3.4
    1.3.5
    1.3.6

On page 1.3.1, 1.3.2, 1.3.4, 1.3.5 and 1.3.6 - no item on left sidebar.

On page 1.3.3 - only 1.3.3.1 should be there.

Can anyone please let me know that how should I create left side bar menu like this? Do I have to use Menu Block module for that? If I have to use Menu Block module then how do I create menu items that will be displayed different on each pages?

Thanks!


texts: Adding javascript to module and access drupalSettings without jQuery

texts:
I am trying to create a Drupal 8 version of the Mautic Drupal module. Currently I have just ported the Drupal 7 version as is, and the script for Mautic forms along with the tracking pixel is printed in a block. Mautic now uses a tracking script and I want to update the module to use it. The tracking script looks like this (notice the Mautic base url required):

js/mautic_drupal_tracking_code.js

(function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
    w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
        m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
})(window,document,'script', + drupalSettings.mautic_drupal.mautic_drupal_tracking_code.base_url + '/mtc.js','mt');

mt('send', 'pageview');

The script is showing on the page, but as I am trying to avoid jQuery, I can not find out how to access the drupalSettings variable.

My module code is updated and not in sync with the github repo. Here are a description of the files:

mautic_drupal.libraries.yml

mautic_drupal_tracking_code:
  version: VERSION
  js:
    js/mautic_drupal_tracking_code.js: {}
  dependencies:
    - core/drupalSettings

mautic_drupal.module

/**
 * Implements hook_page_attachments_alter().
 *
 * @param array $page
 */
function mautic_drupal_page_attachments_alter(array &$page) {
  $config = \Drupal::service('config.factory')->get('mautic_drupal.settings');
  $mautic_url = trim($config->get('base_url'), ' \t\n\r\0\x0B/');

  if ($mautic_url != '') {
    $page['#attached']['drupalSettings']['mautic_drupal']['mautic_drupal_tracking_code']['base_url'] = $mautic_url;
    $page['#attached']['library'][] = 'mautic_drupal/mautic_drupal_tracking_code';
  }
}

On the site, the script is showing, and the base url setting is set. But alas, I can not access the settings in my javascript, I can only find examples of how to do that in jQuery scripts.

Is this possible to do in pure javascript?


texts:
I use Drupal Commerce module and Views Slideshow. In Fields I have this (Products referenced by field_product) Commerce Product: Product Image field and in Relationships Content: Product, it is an image field and selecting Link image to: Content it links it to admin/commerce/products/4 when the product display for user is node/5

What I do wrong?


texts:
I've set my comments display order to be oldest first. When there are more comments than the number allowed per page, the comments are spread across 2 pages and a pager is provided.

My issue is that when you first come to the node to see the comments, you see the older comments. You then have to click to the 2nd page to see the latest comments.

I understand from a logical perspective why it works this way, but I don't think its the best for usability. How can I make it so when you arrive at a node you see the last page of comments by default? Do I need to use a views override?
Thanks

Note, in case its of interest this point has been raised by the drupal experts lullabot:
http://www.lullabot.com/articles/drupal-usability-comment-configuration

  While shorter pages are generally more usable, setting the number of
  comments per page to a low number comes in conflict with my
  recommendation of setting the display order to oldest first. With a
  small number, it is very possible that the latest comments will not be
  listed on the initial page and will require several clicks and
  scrolling to get to them. This is bad. A better solution is to set the
  comments per page as high as possible. Users will intuitively scroll
  down to find the latest stuff.


texts: Should I disallow drupal path or alias by robots.txt?

texts:
I have 2 languages enabled on my site English and Japanese.

Japanese is the default and English has prefix "en".

I want search engines to crawl one View page only in Japanese.

So I decided to use Disallow: /en/my-view/* in robots.txt but my-view has alias.

Should I use Disallow: /en/my-view/* or Disallow: /en/alias-my-view/* ?


texts: How should the code structure of a distribution look like?

texts:
I'm making a distribution and so far it consists of only one module which holds the whole code.

Since D8 is now fully OOP and has autoloader and other stuff I was wondering how should the structure of the distribution look like.

The profile should be empty and the module should hold all logic
The profile should hold all logic and act as a module and no additional module is required
The profile should be empty and the one large module should be split into smaller modules

The modules holding all the logic is big but it holds only the core functionality so splitting it into smaller modules would be good only for easier orientation in files but the rewriting that it would take does not compensate the change.

On the other hand moving everything into profile actually sounds good. I don't see any point in having the profile encapsulate the module just because.. And rewriting the code in this case would be easy.

And finally: the current model - empty profile with one big module. I have no problem with this other than having the empty profile sitting on top if it all.

What do you think?


texts: Do third party drupal modules pose a security risk?

texts:
This may very well be a stupid question but there is no avoiding it now. Unfortunately myself and many others succumbed to the temptation of skipping learning ubercart in lieu of obtaining a seemingly quick and easy 3rd party module for commerce.

Today drupal alerted me to an update for this 3rd party module but deleting it is not picked up by the refreshed module list, it simply vanishes and then when you try installing new version it remains stuck in checked position so that no new version can be installed and no uninstall can ever take place.

Of course the creator of this module has disappeared off the planet leaving myself and many others with less money in our pockets and red faced and some very angry with no support.

All of us say it is the first paid drupal module we've ever acquired because it did seem such a very good idea and easy to implement and the young man who made it was extremely helpful and professional at first.

It is still working on my site albeit unable to be updated but strange companies like soso.com in China have infiltrated this creator's site and are being listed in user's list of domains including mine so is this not a most terrible security risk for anyone using it with rest of the well maintained open source drupal?

update: the owner of these modules has actually returned and is back to usual professional good self. :) all's well that ends well.


texts: Paragraphs Collection (Behavior plugins) vs. Field Group

texts:
I'm trying to build a site (or define site a building configuration), which allows editors to create their own layouts using the Paragraphs  module. Powerful options for editors, reuseability across different projects and full control over the generated HTML are important.

There will be grid paragraphs to create the layout/structure containing content paragraphs for image, text, sliders, videos, accordions, etc. Most paragraphs will have "non-content" data like column width, background color, slider autoplay on/off, etc. So far I've found two ways the to handle the non-content part, but I'm unsure which is the better way to do it:

A) Use normal fields for non-content settings and Field Group to create finetune the editor interface. Use template preprocessing and/or Twig logic to create the desired frontend output. (Do frontend coding in a base theme to allow reuseability across different projects.)

B) Use the Plugin-system from Paragraphs Collection to create "behavior" plugins (code and YAML configuration) for non-content settings. Get the frontend stuff done with preprocessing in the module's code.

The collection plugin was created by the maintainers of the paragraphs plugin themselves, so B) is obviously the way it should be done. It also more clearly separates content from design/other stuff. However, I'm usually doing frontend coding, and while I'm used to PHP, I'm fairly new to Drupal, so A) would be the path I'm used to. Also the paragraphs behavior plugin is explicitly labelled as experimental and not ready for production use.

I'm looking for some hints from experienced Drupalers on which route to take, also concerning long term maintenance for many small sites (at least 4-5 years) and reuseability across different client projects.


texts: Render multiple taxonomy term input as unordered list

texts:
We have a content type allowing input from taxonomy term lists, and some fields allow multiple values.  When there are multiple values, the output always seems to string them together inline, as much as will fit the available display width. We are aware of the option "separated" with the option of commas, spaces, or slashes, but that still renders multiple terms on the same line if they fit.

What's desired is to render multiple terms in a one-item-per-line list, preferably an unordered list with or without bullets.  I tried looking at the CSS but all I could do was to add bullets, although it still rendered multiple terms inline. Suggestions? Thanks.


texts: Is it possible to put existing/shared Content type fields as Feature code each in their own individual file to simplify/avoid git merge conflicts?

texts:
We have a set of content types that share common fields - in that we re-use them in several content types.

When recreating these content types as a Feature, the fields are all in one large file. This has proven to be difficult when resolving git merge conflicts when people adjust/remove/or add fields to content types as a normal part of development. The git ===== >>>>> <<<<< conflict markers 'cross over' different fields and make it hard to see how the merge should be done correctly.

I think a better solution is to have each field in its own file, even if there are hundreds, the host file system should be able to handle this, perhaps even use of directories may help, this would avoid complex merge conflict resolutions.

Is this single file per field possible?


texts: Use ajax not working in views block displayed programmatically

texts:
I have a view with a block display. In the "OTHER" area of the view settings, I checked "Use Ajax".

I display this block programmatically inside a node in this way

print $view->render('block_1');

The block is displayed, but when I use the pager to go to the next page of the results, ajax is not used and the page is reloaded with "page=1" added to the url.

any idea?
thank you

I found the solution

To have the "use ajax" working, you have to render the view using:

$view->set_display('block_1');
print $view->preview('block_1');


texts: How can I display the of result count of a view in its header?

texts: Without writing using any Drupal db functions, how can I display the total/count/number of results of a view in its Header?


texts: Cannot find a value from the local configuration manager?

texts:
In D8 in the configuration manager I have a value:

CURRENT VALUE FOR COMMERCE_PAYMENT.COMMERCE_PAYMENT_GATEWAY.COINPAYMENTS

with YAML file

uuid: xxxx
langcode: en
status: true
dependencies:
  module:
    - commerce_coinpayments
id: coinpayments
label: Coinpayments
weight: null
plugin: coinpayments_redirect
configuration:
  business: ''
  allow_supported_currencies: '1'
  ipn_logging: 'yes'
  merchant: ''
  ipn_secret: xxxxxx
  display_label: 'Pay with Bitcoin, Litecoin, and other of more then 50 cryptocurrencies.'
  mode: test
  payment_method_types:
    - credit_card
  merchant_id: 1111
  currency_code: EUR
conditions: {  }
conditionOperator: AND

The values are changed for privacy of course.

I tried the retrieve the value of Merchant_id with code:

trim($this->commerceCoinpayments->get('configuration')['merchant_id']));

But still this is empty. How is this possible?


texts: How can I unset an option provided by the User Relationships module on the user edit page?

texts:
I want to remove the 'Receive e-mail notification of relationship activity' option from the user edit page.

The hook is provided in user_relationship_mailer.module:

/**
 * Implements hook_form_alter().
 */
function user_relationship_mailer_form_alter(&$form, &$form_state, $form_id) {
  if (($form_id == 'user_register_form' || $form_id == 'user_profile_form') && $form['#user_category'] == 'account') {
    $account = $form_state['user'];
    $access = variable_get('user_relationship_mailer_send_mail', FALSE) && user_relationships_user_access('maintain @relationship relationships', NULL, $account);
    $form['user_relationships_ui_settings']['user_relationship_mailer_send_mail'] = array(
      '#type'           => 'checkbox',
      '#title'          => t('Receive e-mail notification of relationship activity'),
      '#default_value'  => isset($form['#user']->data['user_relationship_mailer_send_mail']) ? $form['#user']->data['user_relationship_mailer_send_mail'] : TRUE,
      '#description'    => t("If checked, we will e-mail you when there are changes to your relationship status with other users."),
      '#weight'         => -10,
      '#access' => $access,
    );
  }
}

So I tried to use unset() like this in my custom module:

/**
 * Implements hook_form_alter().
 */
function MY_MODULE_mailer_form_alter(&$form, &$form_state, $form_id) {
  if (($form_id == 'user_register_form' || $form_id == 'user_profile_form') && $form['#user_category'] == 'account') {
    $account = $form_state['user'];
    $access = variable_get('user_relationship_mailer_send_mail', FALSE) && user_relationships_user_access('maintain @relationship relationships', NULL, $account);
    unset($form['user_relationships_ui_settings']['user_relationship_mailer_send_mail']);
  }
}

However, the option is still displayed even after clearing the cache twice.  My custom module's weight is set to 777 and the weight of the user relationship mailer module is 0.  Any idea what I'm doing wrong?


texts: Ajax rendered radios don't keep the selected values after validation_form, same for #default value

texts:
After I render/generate a part of my form (radios) with an ajax callback (from a another radios), I am unable to define the #default_value attribute of that generated radio.

Also when I validate the form and there are errors, the form doesn't keep the previously selected radios(from the ajax generated).

I guess both are related, this ajax seems to mess with it, it's working fine without it.

I've read there are bugs with the ajax callback + form but what is the workaround? I've seen couple of "solution" but they were not working in my case.

EDIT:
I've been using this solution in the meantime, which works fine.

//I use this in my ajax callback making the generated radio to set the default value to 0, or change the array(0) by array($yourDefaultValue)
$commands[] = ajax_command_invoke('#id', 'myfunction', /* array(0) */);

//used to keep the values in the validation form (in the end if it)
drupal_add_js("jQuery(document).ready(function () {  jQuery.fn.myfunction( $myVariable); })","inline");

//custom js file
$.fn.vtoolsRefresh = function(myVariable) {
   //get the selected values from the validation form
   if(typeof myVariable !== "undefined" ){
     $('#radio-id input[value='+myVariable+']').click();
   }
   else{
     //default value set to 0
      $('#radio-id input[value=0]').click();
   }
}


texts: Is bypassing Drupal's #token protection against CSRF safe for search forms specifically?

texts:
I see that $form['#token'] is employed in drupal_prepare_form() and drupal_validate_form() as a protective measure against cross-site request forgery.

I am wondering about the necessity of this measure on site-search forms specifically, including core's search_box() and search_form() as well as a form built from scratch in a module that similarly implements a search by feeding arguments into a view.

I have seen it mentioned (in drupal_prepare_form(), in fact, and possibly other places I can't recall) that the search forms would be a viable case in which to work around the token protection. But then, why doesn't core do so by default?

(Note: I'm  not asking for help with code to work around it, as I've figured that part out already.)


texts:
I use the webform_multiple_file for my webform. I want to display webform submissions in a custom view.

I created my views-view-fields--submissions.tpl.php and added print $fields['value_1']->content; to display images

I want to customize the output. I added this function in my template.php

function mytheme_file_link($variables) {
$file = $variables['file'];

// Operates only on files uploaded to webform/invite. Change this to operate on the fields you wish to.
if(strpos($file->uri, 'webform/photos_du_projet')) {
    // Render as thumbnail.
    $url = file_create_url($file->uri);
    $thumbnail = theme('image_style',array(
        'style_name' => 'thumbnail',
        'path' => $file->uri,
        'alt' => t('uploaded image')
    ));
    return '' . $thumbnail. '';
}
else {
    return theme_file_link($variables);
}

}

from
this link

But it doesn't work. And if I add die(print_r($variables)); at the beginning of the function, it does not return anything.

How can I use this function properly? Thank you


texts: Empty Views with content imported by Feeds CSV

texts:
I import content in D6 with Feeds (+Tamper) module via a CSV file and it work great.
But after I want to display a list of nodes freshly created and the views doesn't display news nodes... :/
What is missing ?

thanks


texts: how to create a link field which validates to a set of nodes?

texts:
Is there a way to set the Validation for a Link field so that authors are only allowed to link to a pre-determined certain set of nodes?

IOW: when authors add a link field to a Node I want them to be limited to only links that are on our site -and- which are webforms or other nodes. I do -not- want them to be able to freely link to other domains.

Ideally, I'd like to be able to limit this set of valid links to nodes of a certain content type, or with a certain tag.

Just to be clear: these are not site visitor form fields, these are the fields for -Authors-.


texts: Can i show webforms submission on a calendar view

texts:
I need to show in a calendar view the webforms submission.
I have a date and a name field in my webforms, is there a way to show this in a calendar?
I try the full calendar display plugin but it doesn´t work.
i use drupal 8 and of course the webform module


texts: How some hooks works, if doesn't return anything and doesn't have any references

texts:
In Drupal API documentation is an example:

function hook_user_view($account, $view_mode, $langcode) {
  if (user_access('create blog content', $account)) {
    $account->content['summary']['blog'] =  array(
      '#type' => 'user_profile_item',
      '#title' => t('Blog'),
      '#markup' => l(t('View recent blog entries'), "blog/$account->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($account)))))),
      '#attributes' => array('class' => array('blog')),
    );
  }
}

Noobie question is: how does it actually work? I mean, there is no reference being passed to the function, and it doesn't return anything. This is somewhat counter intuitive how function works. I guess $account data doesn't disappear with end of the function but how, if it's not a reference?


texts: How can I have two nodes of different content types update to each other?

texts:
I have two different content types(A & B), and I want to be able to have a field in content type A that is a select list of all the nodes from content type B, and then I want to have a field in content type B that is a select list of all the nodes from content type A.
Is there a way that I can have those two fields update each other?

Ex: in node 'Atest' from content type A in the select list field I select the 'Btest' node from content type B, and then if I edit 'Btest' in it's select list field I can see 'Atest' already selected. (showing that 'Atest' has it selected)

Is that possible? if so, what would be the beat way to go about setting that relationship up?


texts: Creating a contextual filter for a view based on month and day

texts:
I've created a content type that represents a past events. I've added an extra date-field to this content type that indicates the date of the event.
I'm trying to create a calendar that groups events by day and month, but ignores the year in which the event happens.

e.g. when going to site.com/calendar/[month]/[day], I'd like to get a list of all events that happened on the given day of the given day, irrespective of the year in which they happened.

This seems impossible with the default tools, as they always expect a year to filter on. How can I customize these filters?


texts: Gallery Formatter Adjusting the Width of Gallery-Thumbs

texts:
I am using a Gallery Formatter on my site. The thumbnails are appearing below the main image, the size of thumbs-gallery is exactly the same size as gallery-slides. I actually want thumbs-gallery to appear from one corner of the window to the other. My div which contains this Gallery formatter gallery has 100% width of the document, So I gave the thumbs-gallery the width 100% which does what I want but when I am clicking the arrow to scroll the thumbs it at the end of the thumbs gives a large blank space, on clicking again it starts fine from the start.

Please suggest how to achieve my desired result.

Following is the link of my page on which I am getting problem, just click the arrow to scroll twice to see the problem

http://zgphotographydubai.com/content/industrial


texts: How to change the view for a rendered product?

texts:
I'm learning Drupal Commerce with a Commerce Kickstart installation. I understood in part the way products are displayed, with variation types and content types.

Have made some changes like visible/hidden product fields, and change the order product fields are displayed.

I would like to modify the position of the image to be on the left side and title, description and Add to cart button should stay on the right side.

How can I do that?


texts: Tracking isotope clicks with Google Analytics?

texts:
Is there a way to track the clicks of the views isotope header through Google Analytics?

If so how would I set that up? Where would I put the file or code and in what type of file and how would that code be set up?

I'm using:
Drupal 7
Views module
Views isotope module
Google analytics module


texts: How can I print out large variables in hook_entity_presave for debugging?

texts:
I'm trying to print out the $entity variable im hook_entity_presave because I want to see all of the properties and their values at the time of saving.

The problem is that every way I have tried to print out the information, I get out of memory limit PHP errors.  My PHP settings are set to 1024M max memory.

I have tried print_r(), var_dump() and debug(), all with the same result.  I also tried dpm(), which allows the page to continue without running out of memory, but nothing gets output.

function my_module_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
  debug($entity, NULL, TRUE);
}


texts: How can I have ONE views-view-fields-VIEW_NAME--page.tpl.php for multiple views?

texts:
I have 10 content types and they all have page view. These content type have similar fields and the difference is just their name, that is why I don't want to create the following files for every one of them:

views-view--VIEWNAME--page.tpl.php
views-view-fields-VIEW_NAME--page.tpl.php

One of the views is called sabk_zendegi, and the following code belongs to views-view--sabk_zendegi--page.tpl.php.

<img src="<?php print $directory; ?>/image/view_tpl_file/top_border.png" />

<?php print $rows; ?>
<?php print $pager; ?>

<img src="<?php print $directory; ?>/image/view_tpl_file/bottom_border.png"/>

This is not a good idea to repeat the same code for 10 files which the only difference is just their name. I have the same problem for views-view-fields--sabk_zendegi--page.tpl.php; this code belongs to views-view-fields--sabk_zendegi--page.tpl.php.

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

    <li style="list-style-image: url('<?php print $directory; ?>/image/view_tpl_file/list_item.png')">
    <?php print $fields['field_sabk_zendegi_titr']->content; ?>

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

As you can see this code is the same for all the views but the difference is just the $fields fields. (It can be replaced by a variable that is already assigned in template files.)

Is there any preprocess/template function in Drupal 7 that calls one page for views-view--VIEWNAME--page.tpl.php and one page for views-view-fields--VIEWNAME--page.tpl.php and it assigns the relevant variables inside it?

Instead of using $field['fields_summary'], I should be able to use $summary in this new general page, and these variables have their values already assigned by template/preprocess function according to the view.


texts:
Is there a way to change the Entity Reference view to a different format than an entity reference list?

I'm trying to list taxonomy terms and other custom taxonomy fields to the user when they use the edit form of the node. Ideally, I would list the taxonomy reference as a table with multiple columns. I haven't found a way to convert this list to a table. Does anyone have any idea?


texts:
I have a view that exposes a filter for user input to "search" a list of taxonomy.
My problem lies in sorting the results, which are by default alphabetically sorted.

The filter criteria takes user-inputted data from exposed form and uses the "contains" operator on a taxonomy vocabulary, thus returning (alphabetically) any taxonomy term names that contain the given input text. There is no sort criteria applied, thus defaulting to an alphabetically sorted list of taxonomy terms.

The exposed filter uses "contains" as the operator, but is it possible to show "starts with" operator results before or at the top of the alphabetical list of "contains" operator results.

I have tried using combined fields filter, but seem to only be able to combine fields, and not these operators such as contains, starts with, is equal to, ends with.

How might i implement a way to have my view display results that start with the given exposed filter (user) inputted value, then the results that contain the same given exposed filter input.

Combined fields filter seems to only allow multiple fields, not multiple operators or operators with && || and or type options.

Any advice is appreciated. Thanks in advance.


texts: How to implement custom modal form for Drupal Commerce

texts:
My client wants a checkout review and payment pane in a modal window, structured and styled a very specific way. Getting a form into a modal isn't an issue, as I've done that many times, but I'm curious about the best way to present the checkout payment pane where the credit card info is entered, and how to advance the checkout to the next step after they enter their payment info.

It seems like I build my form to display in the modal, and within a section of the form, I call commerce_checkout_pane_load() to load my payment pane, and it looks like DC takes it from there. The client was only specific about the review and payment display.  On the form, I have other order info from custom order fields surrounding the payment pane.

Is it as simple as this? Or, is the best way to do it when the user is ready to check out, I have some callbacks hooked in to call my specific review and payment forms? I think I have the concept, so I'm just trying to get some clarity.  The flow I need is:

From the cart page, they click check-out and it calls the my modal custom form.
They review the form contents displaying the custom fields
The click from there and, are taken to a modal payment form where they enter their cc info into the payment pane.  After that, they continue along the normal flow and let Rules handle the confirmation email, and some other tasks I have configured.


texts: Search terms that start with a period break core search module

texts:
Setup:

Core search module
Apache web server w/ mod_rewrite
Default .htaccess that ships w/ Drupal

When searching something that begins with a period, like ".ssh", this .htaccess rule takes effect and 403's the request:

RewriteRule "(^|/)\." - [F]

The rule is intended to prevent users from viewing otherwise hidden files and directories, like a .git directory.

However, the core search module injects the search query directly into the URL like so:

http://sample.com/search/node/.ssh

So Apache thinks I'm trying to access a hidden file, and I get a 403 before Drupal is even bootstrapped.

I couldn't find much related to specific issue for the core search module, so I'm curious if anyone has any opinions on how to resolve this? If the core search module instead appended the search as query string params, then it would be OK, but since it puts it in the URL structure directly, it causes this issue.


texts: Is it possible to change the _alt_ text wording for images in one place?

texts:
Is it possible to change the alt text wording for images in one place, as the wording used does not pass validation?
The website contains a vast amount of pages, most of which with images having poorly worded alt text. Most of the images are inline, but some have been uploaded with the image field.

The site is running Drupal 7, if this makes any difference.


texts: How to dislodge drupal from Apache and remove drupal

texts:
Excuse me please.. I am new to website development. I am using LAMP on fedora 20.
I am also using bluefish to edit html/php.

As a shear experiment, I installed Commerce Kickstart on my system. I did some terrible mistakes and now I need to remove drupal completely from the system..

I was just thinking of deleting the files and dropping the database. but is it enough?

thanks in advance


texts:
I have a D8 site on which I would like to require an image field to be completed only when a node is published; if the publish box is not checked, the field should not be required. I was able to do this with a custom module in D7, but since D8 has decoupled entity validation from form validation, I'm at a loss.

I've tried doing this with the Rules module, with no luck.


texts: Nivo-slider doesn't work in displays with less than 380px

texts:
I'm using Nivo Slider extension for Drupal (version 7.x 1.11) the page works fine, and Nivo resize itself without problem, but if width of the screen is less than 380px, it doesn't work.

I looking at the css code of nivo, but I did don't find where is the properties that change this. I would like to change this resize to get a good performance in displays with a width less than 380px (340px is good).

This is the css of nivo:

/*
 * jQuery Nivo Slider v3.1
 * http://nivo.dev7studios.com
 *
 * Copyright 2012, Dev7studios
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 */

/* The Nivo Slider styles */
.nivoSlider {
    position:relative;
    width:100%;
    max-width: 940px;
    margin: 0 auto;
    height:auto;
    overflow: hidden;
}
.nivoSlider img {
    position:absolute;
    top:0px;
    left:10%;
    margin: 0 auto;
    width: 100%;
    max-width: 940px;
    max-height: 430px;
}

.nivo-main-image {
    display: block !important;
    position: relative !important;
    margin: 0 auto;
    width: 100% !important;
    max-width: 940px;
    max-height: 430px;
    left: 10%;
    min-width: 100%;
}

/* If an image is wrapped in a link */
.nivoSlider a.nivo-imageLink {
    position:absolute;
    top:0px;
    left:0px;
    width:100%;
    height:100%;
    border:0;
    padding:0;
    margin:0;
    z-index:6;
    display:none;
}
/* The slices and boxes in the Slider */
.nivo-slice {
    display:block;
    position:absolute;
    z-index:5;
    height:100%;
    top:0;
  }
.nivo-slice img {
    max-width: 940px;
    max-height: 430px;
    margin: 0 auto;
}
.nivo-box {
    display:block;
    position:absolute;
    z-index:5;
    overflow:hidden;
}

.nivo-box img { display:block;min-heigt:100px; }

/* Caption styles */
.nivo-caption {
    position:absolute;
    left:0px;
    top: 10%;
    /*bottom:0px;
    background:#000;*/
    color:#fff;
    width:20%;
    z-index:8;
    padding: 5px 10px;
    opacity: 0.8;
    overflow: hidden;
    display: none;
    -moz-opacity: 0.8;
    filter:alpha(opacity=8);
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box;    /* Firefox, other Gecko */
    box-sizing: border-box;         /* Opera/IE 8+ */
}
@media (max-width: 600px) {
    .nivo-caption {
        top: 0;
        width: 50%;
    }
}
.nivo-caption p {
    padding:5px;
    margin:0;
}
.nivo-caption a {
    display:inline !important;
}
.nivo-html-caption {
    display:none;
}
/* Direction nav styles (e.g. Next & Prev) */
.nivo-directionNav a {
    position:absolute;
    top:45%;
    z-index:9;
    cursor:pointer;
}
.nivo-prevNav {
    left:0px;
}
.nivo-nextNav {
    right:0px;
}
/* Control nav styles (e.g. 1,2,3...) */
.nivo-controlNav {
        text-align:center;
        padding: 15px 0;
}
.nivo-controlNav a {
        cursor:pointer;
}
.nivo-controlNav a.active {
        font-weight:bold;
}

Maybe could be a media query of the main css (the css of my template)? I getting a headache with this and I dont have more ideas...

I have added media querys, I'm setting min-height in a lot classes of my css, I was searching an specific media query... I'm pretty sure that this problem is in the css of Nivo, but I dont know where is or what remove or what add to my webpage.

The question is very similar to this other: https://stackoverflow.com/questions/21853803/make-division-image-responsive

But I don't have a slider-wrapper3 or something in my css.

Someone can help me?


texts: Why does my Rules Condition about registration code seem to fail?

texts:
I'm using the Rules module and the Registration code module and I've tried configuring a rule like so:

Rules Event: upon saving a new user account(event).
Rules Condition: if the registration code used is "123456"(condition).
Rules Action: add a role for a user.

The rules export is as shown below:

{ "rules_give_trial_version" : {
    "LABEL" : "Give trial version",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "regcode" ],
    "ON" : { "regcode_used" : [] },
    "IF" : [ { "data_is" : { "data" : [ "regcode" ], "value" : "123456" } } ],
    "DO" : [
      { "user_add_role" : { "account" : [ "user" ], "roles" : { "value" : { "10" : "10" } } } }
    ]
  }
}

However, the Rules Action is not working (nothing works).

Any idea how to get this to work?

Note: The Rules Action works with the event "User has used a registration code" without any Rules Condition (if I temporarily remove that Rules Condition). But I'm badly in need of the condition as we want to check if a user has used a specific code. If yes, that user should be assigned a role.


texts:
Along with some regular nodes I want to link to a views page with an entity reference field.

Can I reference a views page via an entity reference field?


texts: How to make profile2 completely replace or override the core profile?

texts:
I have installed the Profile 2 module. I want to make it replace or override the core profile module for the entire website but I don't know how to achieve this. I have searched a lot, but have not found a solution. This is a new website, so I would not need to migrate existing profiles to profile2.

Can this be done using the Panels and Page Manager modules?

Is it a good idea to keep using the core profile module?

Any help is highly appreciated.


texts: Is there any option to import my excel to Views?

texts:
I am new for drupal 7.

I got exported excel from view using Views Data Export Module.

My question is,

Is there is any option to import my excel sheet to view.

Kindly help me to achieve this...


texts: Which newsletter module will fit my requirements?

texts:
I'm trying to implement a newsletter for my users to subscribe to and I'm noticing that there are a lot of different newsletter modules out there. I'm was looking for one that will easily allow me to:

Send weekly newsletters with a summary of the top 5-10 posts from that week.
Allow me to have multiple newsletters for the different "Categories" of content on my site (I have a taxonomy term "Categories" which I would like my users to be able to pick which "Categories" they'd like to subscribe to).
Allow me to customize the look of the news letter.

I've already tried simplenews but can't seem to get it to do what I want. I feel that this may be beyond what it can do.


texts: Installing SMTP module, not able to enable module

texts:
On a Drupal site that I've inherited, I'm trying to fix an issue where the contact form isn't sending out emails. To that end, I'm attempting to install, enable, and configure the SMTP module to see if that will fix things.

I've attempted to install the SMTP module via direct link as well as uploading it myself. While the module appears in the site admin list, I'm not able to enable it (just goes to a yellow "on", and then back to disabled).

What are some ways to figure out what the conflict or problem may be?


texts: How to display the comment form of a node in a popup?

texts:
How can I display the comment form in a popup. I want the functionality when I click on the link "add new comment" on a node, the comment form should appear in a popup window.

Any one who have some idea?


texts: Allow users to see restricted nodes via views

texts: I have a content type with meta data about a department, and these nodes is restricted using Taxonomy Access Control so that only the department heads can actually view them.  I would like to create a view of some of the information in these nodes that will be visible to people without full view rights to the node, but views filters out nodes that the current user can't see, which means that these nodes are hidden for non-department heads.  Is there a way to override the node access filtering for a specific view?


texts: hook_preprocess_views_view not loading view when records are empty

texts:
I am trying to add some css and js files using the hook_preprocess_views_view_unformatted Hook in template.php

Here is my code :

function mytheme_preprocess_views_view_unformatted(&$vars) {
$view = $vars['view'];
if ($view->name == "my_view_name"){

        drupal_add_css(drupal_get_path('theme', 'mytheme') .'/css/sample.css', array());
        drupal_add_js(drupal_get_path('theme', 'mytheme') .'/js/sample.js');

}}

My problem is that when the view is empty or when does not have any records the view is not loaded and thus I am unable to get the $view->name and neither are the css,js files being applied for the page.

It is working fine when the view displays a few records. So is there any other hook or method to fetch the view name or get it loaded when the records are empty ?


texts: Edit default views (books, basic page, etc)

texts:
I am using Views 3 with drupal 7. Views provide you some default views so you can edit them and customize them.

I want to do the same thing, for example, with book pages. I don't want to start from scratch with a new view. I just want to edit the default view of book pages.

Is there any way of editing it ? Or should I go directly to the code ? If so, which code is it ?


texts: Which parameter do I need to pass for user registration?

texts:
I have first name, lastname, email, password, confirmed password and gender
for user registration like facebook registration when I visit https://example.com/my_services/user/register.

Then I get the error "You are not allowed to change your username" when I select put method. How do I find the keys of that fields so that I send key and values?

I don't know which parameter I need to send with the URL.


texts: Using the published date and a custom date field to create a view with fields from two content types?

texts: I am trying to create a view that displays fields from two content types. Type A has a custom date field, and I want to display a field from Type B when the custom date field in Type A is on the same day as the published date of Type B. Only one Type B node gets created each day.


texts:
I am experiencing a strange problem while running drush commands on newly installed server and newly installed drush(it's been installed with composer).
Exact the same configuration works fine on my local machine (composer, drush-dev, memcached with 11212 port), but for some reason it doesn't execute any command on my production server. I've already read this post, but it did'nt help, I am sure problem is not coming from my memecached config, I can open it from browser without any error (Memcache Storage: server 127.0.0.1:11212 (default cluster) - Connected - message from status report).

So, I properly installed composer (globally), successfully installed a drush-dev version, env PATH has been added to .bashrc file, I can only run drush command which outputs this help messages.. But if I run any other command in my drupal root driectory it just hangs with this debug output (for ex: drush status -vvvv -d).

Some addition info: 1. I digged into the drush files to find something and I found that drush calls _drush_bootstrap_drupal_login after _drush_bootstrap_drupal_full to login as uid=0, but somehow it can't login..
2. I am using Memcache Storage module as cache backend, It shows Successfull connection in admin report page, but somehow it doesn't see pecl memcache extension I think.. If I remove $conf['lock_inc'] = 'sites/all/modules/memcache_storage/includes/lock.inc'; from settings.php file drush does WORK, but the same configuration is working on my local machine.. Very strange..

How can I solve this?


texts: How can I create a display in views with different filter criteria

texts:
Can I have a view with different displays? I.e. I would like to have the same display twice but in the second one, I just want to have an additional filter criteria. How can I do this?

edit 1

I cloned my initial display and added a new filter to the new one. I selected "This page (override)" and selected "Content: Title (contains Brunch)" but, I hit save but it doesn't seem to apply the filter:http://www.quaaoutlodge.com/restaurant-specials (new display) vs.
http://www.quaaoutlodge.com/special-events (generic display)
Why is this, what did I do wrong?
The query looks correct:

SELECT node.nid AS nid, node.title AS node_title, 'node' AS field_data_field_eventdate_node_entity_type, 'node' AS field_data_field_table_description_node_entity_type, 'node' AS field_data_field_link_to_page_node_entity_type
FROM
{node} node
LEFT JOIN {field_data_field_eventdate} field_data_field_eventdate ON node.nid = field_data_field_eventdate.entity_id AND (field_data_field_eventdate.entity_type = 'node' AND field_data_field_eventdate.deleted = '0')
WHERE (( (node.status = '1') AND (node.type IN  ('event')) AND (node.title LIKE '%Brunch%' ESCAPE '\\') ))
ORDER BY field_data_field_eventdate.field_eventdate_value ASC

but doesn't seem to get applied...for the new display - and yes, I hot "save"!

edit 2

It seems like the "This page (override)" feature doesn't work properly, I changed the title of my restaurant display and it doesn't geta pplied either.. any idea what I might be doing wrong?


texts: How to tag content by users and filter the content in a view?

texts:
I have a content type Meeting Minutes. I'd like to tag users in the minutes. There will be a view to the list of minutes only for the logged in user.

For example:

Meeting 1, tags Peter, Mary
Meeting 2, tags Paul, Mary
Meeting 3, tags Peter

When Mary logs in, the view shows:

Meeting 1
Meeting 2

When Peter logs in, the view shows:

Meeting 1
Meeting 3

Is there a user tags module for a content type and good for view-filter?


texts:
I wanted to get the time of last node update (any node). So, then I thought I could simple pick last cron run time ( because I am using feeds module to pull the RSS feeds so nodes will be updated on every cron run ). but then I discovered another variable "node_cron_last".

Can anyone explain me the difference between two variables, what value they contain?


texts: On the user node page, how to automatically show the articles posted by the user?


texts: Correct Syntax for $conf to populate Varnish Control Terminal

texts:
This may be more a php question, but pertains to Drupal, so here goes: I'm trying to configure Varnish Control Terminal to use multiple hosts using settings.php. I have:

$conf['varnish_control_terminal'] = array ('11.22.33.44:6082','22.33.44.55:6082');

but I keep getting this error (1 set for each host in the array) at http://localhost/admin/config/development/varnish:

Warning: explode() expects parameter 2 to be string, array given in _varnish_terminal_run() (line 192 of /app/aegir/platforms/cms-1.0/sites/all/modules/contrib/varnish/varnish.module).
Warning: Invalid argument supplied for foreach() in _varnish_terminal_run() (line 196 of /app/aegir/platforms/cms-1.0/sites/all/modules/contrib/varnish/varnish.module).

I've also tried these (one by one):

$conf['varnish_control_terminal'] = array ('11.22.33.44:6082 22.33.44.55:6082');
$conf['varnish_control_terminal'] = array (11.22.33.44:6082 22.33.44.55:6082);
$conf['varnish_control_terminal'] = array ('11.22.33.44:6082');

with the same result. I think my array syntax is incorrect, but I am not sure what the correct syntax would is ... any ideas ... ? I looked at php's array documentation as well.

EDIT: This also causes the varnish status at http://localhost/admin/reports/varnish to go blank, so I am not sure if Varnish caching for Drupal is functioning properly or not at all.

Many thanks!

PS: I also posted a note in the Varnish project's issue queue on Nov 30th and haven't heard anything.


texts: How to make nodes to be aware that they were added to menu programatically

texts:
I'm adding nodes to menu programatically by custom PHP snippet in Rules. The problem is that nodes aren't aware of this - so the option "Provide a menu link" is unchecked in them, even if their menu-item exists. I cannot find anything relevant in $node object. How to fix this?

My code is:

$node_path = "node/" . $node->nid;
$node_alias = drupal_get_path_alias($node_path);
$menu = menu_load_links('main-menu');

foreach($menu as $key=>$value) {
    if($node_alias == $menu[$key]['link_path'] || $node_path == $menu[$key]['link_path']) {
        return;
    }
    if($menu[$key]['link_title'] == $node->field_rok['und'][0]['value'] && $menu[$key]['link_path'] == "<nolink>") {
        $menu_year = $menu[$key]['mlid'];
    }
    if($menu[$key]['link_path'] == "archiwum") {
        $archiwum_plid = $menu[$key]['mlid'];
    }
}

if(!isset($archiwum_plid)) {
    return;
}

if(!isset($menu_year)) {
    $item = array(
        'link_path' => '<nolink>',
        'link_title' => $node->field_rok['und'][0]['value'],
        'menu_name' => 'main-menu',
        'plid' => $archiwum_plid,
        'hidden' => 0,
    );
    // menu_edit_item_validate(array(), $item); Drupal doesn't recognize this function in this place (Rules), don't know why... :/
    $menu_year = menu_link_save($item);
}

$item = array(
    'link_path' => $node_alias,
    'link_title' => $node->field_numer_w_roku['und'][0]['value'] . '/' . $node->field_rok['und'][0]['value'] .' (' . $node->field_numer['und'][0]['value'] . ')',
    'menu_name' => 'main-menu',
    'plid' => $menu_year,
    'hidden' => 0,
);

// menu_edit_item_validate(array(), $item);
menu_link_save($item);

menu_rebuild();


texts: What hierarchy is used for theme functions? Any way I can override that hierarchy?

texts:
I maintain Custom Submit Messages module that uses a theme function to change the status messages that D7 displays in certain contexts.

The module works fine except when the Omega theme is used. When Omega is running, it also uses a theme function to change Drupal's status messages, and the function that my module defines is not run.

What determines the hierarchy for theme functions in Drupal 7? Why does that Omega's theme function run, rather than the theme function defined by my module? Is there any way to change this hierarchy?


texts: Custom block displayed via Contexts not being shown to anonymous users

texts:
I am running a Drupal 6 site and I have created a custom block to display a banner ad. The site uses Contexts to display blocks. However I noticed that the block was not getting displayed for anonymous users for some reasons event though I have not set it that way in the reactions. It is getting displayed for user 1 though.

Anyone have any ideas regarding the cause for this scenario?

Also the current block does not have a title? I doubt that but it could be the reason for it not displaying for anonymous users.


texts: Can I render the same block twice on a page?

texts: I want to have <?php print render ($page['homepage_video'])?> two different places on the page. By default it can only be done once, but is there a workaround for that?


texts: Drupal Commerce or Ubercart to sell subscription for user (not for sell product)?

texts:
I want to create a website like learning lessons, and user can watch this lessons when subscribe of this website .. like lynda.com

I studied drupal commerce and ubercart modules, but I still confuse which one is the best for this type of sites.

help me please
thank you


texts: How do I programmatically add fields to Paragraph types?

texts:
I have one paragraph type of Product. and I have to add one field to paragraph product programmatically, how can I achive this.

function my_module_field_widget_paragraphs_form_alter(&$element, FormStateInterface &$form_state, $context){
  if ($element['#paragraph_type'] == 'products') {
    \Drupal::logger('my_module')->info('debug');

<!-- add field here -->

  }
}

and other answer I found is

use Drupal\paragraphs\Entity\Paragraph;

  $paragraph = Paragraph::load($paragraph_id);
  $paragraph->field_image[] = [
    'target_id' => $fid,
    'alt' => $alt,
    'title' => $title,
  ];
  $paragraph->save();

But in which function or preprocess I need to add above code?


texts: Show node IDs along with titles in Entity reference Autocomplete list

texts:
I'll like to add this functionality to the autocomplete widget in Entityreference field to show node ID next to the titles in the dropdown list. The reason behind the idea is to differentiate between multiple nodes with same title.

Example:

This is a title (3)
This is a title (2)
This is a title (1)

I know the node ID is shown once a selection is made but I like to show it in the dropdown list in order to pick the right node quickly based on the node ID.


texts:
I'm currently working on a project created by someone else. I have a textfield called "city". Currently the maximum limit is 255 characters. I want to update the maximum character to be 100. Looking at the code, it looks like the field was created using the features module. When I try to update the field, I got the FieldUpdateForbiddenException. I understand this is because I have value in the database. Is there a way update the field even if there is value in there? If I can't modify the database, can I change textfield max length in the form to be 100?

Thanks!

The website doesn't have CCK, so I'm not sure how to modify these fields. I'm using Drupal 7.

What I did:
1. I upgraded registration_page.info to upgrade the version from 7.x-1.0 to 7.x-1.1
2. I changed the field max length to 100 in registration.features.field.info

When I tried to deploy, I got this error

  [sshexec] WD php: FieldUpdateForbiddenException: field_sql_storage cannot          [error]
  [sshexec] change the schema for an existing field with data. in
  [sshexec] field_sql_storage_field_update_forbid() (line 229 of
  [sshexec] /var/lib/www.mine.com/deploys/site_20140515_140323/modules/field/modules/field_sql_storage/field_sql_storage.module).
  [sshexec] Cannot modify header information - headers already sent by (output     [warning]
  [sshexec] started at
  [sshexec] /var/lib/www.mine.com/deploys/site_20140515_140323/sites/default/drushrc.php:2)
  [sshexec] bootstrap.inc:1212
  [sshexec] FieldUpdateForbiddenException: field_sql_storage cannot change the schema for an existing field with data. in field_sql_storage_field_update_forbid()

This is what the code look like in registration.features.field.info

 // Exported field: 'node-registration-page-field_city'.
  $fields['node-registration_page-field_city'] = array(
    'field_config' => array(
      'active' => '1',
      'cardinality' => '1',
      'deleted' => '0',
      'entity_types' => array(),
      'field_name' => 'field_city',
      'foreign keys' => array(
        'format' => array(
          'columns' => array(
            'format' => 'format',
          ),
          'table' => 'filter_format',
        ),
      ),
      'indexes' => array(
        'format' => array(
          0 => 'format',
        ),
      ),
      'locked' => '0',
      'module' => 'text',
      'settings' => array(
        'max_length' => '255',
      ),
      'translatable' => '0',
      'type' => 'text',
    ),
    'field_instance' => array(
      'bundle' => 'registration_page',
      'default_value' => NULL,
      'deleted' => '0',
      'description' => 'Please enter your city',
      'display' => array(
        'default' => array(
          'label' => 'above',
          'module' => 'text',
          'settings' => array(),
          'type' => 'text_default',
          'weight' => 31,
        ),
        'teaser' => array(
          'label' => 'above',
          'settings' => array(),
          'type' => 'hidden',
          'weight' => 0,
        ),
      ),
      'entity_type' => 'node',
      'field_name' => 'field_city',
      'label' => 'City',
      'required' => 0,
      'settings' => array(
        'text_processing' => '0',
        'user_register_form' => FALSE,
      ),
      'widget' => array(
        'active' => 1,
        'module' => 'text',
        'settings' => array(
          'size' => '60',
        ),
        'type' => 'text_textfield',
        'weight' => '26',
      ),
    ),
  );


texts: How to efficently use Drupal as a laboratory notebook and information management system?

texts: I am a chemo-informatics researcher looking to find user experiences and feedback on methods to keep laboratory notebooks on a computer and/or online using Drupal ( e.g. plugins to use, taxonomies).


texts:
When you import RSS items via Feeds, where are the URL and GUID target values stored in the node?  How do you get these out?  I am not seeing anything close to these when I dump the $node.

This shows the Mappings screen with the values that I am talking about:


texts: Why could Drush not find the alias @local?

texts:
I am usin Drupal 8 and Drush 8. I have ~/.drush/local.aliases.drushrc.php. That is the only alias under ~/.drush

Inside local.aliases.drushrc.php, I have

$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

Run this drush @local status --debug

Using the Drush script found at /home/kenpeter/.composer/vendor/drush/drush/drush.launcher using pcntl_exec
Cache HIT cid: 8.1.8-commandfiles-0-88373346a2ca94c0c49a48b75b15bd40 [0.02 sec, 3.23 MB]                                                [debug]
$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

$aliases['local'] = array(
  'root' => '/var/www/html/test/testme/amber/amber_school_dev',
  'uri' => 'http://amber_school_dev.local',
);

Could not find the alias @local [0.06 sec, 6.05 MB]                                                                                [error]
Undefined index: command notify.drush.inc:60 [0.06 sec, 6.06 MB]                                                                       [notice]
Undefined index: command notify.drush.inc:60 [0.06 sec, 6.06 MB]                                                                       [notice]

drush sa in site root gives me

@none
@self
default


texts:
I have set up a Drupal site to connect to an external payment gateway (not using Drupal Commerce) for subscription-based billing. So making use of Drupal Webform, I have created forms for users to provide their payment information. Live site will be behind SSL.

What I would like to know is:

Where do I start by taking the details of the completed Webform and submitting it to the Payment Gateway's XML web service? Essentially, what I'm looking for is some hook into when the form is filled in, to trigger some code (which I already have setup and tested in a separate plain PHP app) to call the Web Service; and then
Based on the response that I get from the Payment Gateway, to add the logged in user to a specific role?

Your help will be greatly appreciated! Thank you in advance


texts: How To get transaction details in commerce checkout complete page

texts: Can anyone please help to get the transaction details in commerce checkout complete page. I could get using hook_commerce_checkout_complete($order). I can show the success/Error transaction and order details in drupal_set_message. But Exactly I need show in checkout complete page instead of message box. Please help how to do. Thank you.


texts: Pre-populate a field based on another node's field value

texts: I have several different fields attached to my user (user type) which are used to temporarily save settings for that user (most are node references, set by rules/flags/buttons)  Is there a way to auto populate a new node's fields based on tokens or rules so that every time a user starts to create a node, some of the fields are pre-populated based on the vales stored in the user's user fields?  Note: I would like to expose these values to the user during the node creation process.


texts: How can I create a time counter by aggregating a view?

texts:
I need to create a time counter that will take a users input of time in hours and minutes, add them and then display the cumulative results?

I am not sure how to accomplish this. It has been suggested to create a content type with a time field and then aggregate the results.

Any advice/direction will be appreciated.


texts: How to reset values of elements in multi-step form

texts:
I'm building quite a complicated and large custom form. Below I've made a simple example form to demonstrate my case:

function mymodule_form($form, &$form_state) {
  $form['step1']['element1'] = array(
    '#type' => 'select',
    '#title' => 'Element 1',
    '#options' => array('All' => '- Any -', 'option1' => 'Option 1', 'option2' => 'Option 2'),
  );

  $form['step1']['element2'] = array(
    '#type' => 'select',
    '#title' => 'Element 2',
    '#options' => array('All' => '- Any -', 'option1' => 'Option 1', 'option2' => 'Option 2'),
  );

  $form['step1']['addfilter'] = array(
    '#type' => 'submit',
    '#value' => 'Add filter',
    '#name' => 'addfilter',
    '#ajax' => array(
      'callback' => 'mymodule_form_callback',
      'wrapper' => 'results-div',
    ),
  );

  $form['step2'] = array(
    '#type' => 'fieldset',
    '#title' => t('Results'),
    '#prefix' => '
',
    '#suffix' => '
',
  );

  // Ajax values process
  if(isset($form_state['values'])) {
    foreach($form_state['values'] as $key => $value) {
      if($value != 'All') {
        $form['step2']['step2-'.$key] = array(
          '#type' => 'button',
          '#value' => 'remove ' . $key,
          '#name' => 'step2-'.$key,
          '#ajax' => array(
            'callback' => 'mymodule_form_remove_callback',
            'wrapper' => 'results-div',
          ),
        );
      }
    }
  }
}

function mymodule_form_callback($form, &$form_state) {
  return $form['step2'];
}

function mymodule_form_remove_callback($form, &$form_state) {
  // What to do here???
}

Basically what should happen is:

Select a value from the step1 elements
Click Add Filter button
The form function runs again, and this time it creates ajax'd "remove" buttons under step2.
When you press the remove button, the corresponding form element in step1 should get its value reset to 'All' and the corresponding step2 button needs to get removed.

I'm getting stuck at step 4, I'm not sure how to reset a submitted multi-step form's values.


texts: Getting a custom field to appear correctly in Rules using entity form module

texts:
I have written a custom field widget called foo which is inserted into an entity form to provide an autocomplete to another web service. I am trying to get the field data to be sent in an email via Rules. I am able to get the entityform tokens using List, text and the standard widgets to show in the email body and the list. However the form field defined in custom widget "foo" appears [entityform:field_foo] rather than [entityform:field-foo] which means that the send email rule in Rules appears to ignore it.

From my understanding, I believe that I need to create declare a  token using hook_token_info():

function MYMODULE_token_info() {
  $info['types']['foo'] = array (
    'name' => t('Foo'),
    'description' => t('Tokens related to the foo widget'),
    'needs-data' => 'entityform'
  );
  $info['tokens']['foo']['organisation'] = array (
    'name' => t('Janet'),
    'description' => t('Custom foo widget field'),
    'type' => 'entityform'
  );
  return $info;
}

and then declare hook_tokens():

function MYMODULE_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();
  $sanitize = !empty($options['sanitize']);
  if ($type == 'entityform' && !empty($data['entityform'])) {
    $elementform = $data['entityform'];
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'field-foo':
           $replacements[$original] = str_replace('_', '-', $name);
           break;
      }
    }
  }
  return $replacements;
}

The other avenue I was exploring was whether this token needs declaring to Rules via hook_rules_data_info() but I cannot see why so I have not explored it further as the entity form appears to be pushing it through to Rules, just not creating the token so that the email can see it.


texts: I would like to know how I can show registered users in a table with profile pictures like this site has. I would like to make this kind of site where actors can make a profile so they are put in a actors user role and that I can give people who look for actors an other role, so they can look for them in the database and actors can't. I am kind of a newbie to this sorry for that. Thanks!


texts: Cant show Commerce Products in View on Taxonomy Term page

texts:
My Commerce Products (not Product Displays) have a term reference field. On a taxonomy term page I want to show all the products tagged with that term.

If I create a view to show prodcuts (which I would attach as a block), I cant seem to use the term ID from the contextual filters to limit the results.

If I create a view of terms, then I cant find the relationship and fields to show the products.

Am I missing something or is this how Commerce Products work? Are they not available in Views the same way that nodes with the same term field would be?


texts: Is there a way to limit how much storage users have to store their content?

texts:
I have a video sharing site where members can upload and embed videos.

When members upload videos, is there a way to limit how much storage they have to store their content? Is there an existing module or one that can be modified in order to achieve this functionality?

It uses FFMPEG to convert the videos in the format that is required and I believe it is using the video module. The storage API sounds like it has promise.


texts: Drupal 7 How to make the value of a user field (site_path/admin/people) dependent on user role

texts:
I am using the module Administration Views (https://www.drupal.org/project/admin_views) to change the layout and content of the Drupal users view at "site_path/admin/people". The site I am working on requires that users pay yearly for membership using Ubercart. Using Ubercart's add user role on purchase functionality, I have added the "Paid User" role to the site. When any registered user makes an Ubercart purchase of a "Membership", he/she is given this Paid User role.

The site admins want to be able to track users by whether or not they have made their yearly payments to ensure that their privileges within the organization for which I am producing this site reflect their membership payments. Therefore, I have added a "Dues Status" field to the "user" node type and displayed it in the Drupal users view at "site_path/admin/people" using the Administration Views module.

However, as the tracker for "Paid Dues" is whether or not the user has the role "Paid User" rather than a user edit, I have been unable to make the value of the "Dues Status" field update in the view. Since Administration Views has access to each user node in their respective views rows, I considered using Views PHP (https://www.drupal.org/project/views_php) to try to access the data in  the "User Roles" field and check for the presence of the role "Paid User", but I did not know how to do this and change the value of the "Paid Dues" field.

I am familiar with re-writing fields using HTML, just not with PHP. Could someone explain how to use Views PHP to rewrite the value of a user field by checking for a user role on that user? Or, if there is a module I have been unable to find that can do this, please let me know.


texts: How to add profile fields on Ubercart 3 checkout page?

texts:
I used to use the uc_profile module to add user profile fields to the D6/Ubercart 2 checkout page, but I cannot find a suitable solution for that same functionality in D7/UC3. Can anyone guide me toward an alternative solution? I need to add things like "birthday" and "shoe size" to the checkout page, and I need those items to be displayed on the users' profiles.

Thanks!


texts: I have a discount 'women's day'. I have set start and end date as 8March 8AM to 8 March 8PM for this discount. In my coupon validation function, I want to check if the current time is in between 'women's day' discount start and end time or not. So I basically need a start and end time of discount.


texts: Custom module permission option not available

texts:
I developed a custom module and enabled it from admin panel https://site/administer/modules/list . But at permissions page https://site/admin/user/permissions there is no option for the administer or other users to enable it.

As you can see my custom module named is notification module but there is no option to add permission for that.

Edit

I have hook_perm as follows

function hook_perm() {
  return array(
    'access GA admin tab',
    'access check backend tab',
    'access GA admin menus',
    'access GA autocompletion',
    'bypass GA field verification',
  );
}

Is there any relevance for this to the administer permission?

Update

My bad , i was given the same hook_permission values in another module , so it got overwritten with the other module , and my module permission got freezed !


texts:
I want to check if user has downloaded the file so afterwards I will allow him to post a review. To do that I want to flag the node after user download file, flag the node and allow flagged node to be commented. I have a script:

global $user;
$flag = flag_get_flag('downloaded');
$node = node_load(arg(1));
$flag->flag('downloaded', $node->nid, user_load($user->uid), TRUE);

but I don't know how to make that event to occure when clicked on link. Link is in span.file a

Does anybody have an idea how to achieve my goal? I will be so grateful for any answer.


texts: When using the workbench core module, how can one assign a node to a new author and it show up in their list of content?

texts:
I'm using workbench core, which so far is providing the workflow that I need (well, almost).

The workflow is:

Primary editor writes a new node, and leaves it unpublished.
When the Primary editor is finished, he edits the node and changes the 'author' field to the new editor who will continue editing.
The New editor accesses his workbench page to (should be able to) see the unpublished node in his article list, where he continues to edit.
The New editor publishes the node after he has finished.

The problem is that the article never shows up in the New editor's article list on his Workbench page. However, when viewing the Content list, the article shows correctly and shows that he is indeed the owner / author.  There is something wrong with Workbench that doesn't recognize new ownership of nodes (via the author field).

Is this a bug? Configuration setting?  All I want to do is change the author of this node and it show up in his workbench.  I am hoping I can do this without having to add any more workbench related modules.

To me it feels strongly like a configuration issue with the view that was supplied by the Workbench core module, but no amount of fiddling with it has proved productive.  I think I'm just missing something. Plus, I'd prefer not to have to hack a module.

Here is a Drupal.org thread about it, however, no one has looked at the issue for months.

https://drupal.org/node/1921798


texts: How does Drupal.org's packaging script works?

texts: Is Drupal.org's packaging script publicly accessible? How does it works? What tools does it use to fetch a module and package it as a tarball? What are the best practices in building a nightly builds for Drupal modules?


texts:
Today one of my users went and deleted the root of an Organic Group and wiped out all of the child nodes from that group and it's associated menu entries.

I have a backup, so I can restore, but in the time between I was informed of the problem and when it occured, other people were making updates to the site - so it wouldn't be as simple as just falling back to the last backup.

Happily, it was a simple group which is easily re-creatable - but I know one day, someone is going to delete a node which isn't trivial to re-create.

We've all had a colleage (or done it ourselves) who has called the local sysadmin and said "I accidentally deleted e-mail xxx - please restore it" - and the sysadmin goes and does it. My question is: How can I do this for a Drupal site? Ie. I want to be able to restore a node, or a set of nodes without completely rolling back.

Any ideas? Would love to hear from people with experience in dealing with this kind of problem. I can see there are modules such as "Feeds" and "Node Import" but I'm looking for peoples opinions on best solutions based on their experience.


texts: What is the correct procedure to restore database in Drupal 7?

texts:
Reverting to a former database has been a tricky business with error messages and problems cropping up when I try to re-install modules that were installed or re-create content types, or re-do anything that was done since the back-up was made. In an attempt to avoid these problems I've been deleting the database using phpmyadmin before reinstalling the backup. Better, maybe(?) but now I've had other problems. Should I delete all the contributed modules also? Anyone direct me to the correct procedure for restoring database using phpmyadmin and ftp?

 -


texts: Programmatically assign permisions to role

texts:
I have a custom module and with hook_permission() I create module's specific permissions. Is there a hook (hook_role_permission) in which I can create a module specific role and assign it's permissions?

I don't want to put these in custom_module.install file because I don't want to reinstall the whole website.


texts: expose age range in views but DOB field is date

texts:
I want to expose an age range in a view (select registered users of age between 25-50) . I tried birthday module and also tried adding a Date of Birth field to user profile using Profile2 Module .

And I think Views Contextual Range Filter works with ranges (25--100) not with dates .

any ideas ?
thanks


texts: How do I create a Machine Name type of field?

texts:
I need to add a Machine Name type of field to Nodes of a certain Content Type. It's the same Machine Name field that Drupal is using when creating Content Types.

  Example: If I enter "My Title" in the title field, the Machine Name
  field will be populated with "my_title" via javascript.

Why do I need it? I am referencing nodes to other nodes and want to generate an URI, based on a node referenced, i.e. example.com/node-referenced/node-content


texts: When in admin overlay, submitting form over 400 times

texts:
I have built a very simple module which just implements a block with a custom form. When submitted, the content is emailed to me. I show this block on the dashboard, and without the admin overlay it works totally fine.

But when I access the dashboard in the overlay and submit the form, I get no feedback at all (I user drupal_set_message() when the email is sent, but that doesn't show up) and half a minute later I find 437 copies of the same email in my inbox.

Unfortunately I have no idea at all where I could start debugging THIS. Maybe the overlay is just a coincidence. But what else could cause this massive submission of email and/or the form?

Any ideas are appreciated.

Thanks,

Victor

UPDATE: The (simplified) code below, this very basic form still has the same problem. How is this possible?

<?php

function mvp_form_test_block_info() {
  $blocks = array(
    'mvp_form_test_test_block' => array(
      'info' => 'Test Form',
      'cache' => DRUPAL_CACHE_GLOBAL,
      'properties' => array(
        'administrative' => true,
      ),
    ),
  );
  return $blocks;
}

function mvp_form_test_block_view($delta='') {
  if ($delta != 'mvp_form_test_test_block')
    return array();

  return array(
    'title' => 'Test Block',
    'content' => drupal_get_form('mvp_form_test_test_form'),
  );
}

function mvp_form_test_test_form($form, &$form_state) {
  $form = array();
  $form['sometext'] = array(
    '#type' => 'textfield',
  );
  $form['button'] = array(
    '#type' => 'submit',
    '#value' => 'Submit',
  );
  return $form;
}

function mvp_form_test_test_form_submit($form, $form_state) {
  watchdog('mvp_form_test', 'Form submitted with text '.$form_state['values']['sometext']);
  drupal_set_message('Form submitted with text '.$form_state['values']['sometext']);
}

?>


texts: Content publishing and confirming comment via email in drupal 7?

texts:
I want to provide following functionality:

When a user sends a mail to publisher@mysite.com, the subject of email become title of a blog post and body of email become body of blog post and the post should be published if the mail is done by admin
If the mail is not done by admin then a mail should go to admin notifying same and if admin replies "publish" then it should be published else it should not be published


texts: Make a block from a "part" of a drop down menu

texts:
I have a D7 site with a drop down menu at the top, the second item across the top is "About Us".  Presently it looks like this, see attached pic.

I want the "contents" of this part of the menu to be a "BLOCK" that I can display on several pages.  How can I do that?

In Drupal menus, the arrangement looks like this, see attached pic:

The menu item "about us" has a URL of "about-us".  I'd like the content of this to show up in a sidebar that I could drop in perhaps as a block or other method.  How can I make a block out of just a "section" of a menu, and yet have this as dynamic content?  I want the users to be able to edit the list of menu links included in "about-us" but not have to manually put the contents of the new links into the sidebar.  I'm thinking of maybe a "view" but I've never made a view of a menu before.

Thanks for the help.

Dave N