texts:
I'm new to Drupal 7 and UberCart and loving it.
I'm working on a site that is automotive based and am having a problem wrapping my head around the catalog.
I have 4 different parent catagories, then year/make/model and part category.  A product can be anywhere and belong to multiple categories.

Right now I have a vocabulary that contains parent category/make/model/part category and another that contains year.

I need the menu to work like

Parent Category 1

Make 1

model 1

year
sub-cat
model 2

year
sub-cat

Make 2

model 1

year
sub-cat
model 2

year

sub-cat

Am I making this too complicated?
The sub-cats would be unique to the Parent Category but make/model/year could belong to any Parent Category and subcat.

Can anybody give me any advice?  Thanks in advance.

edit I guess I'm asking If I put year make model together in a vocabulary and Parent Category and subcat together in a vocabulary (which I think would work well), how can I incorporate that into UberCart catalog menu?


texts: Can an identical profile and theme name cause conflict during installation?

texts: I recently purchased a theme to install it on an Aegir hosting environment, which is a multi-site installation system. Does identical profile and theme names cause conflict or errors in Drupal?


texts:
I have used smtp authentication module in which I have mentioned my email and password. But I don't want that email id be the sender of the mail in contact form. I want to send mail through another email id which will not have password.

Could anyone help me in the above issue?


texts: wget or curl executables not found. Curl activated but not working

texts:
As I know so far Drush has some limitation on Windows. I need however, to get it working, and I have activated the curl module in php.ini. All you need is to uncomment the line:

extension=php_curl.dll

Now, I run phpinfo.php and it seems curl is activated, but I still get the console error:

  wget or curl executables not found.

I have restarted the Apache server several times but still no way out.

Is anyone able to help me up?


texts:
the html title of the user pages are the user id and the website name. Is there a way to instead change the user id to the user name?

ie.

[user id] | website name >>> [user: name] | website name


texts: Drupal 7 and Ubercart - admin approve sale before payment

texts:
Drupal 7.36 & Ubercart 3.0-rc4.

My client needs to vet users purchasing products from an Ubercart shop. The idea is that when the user completes the checkout, the user does not go to a payment gateway - but instead, the admin receives an email notification saying someone wishes to make a purchase. the admin then goes on to the site and authorizes the sale, sending an email to the user telling them they can now return to the site and complete the purchase and pay.

I've looked at rules, but it appears for fall slightly short of what i need.

Are there any contrib modules, or and know workarounds for this?


texts:
I am trying to enable client side validation on my web forms. I installed & enabled the modules as per the Drupal.org link:
https://www.drupal.org/node/1324924
& then went into the Configuration > Client Side Validation & inserted the form ids I had in my HTML code.

However, I am unable to get the client side validation to work (errors are not recognised in the input fields), the attached screenshot shows the modules view.

The only module that seems to be missing is the 'IFE' module which I cannot find / install.


texts:
I have created a view (using views 2) with type = comment (displaying comments).
Now i can display comment author, comment post date fields, but i can't create a node title field which belongs to comment.

Tried using views customfield, but $data variable isn't allowed here, only $comment variable. Please throw me in a right directions, thanks.


texts: Is it require to add a hook_update_N for my new added field?

texts:
I've extended a feature (using Feature module) by adding a new field in the settings form:

  $form['custom_user']['user_value'] = array (
    '#type' => 'textfield',
    '#title' => t('user_value'),
    '#size' => 30,
    '#maxlength' => 128,
    '#default_value' => variable_get('user_value', 'My Value'),
    );

Now I have added a hook update

function myfeature_update_7310() {
  variable_set('user_value', 'My Value');
}

Now the websites using this feature already have the first version.
is it required to add somehow the new field creation as well in my hook_update_N?


texts: Views no results behaviour remove exposed filter input

texts:
I have a view with facet filters and an exposed filter for a keyword search on the title field.

What I want to happen when a user enters a keyword which has no results:

The view will post a message saying there were no matches found
And then remove the keyword query and return the user to the page state as it was before they entered the keyword.

Can anyone point me in the right direction?


texts: Remove disabled attribute/state during submission

texts:
I would like to find a way to remove the disabled attribute from webform fields inside a custom Handler.

The disabled attribute is currently being applied to webform elements during user input via conditions/states with the UI and I would like to remove this attribute after clicking submit so that these webform fields will submit their values.

I've been looking through the available functions from the WebformhandlerBase: https://git.uwaterloo.ca/drupal-org/webform/blob/8.x-5.9/src/Plugin/WebformHandlerBase.php, but can't find where this attribute exists, and don't see an approach to alter/remove it.

public function validateForm() {} seems like a good moment in time to alter, but I can't find this attribute.

Noting I have success doing this with jQuery but would prefer doing this in my custom Handler

How do you remove a form field attribute (disabled) with a custom Handler after a user clicks submit?


texts:
I would like to import some taxonomy terms with a taxonomy term in it.
field_regio2 is a entityreference field to an existing taxonomy term Regio.
But for some reason it is not working. Everything is working except the field_regio2.

$ drush mmsg import_gemeentes gives:

  the entity_lookup plugin requires a value_key, none located

?

uuid: 7eef6b86-80db-40ab-8359-91d20675e0f2
langcode: en
status: true
dependencies: {  }
id: import_gemeentes
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: migrated_terms
label: 'Migrate gemeentes from the source CSV to taxonomy terms'
source:
  plugin: csv
  path: 'public://gemeentes.csv'
  header_row_count: 1
  keys:
    - id
  column_names:
    -
      id: id
    -
      vid: vid
    -
      name: name
    -
      field_stratenplan_luchtfoto_refe: field_stratenplan_luchtfoto_refe
    -
      rid: rid
    -
      rid22: rid2
process:
  vid:
    plugin: default_value
    default_value: gemeente
  name: name
  field_stratenplan_luchtfoto_refe: field_stratenplan_luchtfoto_refe
  field_regio: rid
  field_regio2:
    plugin: entity_generate
    source: rid22
destination:
  plugin: 'entity:taxonomy_term'
migration_dependencies: null


texts: Check if a field value is already in the database

texts:
I want to check if the entered value is already in the database or not. If it is, I want to stop creating the node, and show a message telling the users to change that value; if that value is not found in the database, the user should be able to create the node.

What is the correct function to call to stop the creation process?
How do I check if the field value is already in the database?


texts:
I use the following code to display the date in my node template:

<?php echo date("j F Y", $created); ?>

But I need to display the months in a different language, how can I do that?


texts: Why drupal_realpath('public://') returns an incorrect path?

texts:
As in questions. I am calling drupal_realpath('public://') inside module function. I have no idea why I am getting path like: sites/all/modules/current_module/sites/default/files, e.g.

  C:\drupal_path\sites\all\modules[current_module]\sites\default\files


texts: How to redirect to user organic group on login

texts:
I am trying to redirect the user to a page for which he is an organic user, and I want this redirect to happen after user login.

I am trying to use the hook_user_login() to make this redirect. However, I have found that when I inspect the $user object when it hits that hook, the $user->og_user_node field is empty. When I look at the user's edit screen (or when I inspect it with devel), it does have associated groups.

How can I retrieve a user's groups to make this redirect?


texts: Too many passes with Drupal 7 test framework

texts:
I'm implementing some tests using the D7 testing framework.

All is good, except that the numbers don't seem to add up, and I wondered how pass/fail was evaluated?

The problem is that I'm getting "6 passes, 0 fails, 4 exceptions, and 2 debug messages" for two test methods.

Obviously I'm missing something, but I had assumed that a single test method would produce a single pass/fail and therefore I should only have two results.

Secondly, how can I find out more information about the exceptions that were reported?

Thanks everyone.


texts:
By some chance would a module exist for this registration / user activation workflow?

I'm looking for a module the following functionality:

Each user when registering has a dropdown to select their sales representative
The sales rep will then get an email regarding this user's registration
Since this sales rep knows that they're a user they'll approve this user quicker than a single administrator

Essentially, the user has the ability then to delegate who approves their account improving account approval efficiency (the goal).

Also, could this functionality be accomplished with rules somehow?


texts: How to create a rule to perform a redirect if user is already logged in and visits the homepage?

texts:
I have a Drupal 7 installation. In my homepage I have only two forms (login and register) so I need when someone leaves the site and the user is logged in, when he visits it again that he redirect to another page (similar to Facebook functionality).

Currently the user is redirected to user profile page.

I tried to use Rules and I put in Rules Event 'Drupal is initializing', in Rules Condition path to 'check=[site:url]' to be redirected but with no effect.

Any ideas?


texts: Using S3BrowserUpload to Add Form to a Content Type

texts:
I have a content type with a machine name of "video" and I created a module called "df". I want to add a separate form to the content type (above or below the edit fields) that does a direct post to Amazon S3 using the S3BrowserUpload object from the AWS SDK. The steps I am trying to accomplish are:

Create additional upload form on "video" content type.
User enters information and specifies a file in the S3 upload form.
User clicks Save for the Add Content Type page.
Ajax fires the Amazon S3 POST form to upload the video file and handles the response to store the file's key path in a hidden field.
The normal drupal add content type fields are then posted back to the drupal site and processed. It would also have access to the hidden field that had been populated with Ajax.

I am new to Drupal forms so any assistance in integrating S3BrowserUpload with Drupal's forms API in my custom module to accomplish the steps above would be greatly appreciated.


texts: I am using drupal advanced forum, due to migration from phpbb to D7 forum I noticed there are some HTML entities shown in my forum topic. I need to handle this in the tpl file. Can you please let me know where to implement it.


texts: CSRF validation failed issue on custom services!

texts:
I have created a custom services API to save order records in database. I have checked on POSTMAN and it is working fine. But when i request from apps it gives me "CSRF validation failed" issue.

Am i missing something?


texts: Show teasers to anonymous visitors but not allow access to the body/node

texts:
I want to encourage visitors to create an account by allowing them to read the teasers on the front page and know that creating an account is worth their effort to access the rest of the content.

i'm using v7.x

P.S. I also hope this will enable Search engines to see enough content to index properly


texts:
What is the best solution for letting users choose from an array of default images when creating a node with a teaser image field?

The functionality I'm thinking of is similar to
https://drupal.org/project/avatar_selection
, but for creating any node.


texts:
I am new to Drupal8. In one of the preprocess functions in my customtheme.theme file, I need to get the value of a field from a view that I have already created. I searched the web and got:
 $view = $variables['view'];
    $view_result = $view->result;
    if (!empty($view_result)) {
      foreach ($view->result as $rid => $row) {
        foreach ($view->field as $fid => $field ) {
          $values[$rid][$fid] = $field->getValue($row);
        }
      }
    }
   $array[0] = $values[0]['nid'];

AND i got another one too :
$view = $variables['view'];
$values = [];
foreach ($view->result as $row_id => $row) {
  foreach ($view->field as $field_id => $field ) {
    $values[$row_id][$field_id] = $field->getValue($row);
  }
}

The first solution worked but I want an explanation of it please especially that I tried to print_r ($view_result) and that didn't work, so I managed to print its keys and got onyl one key which is 0. Then I got many weird keys when I did a foreach to print the keys of  $view_result[0].
I would be grateful if someone can explain to me the code and why did the getValue function take an argument ? I usually write it as getValue() only.


texts: Is there any way to adjust the items per block options?

texts:
In Drupal 8, whenever you create a view block, you have the option to specify the number of items displayed in that view block which is awesome.

Currently, you can choose between 1, 5, 10, and 20. Is there any way to change this to include 1, 2, 3, 4, 5" or just be able to manually enter a number?

I was really excited about this feature and need to use it, but I need to really choose between 1, 2 or 3 items per block.

Edit: I'm referring to the block management screen, not the views configuration screen.


texts: Are there any modules that can export and import nodes while preserving node id's?

texts:
Our website uses VBO + Views Admin screen for the admin/people screen. Today one of the user admins deleted some old user accounts, by checking the checkbox next to the names and selecting the "Delete" option from the Actions dropdown. What he didn't know (+ I didn't know) was that by using the "Delete" option he also inadvertently deleted all the content created by those users as well.

I've got a backup of all the nodes that have been deleted, however I'm at a bit of a loss on what's the best option to restore these. The site has 10+ content types, and loads of custom fields (field_x_revision + field_x_data tables!! for each field). I need to preserve those node ID's. I'm going to be doing this locally and the once I've got a completely merged database I'm going to put it back on the live site.

Are there any drupal modules that can export nodes and also import them (and preserve the old node id's)?


texts:
In some situations, I need the site name of a Drupal 6 site which is given while installation of the site.

How can I achieve it?


texts:
I believe I have all the pieces of the Drupal RETS Real Estate Framework installed in my drupal 7 site.

https://www.drupal.org/project/drealty

But when I run:

drush -u=admin -d rets-import

I get:

The drush command 'rets-import' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.

What step might I have missed in my install of this framework?


texts:
i have the following construct that i have the following URL: /node/nodeid/fooobar
Foobar is a view that uses CONTEXTUAL FILTERS to draw the node id and then render the view. This works really well so far. But now I would like to link it to my menu. Now I have tried the module Menu Token, but it seems to not work with views.
The path is given in the menu with "module token" as follows: /node/[node:nid]/contract1
This also works fine for nodes, but not with views. If I specify the Path in Views in the same way, it seems that it can't reach the NodeID anymore. If I build a block with views, it seems to not work anymore. Does anyone have an idea for me? Basically I just want to build a link?
Thanks Bavra
Menu Link to views with % in URL


texts: an entity_metadata_wrapper for a form_content in form alter hook?

texts:
There a few days ago, someone in this website advised me to use the function entity_metadata_wrapper. Thanks that, I can get and set fields of entity without use heavy code.

Now, I would like find the equivalent when I use a form_content from an alter form hook. After several google research, I didn't find the equivalent... can you help me ? =)

Concretely, When I get a fields, i do :

$exemple = $form_state['field']['field_one']['und']['entity'][2]->sub_field['und'][0]['value'];

(my form content contains a collection field).
It's very ugly...


texts: How to programmatically enable/disable Quantity text widget on cart/checkout page?

texts:
There are the following things which I've investigated so far:

Version of Commerce Cart: 7.x-1.9
Shopping cart form is controlled by commerce_cart_form view.
Checkout page is controlled by commerce_cart_summary view.
Quantity widget can be enabled or disabled in Manage display for Product display content type. But there are no any rule actions controlling display Quantity widget.

So the question is, how do I (programmatically) enable or disable text Quantity widget on checkout page (e.g. for certain conditions/product types)? So people can edit the Quantity for only certain product types.

There is Commerce Rules Extra module, but it doesn't provide much functionality, but I've already posted feature request for that.


texts: How can I rebuild my installation after attempting to manually update D8 core using D7 instructions?

texts:
After following the manual update instructions linked from the download page for Drupal 8.3.4, I got a "The website encountered an unexpected error. Please try again later." This is when I noticed that the breadcrumb for the update instructions said "Drupal 7".

As per the erroneusly linked instructions, I have deleted every file and folder in my drupal 8.3.2 installation except /sites, and I'm wondering what I need to do to restore them. Is there a reliable way to find out exactly which modules I had installed (e.g. translation files, or database tables?), and can I fix the problem by manually uploading the modules to /modules, or could the failed update.php job have damaged my installation?

(My server doesn't support automatic updates, and I only have FTP/MySQL access.)


texts: Contact attached to every node of a particular type

texts:
I am trying to figure out how to attach one form to every node of a particular content type in Drupal.

Each node will be owned by a different user and the form will be sent to the user who created that node.

The closest I have got is with Webform and Webform Templates. However, It makes the user choose the template to use. I don't want that I want it to be set automatically and I can't see how it can be?

Any suggestions would be greatly appreciated.


texts: What is the best method to allow a user to attach dynamic, custom content sections to a node?

texts:
I am looking for a recommended approach for a customization in Drupal I am building.

The desired workflow:
A user will be able to attach N number of custom content sections (CCS) to a node. A user will be able to select the type of CCS (see example below), customize it, and arrange it's order amongst all other CCSs attached to a specific node.

Example CCS: Enter in the URLs for several Flikr images and the site outputs this as a nice gallery.

I know how to build the individual functionality for each CCS, but I'm wondering if there is any approach you would recommend for the broader functionality.


texts: How do I programmatically duplicate a view display?

texts:
I have a view (my_view) with the following displays:

master
page_1

I am looking for a way to programmatically duplicate page_1.

    $view = Views::getView('my_view');
    $storage = $view->storage;
    $display = &$storage->getDisplay('page_1');
    // Create a new display.
    // Remove some exposed filters from the new display.
    // save the view.

How can I achieve this?


texts: Change the index structure of fields in a table in database? Wise thing to do?

texts:
I'm on Drupal 7. The table index structure of users table is shown in the fig below:

As pointed out the table has two unique keys uid(also primary) and name which is the username of the user of the site. The username is displayed on the top of the user's profile.

I want the mail column to be unique, and make it non-nullable.
and remove the unique characteristics of name;

Because username can be same (my use case) and e-mail id shouldn't repeat.
Is it safe to make the change? If not what precautions do I need to take?


texts: Add database connections on the fly, instead of defining them in settings.php

texts:
I am trying to add DB Information on the fly, instead of defining in
  settings.php

I am adding connection on module install

$other_database = array(
  'database' => 'pantheon',
  'username' => 'pantheon',
  'password' => 'password',
  'prefix' => '',
  'host' => 'dbserver.dfssg.drush.in',
  'port' => '4587',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);
Database::addConnectionInfo('legacy', 'default', $other_database);

and trying to use 'legacy' key with the migration file

source:
  plugin: d8_entity
  key: legacy
  entity_type: node
  bundle: article

But, I getting an error

 The specified database connection is not defined: legacy

Is I am missing something?


texts: Alternative to "Vote Up Down" module for?

texts:
Is there any other module like vote_up_down, but for Drupal 7? This one has a development version but as the author says it is unstable.

  7.x (unstable, on development, do not use this version for production)


texts: Drupal 7 website with landing page and two sections with different templates

texts:
I need a Drupal 7 website with 2 sections..

for eg. www.example.com

One is Civil and the other is MEP.

Landing page with navigation to the below two sections:

section 1: www.example.com/Civil

section 2: www.example.com/MEP

Screen shots of the design:

Landing page:

Site -a

Site-b

The exact requirement is as follows:

/ = intro page

/site-a/ = menu and templates for site a

/site-b/ = menu and templates for site b

Separate layout and menu for these two sections.
How can we keep two layout for the two sections?
Is it a multisite? or just two sections?

Please suggest me a solution.


texts: Is there a reliable way to show Drupal messages from JavaScript?

texts:
I need to show status messages (the kind typically shown by drupal_set_message()) in my module's JavaScript code. How can I do this reliably, such that the theme and placement of the messages remains consistent with the way drupal_set_message() does it?

I'm looking for a solution that accounts for the presence or absence of prior messages on the page, and that works for any theme.

Pointing to existing modules that perform this would be great!


texts: Can I theme fields depending on view or block that contains them?

texts:
Let's say I have a contact content type with fields address, tel, fax, etc. My task is to create 2 views - with following markup:

First view

[address]

[tel]

[fax]

Second view

[address]

[tel]

[fax]

The above is just a simple example, in general I want to know how much control can I get over fields html markup, can I somehow change it depending on view or block that contains the field or even depending on field itself. If so - what is the best way ?


texts: Form submission not working in template file

texts:
While theming form in template file I used drupal_render to print selected fields of form. But after hit submit button, data is not saving, means submit button is not working.

I know one solution is to use drupal_render_children but it is giving me every child of form, means I'm getting all of the elements of form.

I don't want form's each and every element.

Only selected fields should get rendered.

Any way to print form selected field elements in tpl file with a working submit button?


texts: Add an enddate to my date field programmatically

texts:
I'm using the date field contrib module and added it to my custom module which creates a content type and its fields.

I've successfully added a field(+instance) of date with a popupcalendar to my contenttype with a lot of help of this comment. But I can't figure out how to get the end date working. It's only showing a first date, not value2. I've tried screwing around in the field settings by adding 'enddate'=> 1 to no avail.

What setting should I use to get a start AND enddate to work in my field within my module?

Here are the fields I'm using(Its within a field collection which also works fine)

//Field collection
array(
    'field' => array(
        'field_name' => 'field_available_periods',
        'label' => $t('Available periods'),
        'cardinality' => -1,
        'type' => 'field_collection',
    ),
    'instance' => array(
        'field_name' => 'field_available_periods',
        'entity_type' => 'node',
        'bundle' => 'accommodation',
        'label' => $t('Available periods'),
        'description' => '',
        'widget' => array('type' => 'field_collection_embed'),
        'required' => 1,
    ),
),
array(
    'field' => array(
        'field_name' => 'field_van_tot',
        'type' => 'datetime',
        'label' => $t('From - Until'),
        'cardinality' => 1,
        'settings' => array(
            'granularity' => array(
                'year' => 'year',
                'month' => 'month',
                'day' => 'day',
            ),
            'enddate' => 1,
        ),
    ),
    'instance' => array(
        'field_name' => 'field_van_tot',
        'entity_type' => 'field_collection_item',
        'bundle' => 'field_available_periods',
        'label' => $t('From - Until'),
        'cardinality' => 1,
        'description' => '',
        'required' => FALSE,
        'widget' => array(
            'type' => 'date_popup',
            'settings' => array (
                'input_format' => 'Y-m-d',
                'year_range' => '-0:+2',

            ),
        ),
        'display' => array('default' => array('type' => 'date_default')),
        'settings' => array(
            'default_value' => 'blank',
            'default_format' => 'short',
            'default_value_code' => '',
            'default_value2' => 'blank',
            'default_value_code2' => '',

        ),
    )
),


texts: Best way to create a property of an association in Drupal 7?

texts: I have a node Theater, and a node Movie, and a Theater can have X movies and for each movie at that specific theater there are Y showtimes. How can I set up the property "showtimes" of the association of Theater to Movie within Drupal?


texts: How do I output HTML from a text_long field in Twig?

texts:
What is the alternative to the |raw filter if I want to output html from a entity field in twig in Drupal 8?

According to this ticket, |raw should be avoided, but I can't figure out how to use what they recommend in that ticket (Safestring/SafeMarkup) in twig.

I have a custom content entity that has a field definition as follows:

$fields['internal_description'] = BaseFieldDefinition::create('text_long')
  ->setLabel(t('Internal description'))
  ->setSettings(array(
    'max_length' => 1500,
  ))

The field stores HTML from a CKEditor instance. Now I would like to output this as HTML in a twig template. Currently if I just call

{{  event.getExternalDescription }}

I get the escaped HTML as expected, however that is not what I want. If I do

{{  event.getExternalDescription | raw }}

I get what I want, which is unescaped, rendered HTML. However since it's not checked in any way in this case, I would like to know how to make this output safe and still allow my users to use CKEditor for entering content?


texts: How do I programmatically find the core version?

texts: How do I programmatically find the Drupal core version running a site?


texts: change node types file fields widgets programatically?

texts:
I have installed multi_upload_filefield_widget.

I would like to change every file widget of every file type fields of every node type programatically.

i would need to automate this change since i have multiple sites and multiple content type.

  //when enabling the module
  function multi_upload_filefield_widget_enable() {
        //code to loop through all node types fields for one site

       // if type is file
            // replace widget 'file' to 'multiupload
            //save content type with this new value
}

Here is where i am at

       $types = node_type_get_types();

       foreach ($types as $type){
           $fields=field_info_instances("node",$type->type);

            foreach ($fields as $field){
               if ($field['widget']['module']=='file'){
                    $field['widget']['module']='multiupload_filefield_widget';
                    $field['widget']['type']='file_mfw';
                }
                 // my fields don't get saved !?
                //field_attach_update("node", $field);
                 //field_update_field ( $field );
             }

          $fields=field_info_instances("node",$type->type);
          print_r($fields);
        }

How can i save these modified fields ?

any help would be appreciated


texts:
I would like to add a little icon before the tab item 'Edit'. Firebug shows that the default code looks like this:

    Edit

My idea is to add a span before the ...:

    Edit

where the edit class has the underneath CSS.

.edit {
    background-image: url("MY_IMAGE.png");
    background-repeat: no-repeat;
    display: inline-block;
    height: 16px;
    padding-right: 2px;
    vertical-align: middle;
    width: 16px;
}

Adding the  directly with Firebug gives the wanted result, but I don't know how to do this in a template or with a function. What is the correct way to achieve this?


texts: How to change Drupal's default language programmatically?

texts: I am trying to change the Drupal's default language programmatically  but haven't found the codes/function. Any suggestions?


texts: How to show filtered content as suggestion of "reference autocomplete field" based on a field value of reference content

texts:
Say, one content type is "CONCEPT" and it has a field named 'STATUS'.
Another content type is "Article" and it has a node-reference auto-complete field named 'CONCEPT FROM'.

Now I want to see only "CONCEPT" contents whose status value is "ACCEPTED" as a suggestion of "CONCEPT FROM" auto-complete field.


texts: How can I generate similar sets of fields in views quickly from within the views ui?

texts:
I have several views that I have made of the users on my site.  Each view has different contextual filters, pages, and fields.  However, certain "groups" of fields are the same.

In particular, I have a series of four checkboxes on the user profile that I use the views module's rewriting ability to display, and this "group" of four fields is the same among all views.

Is there a way to somehow save this as a reusable unit within the views UI so I don't have to input it manually all the time?


texts: How to push changes from a dev environment to prod

texts:
Our team of 10 developers would like to use Dev, Test, Staging and Production environments for our large site.  How can we streamline pushing our changes from one site to another, keeping them as identical as possible?

The difference between this question and How to migrate from test environment to production environment? is that we would like to push changes automatically/regularly so that the environments not very different.

We have been using a Dev and Production environment for the past few years, and each environment has its own SVN code repo.  The Features module has been used in a few places, but it does not work with Blocks or Content.

One proposal was to use Drush and use archive-dump and archive-restore to push the changes between the environments, but Production has content provided by visitors and users and pushing to Production would wipe out that content.

Has anybody answered this question before?


texts: Why does "Read more" link not show up on view, but "Add new comment" does?

texts:
As said in the title, I'm having a problem with the "read more" link.
I made my own view (wie-zijn-we-pagina) and content type (wie-zijn-we-) and am trying to add a custom "read more" and "add new comment" link to it. The code that I'm using gives me the correct custom "Add new comment" link but the "Read more" link doesn't work. At first it didnt even show up.

My code:

function ap_hogeschool_theme_preprocess_node(&$variables){
$variables['content']['links']['comment']['#links']['comment-comments'] = FALSE;
if($variables['view'] && $variables['type'] == 'wie_zijn_we_')
    {
    $variables['content']['links']['node']['#links']['node-readmore']['title'] ='

';
    $variables['content']['links']['comment']['#links']['node-readmore']['html'] = TRUE;
    $variables['content']['links']['comment']['#links']['comment-add']['title'] = '

';
    $variables['content']['links']['comment']['#links']['comment-add']['html'] = TRUE;

}
}

I don't know if the part where i call the view and content type is correct... I'm still a new drupal user.

An image of what i have:

An image of what in need to have:

Could somebady please help me along?


texts: How can I force a field to be required if another field has a certain value?

texts:
I have two fields, a select list of checkboxes and a taxonomy term reference.  I would like the taxonomy term reference to be optional unless one of the checkboxes has a certain value, in which case a value must be entered into the taxonomy term reference field.

Is there a module that can accomplish this?  I tried the Field Validation module but I couldn't find a way to configure it for this use case.  Custom code is fine too if you could point me in the right direction.


texts: Register Drupal Commerce user before checkout completes

texts:
The default behavior for Drupal Commerce is that an anonymous user get's registered only after the checkout process completes and an order is paid in full. I am trying to create a new checkout rule to register an user just after he/she enters his/her e-mail address, but failing to find the right rule on admin/config/workflow/rules/reaction/manage/rules_sd/add/event.
I have modified my checkout flow, so that a user can enter his/her e-mail at the first step like shown in the screenshot:

Unfortunately, there is no rule something like "After entering an e-mail". Does anyone have a suggestion how to overcome this problem?

On /admin/commerce/config/checkout/rules it says:

When a customer advances to the checkout completion page, rules
reacting on the Completing the checkout process are evaluated. Default
rules handle standard tasks like updating the order status, sending
order e-mails, and creating accounts for anonymous users. You can edit
these or add additional rules to customize your checkout workflow.

Does this mean I can't trigger any actions until checkout completes? Not very much convenient if so.
Edit: I've also found this somewhat similar discussion: How to force account creation before commerce checkout is complete?


texts: Ask services "Which user am I?", as defined by session id?

texts:
Scenario: An external service wakes up. This could be a remote Drupal site running a cron , a mobile application being started or something completely different.

The service has a session id from it's last interaction with a Drupal site running Services.

How does this service go about asking the Drupal site: "Based on this session ID, who am I?"?

For a regular user on the Drupal site, /user will tell you who you are. However, when accessing [endpoints]/user through Services, you get an index of all users, instead of a specific user object.

If possible, please include json as the content type for any code examples.


texts:
When I comma seperate my tags to make individual tags, drupal tend to put a linebreak behind every individual tag.

What happens:

That means that I need to make 1 huge tag, which is not factual.

I am Pretty newbie when it comes to drupal but this is kinda annoying.

Thanks in advance.


texts: How to create and add a page to a book programmatically?

texts:
I have studied create nodes programmatically and create a book page but still i did not find how to create and add a page to the existing book. How to set parent child relationship if applicable.
I am using Drupal 8. Can anybody help please?


texts: Importing CSV file to Generate Orders in Drupal Commerce

texts: I am using drupal commerce kickstart. I need to generate order-ids with dummy billing and shipping information. How to import csv file with order particulars? Is there any module? How to proceed?


texts: Config of Drupal site using drush make and install profile

texts: I am getting started with using drush make and install profiles. I have been able to successfully have my site in a git repo and rebuild and install the site using drush. I have also been able to run some install settings, however, there are config elements that I cannot find how to set. For example, how would I install and enable a default panels layout for the default site template that is using panels everywhere and have that panel contain some content. I am aware I can export panels, but then how would I load them back in? What scope do I have for automating config in general on a Drupal 7 site? I heard it is vastly improved in D8.


texts: How to grant user User Points equal to certain field's value / calculated value?

texts:
I've a content type 'Content' with the field 'Value' (an integer). Every time a Content has been published, I'd like to grant the Content's author some User Points, equal to the value in the 'Value' field.

I tried solving the first part of my problem with the Rules module like this:

*Event: A node has been published

*Conditions: Content is of type 'Content'

*Actions: Grant points to a user: ...

However, it's impossible to pick node:field-value in the Points section. I also tried:

*Event: A node has been published

*Conditions: Content is of type 'Content'

*Actions:

 - Calculate a value: `[node:field-value]` "+" 0. (Variable name = result)

 - Grant points to a user: ...

But then, the variable 'result' is not available. How can I solve this issue?


texts: Permission to edit orders, but not delete

texts:
The title is mostly self-explanatory: I need a user to have permission to edit an order, but not be allowed to delete it. I don't think the currently defined permissions for orders allow this.
Am I wrong? Is there a workaround/extra module/hackneyed solution you can think of?


texts: Inherit some fields from referenced Nodes?

texts:
I need to link one content type to another via inheriting certain fields, similar to the question about "inheriting fields from a base content type", but automated.

I have a content type called 'Session', under which you can assign 'Classes' via Node Reference. A Session will have a Time allocated, among other fields.

I want to be able to have my Classes inherit the node-referenced Session's Time field, but not any of the others. It must also automatically inherit any changes to the referenced Sessions' Time field.

I've already tried Bundle Inherit, but in order to actually use Inheritance via Strict mode, this only allows inheriting ALL fields, not some. It also detects adding extra fields to the parent content type and adds them to the child.

Can anyone suggest a non-PHP way I might achieve this?


texts: Updates to blocks not visible to anonymous users

texts:
I've recently put an update to the blocks on my site - they show for me when I'm logged in, but not for anonymous users. The previous arrangement of blocks remains visible, but without the additional text-only block I've added along with the rearrangement of others.

I've checked the permissions and it should be visible, yet they're not showing. I've tried certain fixes that we're outlined on other threads to no avail.

I am using Drupal 6

Any ideas?


texts: Display expiry date of licence in list of orders

texts:
I'm using Drupal Commerce and Commerce Licence.

I need to show in the list of orders in user profile, the expiry date of the purchased license.

I looked at the orders view, but it would seem that it is not possible to make a different view for "Commerce Order" and "Commerce licence".

Is there a solution?


texts: I would like to create 4 api calls (GET/POST/PUT/DELETE) for the basic node article. I'm a real noob in this. Can someone help me on my way? Where do I go for information?


texts: How to use hook_node_presave to change field's value

texts:
Basically, I want to put first name & surname together into $node->field_par_contact_name

But it gives me warning. (See below)

function partnership_node_presave($node) {
  if($node->type == 'partnership') {
    $first_name = $node->field_par_contact_first_name['und'][0]['name'];
    $surname = $node->field_par_contact_surname['und'][0]['name'];

    // https://drupal.org/project/field_hidden
    // Hidden variable
    $node->field_par_contact_name['und'][0]['value'] = $first_name. ' '. $surname;

    // Warning after save: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of .../drupal-7.23/includes/entity.inc
  }
}

Updated, please see image:


texts: How to change permission for dynamic routes?

texts:
I am able to change permission callback perfectly for static urls: eg:
Works fine:

if ($route = $collection->get('entity.taxonomy_vocabulary.collection')) {
  foreach ($vocabularies as $vocabulary) {
    $perms['administer ' . $vocabulary->id() . ' vocabulary terms'] = array(
      'title' => t('Administer %name vocabulary terms', array('%name' => $vocabulary->label())),
    );
    $route->setRequirement('_permission', 'administer ' . $vocabulary->id() . ' vocabulary terms');
  }
}

But same logic does not work for dynamic routes i.e route having a variable say taxonomy machine name.

Does not work:

if ($route = $collection->get('entity.taxonomy_term.add_form')) {
        foreach ($vocabularies as $vocabulary) {
            if($taxonomy_vocabulary == $vocabulary->id) {
                $route->setRequirement('_permission', 'administer ' . $vocabulary->id() . ' vocabulary terms');
            }
        }
      }

Please suggest how to alter/change permission callback for taxonomy add/view etc routes.


texts:
I want to override the block menu behavior, but i don't know how to do that, because the menu block are created dynamically.

I know add some block with the block plugin, like this :

/**
 *
 * @Block(
 *   id = "system_name_block",
 *   admin_label = @Translation("my Block"),
 * )
 */

But i don't find how the core deal to create dynamic block for the Menu link tree.

I ever know that i have to override this class to get the espected behavior :
Drupal/Menu/MenuLinkTree.

But Now i've to know how to create dynamically some block to use it.


texts: Why multilevel dynamic local tasks doesn't work?

texts:
I want to have tabs, but since they need to be dynamic I am making use of local tasks. In the class extending DeriverBase I have written the following function:

public function getDerivativeDefinitions($base_plugin_definition) {
    $this->derivatives = array();
    foreach ($this->moduleFormatManager->getDefinitions() as $key => $definition) {
      $this->derivatives[$key]['title'] = $definition['title'];
      $this->derivatives[$key]['route_parameters'] = array('module_format' => $key);
      $this->derivatives[$key]['route_name'] = 'module.format_configure_' . $key;
      if($key == 'xyz') {
        $key = 'newkey';
      $this->derivatives[$key]['title'] = 'newkey';
      $this->derivatives[$key]['route_name'] = 'module.newkey';
      $this->derivatives[$key]['parent_id'] = "module.format_configure:xyz";
      }
    }
    foreach ($this->derivatives as &$entry) {
      $entry += $base_plugin_definition;
    }
    return $this->derivatives;
  }

In the above code, a tab for each key is being generated: my problem is in the if condition. In the if condition I am trying to generate a sub tab for a particular type of tab by declaring parent_id. But the code doesn't work for me.

What changes should I introduce in order to make it work? I used this link to learn about local tasks.

My module.links.tasks.yml file looks like this:

module.format_configure:
  title: 'Configuration'
  base_route: module.configure
  tab_root_id: module.configure
  deriver: 'path to deriver'

All the mentioned routes have been declared in *.routing.yml file.


texts: Using a WYSIWYG field in Fieldable Panels Panes

texts:
I'm using the Fieldable Panels Panes module to allow my users to create pre-styled panels and arrange them on the page using drop and drag.

I've used a Drupal 7 site before where you could include a field that uses the WYSIWYG editor as the widget for that field, so the user can insert a WYSIWYG-authored block of content for the panel.

I can't figure out how to replicate this on my own site. How can I add fields to my Fieldable Panels Panes forms so my users can use the WYSIWYG editor when adding panels? (I have the wysiwyg module with ckeditor library installed.)


texts:
I want to be able to create a block or place a block into a region and theme it according to the selected view mode from Panels. I have noticed a discrepancy between Custom Block and Entity Block where one form gives you the view mode to show the block in, and the other does not (Custom Block).

I want the template suggestion to be along the lines of block--provider/module--block-bundle--view-mode.html.twig but struggling to find consistency in the variables in hook_theme_suggestions_block_alter() in order to add the suggestion. At the same time, I want to enforce the template that is used no matter if the user created the block inline, or referenced an existing block via Entity Block. What keys or identifiers can I look for to make this work?


texts: Views output does not match actual output

texts:
I have a view that I finally got to work in the view preview. Then I go to the link that should give me the same result at the preview and I get the no results behaviour. I double-checked that the view is saved and I cleared the cache.

When I visit the url in the preview area, I do not get the result in the preview. Any ideas of what I did wrong?


texts: single content type gets added multiple times

texts:
I have a problem with my drupal site. On some occasion's, when 'author' submits content type, site freezes and this content type gets added multiple times instead of just one time. I don't think that submitting 5 form fields is that heavy for server, that it should cause problems.

Do you have any idea/experiences with this kind of trouble?


texts: Custom field permissions based on workflow or rule/action

texts:
Is there a way to trigger permissions to specific fields in a content type based on a workflow or rule/action?

For example, for a content type called 'article':

field 1 is writable, field2 is hidden
workflow state has changed
field 1 is now read-only and visible
field 2 is now visible and writable

I came across this module called Workflow Fields that sounds perfect, but it is only available for Drupal 6.


texts:
I want to import fields of webform on server.Features will not include webform fields.
Is there any module by which I can import webform fields to server?


texts: Is there an opposite / reverse of entity_uri()?

texts:
I understand that entity_uri() generates a uri for a profied entity

http://api.drupal.org/api/drupal/includes--common.inc/function/entity_uri

However, is it possible to go the other way? is there a function in drupal to pass a system uri and see if it's an entity? and then return the entity object?


texts: Drupal Commerce Product Pricing Rules disapear

texts:
When I add a new rule in Product Pricing rules they disappear out of the Product Pricing Rules Window. They are still available in Workflow->Rules.

I am also finding that it seems to be hit and miss weather I am able to access all data on the system. Sometimes the rule I create sticks in the Product Pricing Rules window for a few minutes and those rules when created give full access to all referenced data. But I create a new rule and cant see data that I know I should be able to I know then that this is going to be one of the rules that will disapear into the Workflow->rules window.

Any idea what is happening.

Thanks
Simon


texts:
In views my contextual filter does show the default option of "PHP Code"

How do I implement this?

thanks
-Sean


texts:
I am trying to use ctools modal form to edit node form. This form is containing a file field. The Form is rendering properly. When I try to upload a file on clicking upload button, file field has been deleted from the page. I tried to debug via firebug to see the response, it was correct as we get without modal form.

I added the following code in modal callback.

ctools_include('node.pages', 'node', '');
ctools_include('modal');
ctools_include('ajax');

$form_state['build_info']['args'] = isset($form_state['build_info']['args']) ? $form_state['build_info']['args'] : array($node);
form_load_include($form_state, 'inc', 'node', 'node.pages');

I took the reference from Ajax upload in Ctools Modal Window but it still having problem.


texts: How to upload my video using Video module and CKEditor?

texts:
I'm trying to upload my custom videos to my Drupal 7.28 site. I want to add videos in my most of the posts or pages.

I've installed the Video module and also have CKEditor module working. Is there any way I can upload the video directly inside CKEditor?

How can i do this?
Is there any module that simplifies this?


texts: Missing argument in hook_theme and Ilegal offset

texts:
I have built hook_themes many times and never encountered this before but I am getting the following errors:

Warning: Missing argument 1 for geocoder_custom_theme
Warning: Missing argument 2 for geocoder_custom_theme
Warning: Missing argument 3 for geocoder_custom_theme
Warning: Missing argument 4 for geocoder_custom_theme
Warning: Illegal offset type in isset or empty in drupal_theme_access() line 53

I have tried clearing cache, renaming the hook, registry rebuild and nothing works.  I have another hook_theme in a different custom module that is basically the same thing but works completely fine.  Also if i simply return an empty array() it still does it.  Its like drupal doesn't send any values to my hook for whatever reason.

Code:

function geocoder_custom_theme($existing, $type, $theme, $path)
{
  return array(
    'geocoder_custom_before_me' => array(
      'variables' => array('string' => array()),
      'template' => 'geocoder-before',
      'path' => drupal_get_path('module', 'geocoder_custom') . '/theme'
    ),
    'geocoder_custom_after_me' => array(
      'variables' => array('string' => array()),
      'template' => 'geocoder-after',
      'path' => drupal_get_path('module', 'geocoder_custom') . '/theme'
    )
  );
}


texts: Loop through a multi value entity reference field working only on the first selected item

texts:
1) I have an entity reference view articles_per_user listing all nodes of type article authored by the current logged in user.

2) On the Article Entity, there is a taxonomy reference field field_article_country referencing the taxonomy vocabulary: "Countries" (One value is allowed)

3) On the User Entity, there is a multi-value taxonomy reference field field_user_article_countries referencing the same taxonomy vocabulary: "Countries" (Unlimited value are allowed)

4) On a Webform, I have an entity reference field articles referencing the above entity reference view 'articles_per_user' with unlimited values where the users can select one or more article.

5) When Webform is submitted, I want to:

Load each selected Article.
Get value of the field_article_country
Load the current logged in user entity.
Set the retrieved value to field_user_article_countries
Save the User entity.

Quick Demonstration:

Say the Current User selected on the Webform 3 articles where:

Article 1 has field_article_country = United States
Article 2 has field_article_country = Egypt
Article 3 has field_article_country = Spain

After the Webform is submitted, the field_user_article_countries at the User Entity must have 3 values selected:

United States
Egypt
Spain

The error I am facing is at field_user_article_countries, I see only one value selected:

United States

Below is my code:

// Function to be fired while submitting the Webform.
public function submitForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {

    // Load the account of current logged in user.
    $CurrentUid = \Drupal::currentUser()->id();
    $CurrentUser = \Drupal\user\Entity\User::load($CurrentUid);

    // Get the selected 'Articles' Value.
    $ArticleIDs = $values['articles'];     // NIDs

    // Load all "Articles" according to their IDs.
    $Articles = \Drupal\node\Entity\Node::loadMultiple($ArticleIDs);

    // Loop through loaded articles entities.
    foreach ($Articles as $Article) {

    // Get the "Article Country" Value from the loaded article.
    $ArticleCountry = $Article->get('field_article_country')->target_id;

    // Set the 'User Country' value on the user account.
    $CurrentUser->set('field_user_article_countries', $ArticleCountry);
    }

    // Save the User account.
    $CurrentUser->save();

}


texts: How to create a controller that runs query?

texts:
I have a query:

$sub_query = \Drupal::database()->select('test_file_discovery', 'f')
  ->fields('f', ['nid'])
  ->condition('extension', 'pdf');
$or = $sub_query->orConditionGroup()
  ->condition('path', \Drupal::database()->escapeLike('_TT'), 'LIKE')
  ->condition('path', \Drupal::database()->escapeLike('_OT'), 'LIKE')
  ->condition('path', \Drupal::database()->escapeLike('_AT'), 'LIKE');
$sub_query->condition($or);

$query = \Drupal::database()->select('node_field_data', 'n')
  ->fields('n', ['nid'])
  ->condition('type', 'article')
  ->condition('nid', $sub_query, 'IN');
$query->range(0, 10);

But I don't know how to create a controller / page where I can display this query's results in a table, "Name" and "Actions" as labels / headers.

Anyone can give me assistance?!


texts: Get a multiple value listing of related node IDs using Relation module and Views node ID field

texts:
The situation

The awesome Relation module uses so called endpoints in a dummy field to show related entities to a given entity.

Sadly there is (still) no way to (really) decide what field values of the related Entities exactly these endpoints are which we want to show. You are only able to decide between "endpoints" or "endpoints and fields", which both result mostly in the same: a list of the linked titles of the related entities, more or less cluttering, depending on your additional relation fields.

The question

Is there something I miss to achieve this? I would like to prevent using performance hogs Views field view for such small task like a list of related node IDs per row in a Views table of listed nodes. Is there any work around or advice somebody can give? Thanks in advance.

Maybe related issues I found on DSX here:

Views related nodes with contextual filters multiple-value handling problem
create relation between two nodes using the relation module


texts: "You cannot send more than 5 messages in 1 hour"

texts:
I have several contact forms, but I don't want to limit the users to submit the form. I've tried form unblock with smart IP; it doesn't work for me.

Do you have any idea to release the IP and unset the limit?


texts: Views Arguments formatted nicely for the title

texts:
I know that you can get the arguments in the view's title and format it so that it makes sense so that an argument like "search-for-something" can be output as "Search For Something".

I have an argument passed like "argument-here" and I need to search in the database for that exact phrase.

The problem is that in order to get it to format nicely in the title as "Argument Here", this also removes the dash in the SQL query - resulting in nothing for my view to return.

Is there a way that I can format the result for the title without messing up the actual argument for the SQL query?


texts: Use contextual filter on no results behavior

texts: I'm creating a view where I'd like to use the node ID of the current node seen on the page on the no results behavior. Is it possible?


texts: How to show node with multiple related term with it through view?

texts:
I'm using drupal 6 and I've Taxonomy Structure like below

Gender (Vocabulary)
   Men's (Term)
   Women's (Term)

Movement (Vocabulary)
   Automatic (Term)
   Digital (Term)

Both vocabulary are attached to a content type, so that i can choose men's/women's and automatic/digital.

Now i want to show all the nodes of this content type with their related terms as a separate column in view page display. For that i chose Taxonomy: Term under the groups Taxonomy to create a field in view to display them.

But its repeating single term for both column as you can see in below image. In exposed filter these vocabulary working fine because i had an option to choose which vocabulary i want to select to create a filter but this option is not there in field level creation.

But i want to show them like this

Also you can see in very last column that show Digital,Men's indicate that two different term are related to this node.

Can anyone point me to the right direction to accomplish this?


texts: Save values after add more ajax in form api - field name issue

texts:
I've created a form using Form API and AJAX for an add more button, but I think I have problems assigning names to the new ajax fields in the loops, cause when I try to insert my data into my database I get an error:

  Undefined index

What am I doing wrong? Here's a section of my code:

<?php
function main_form_form($form, &$form_state) {

  $form['group_tabs'] = array(
      '#type'     => 'horizontal_tabs',
      '#attached' => array('library' => array(array('field_group', 'horizontal-tabs'))), // Converts fieldsets into tabs
      );

  $form['main_film_tab'] = array(
      '#type'  => 'fieldset',
      '#title' => t('Film General Info'),
      '#description' => t('Use this tab to enter basic info about the film.'),
      '#group' => 'group_tabs',
      );

  $form_state['storage']['main_film_tab']['add_title'] = isset($form_state['storage']['main_film_tab']['add_title']) ? $form_state['storage']['main_film_tab']['add_title'] : 0;

  $form['main_film_tab']['film_title']= array(
      '#type' => 'textfield',
      '#title' => t('Film Title'),
      '#size' => 60,
      '#maxlength' => 120,
      '#required' => TRUE,
      '#group' => 'main_film_tab',
      '#description' => t('Enter Film Title.'),
      '#attributes' => array(
        'title' => t("Title of Film"),
        )
      );

  $form['main_film_tab']['add_title'] = array(
      '#type' => 'container',
      '#tree' => TRUE,
      '#prefix' => '
',
      '#suffix' => '
',
      );

  if ($form_state['storage']['main_film_tab']['add_title']) {
    for ($i = 1; $i <= $form_state['storage']['main_film_tab']['add_title']; $i++) {
      if ($i <= 2) {
        $form['main_film_tab']['add_title'][$i] = array(
            '#type' => 'fieldset',
            '#tree' => TRUE,
            );

        $form['main_film_tab']['add_title'][$i]['main_film_tab']['film_title_'.$i] = array(
            '#type' => 'textfield',
            '#title' => t('Film Title '.$i),
            '#size' => 60,
            '#maxlength' => 120,
            '#required' => FALSE,
            '#group' => 'main_film_tab',
            '#description' => t('Enter Film Title.'),
            '#attributes' => array(
              'title' => t("Title of Film"),
              )
            );
      }
      else {
        return FALSE;
      }
    }
  }

  $form['main_film_tab']['button_add_title'] = array(
      '#type' => 'button',
      '#value' => t('Add another title.'),
      '#href' => '',
      '#ajax' => array(
        'callback' => 'custom_registration_ajax_button_add_title',
        'wrapper' => 'add_title',
        ),
      );

  $form['main_film_tab']['button_add_title']['#executes_submit_callback'] = FALSE;
  $form['main_film_tab']['button_add_title']['#limit_validation_errors'] = array();

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

  $form_state['storage']['main_film_tab']['add_title']++;

  return $form;
}

function custom_registration_ajax_button_add_title($form, $form_state) {
  return $form['main_film_tab']['add_title'];
}

function main_form_form_submit($form, &$form_state) {
  $film_id = db_insert('film_main')
    ->fields(array(
          'film_title' => $form_state['values']['film_title'],
          'film_title_1' => $form_state['values']['film_title_1'],
          'film_title_2' => $form_state['values']['film_title_2'],
          ))
    ->execute();
}


texts: Custom content type and custom list view

texts:
Hi totally new to Drupal and I've managed to set everything up I needed to. Custom content types, taxonomies etc.

Firstly I'd like to know how to link to a page which will display all the posts in my custom content type.


texts: Add custom class to link outputted by views

texts:
I'm using views to output a link. The user gets two fields in which to add the href and the text on the link. I wan't them to be able to put a class on the link as well. How can I do this?

In views I have set a fixed class to all those links, but I wan't to be able to add another class if I wan't to, from the backend.


texts: I am trying to load a javascript file in my .info file, but I can't tell if it is loading or not. What is the best way to find out if it is loaded and if it is the right path?


texts:
how to prevent user creating a duplicate node title for a content type?

I already try uniqueness module (https://drupal.org/project/uniqueness) but it's only list out the duplicate content title but not return any error message when user save the new content. Any suggestion module or code? :)


texts: How do you get the url of an image in a view twig template?

texts:
I want to check the fields.field_image.content to see if it is empty or not.  I want the view to display differently if there is no image in the page field_image field.

I was thinking I could just get the URL of the field_image and do a simple if statement, but I don't see a way to do that.

Is there to check if the fields.field_image.content field is empty?

I've tried a few different things like:

{% if fields.field_image.content is empty %}
{% if fields.field_image.content0|striptags|trim is empty %}

I'd like to dump fields.field_image to see the whole object, but my local setup always crashes.

Is this even possible?

The answer is yes it is possible to check if the image is present or not.

Here is how to do it:

{% set fieldimage = fields.field_image.content|render|striptags('<img>')|trim|length > 0 %}
{% if fieldimage == false %}
  image is empty
{% else %}
  image is not empty
{% endif %}


texts: How to run a cron queue programmatically?

texts:
I have created a cron queue like given below.

function mymodule_cron_queue_info() {
  $queues['aggregator_feeds'] = array(
    'worker callback' => 'aggregator_refresh',
    'time' => 60,
  );
  return $queues;
}

My cron runs when calling drush cron. I need to run the queue 'aggregator_feeds' individually without invoking any other cron queues. Drupal admin panel -> config -> cron : runs all queues as per schedule.
drush cron command too runs all queue. How do I run a single queue programmatically?

Also I need to know how to run all the queues programmatically?


texts: Difference between views handler and views plugin?

texts:
What are the main differences between view handlers and view plugins?

I checked the documentations for view handlers and view plugins, but I find them quite similar.

Can anyone show me what a view handler can do that a view plugin cannot?


texts:
I want that block titles have the h3 tag instead the h2 tag. As I understand I have to change this in the file block.tpl.php.
I found 4 block.tpl.php

root/modules/block/
sites/all/themes/omega/omega/templates
sites/all/themes/omega/starterkits/omega-xhtml/templates
sites/all/themes/omega/alpha/templates/

My question: Which one is the right file to change? I took now the one in the omega folder and it worked (the one in the modules folder did not). But I want to be sure whether this is the correct in order not to have side effects.
And what for is the modules/block directory with files?

thanks for any feedback


texts: Changing menu paths for existing nodes in Drupal 7

texts:
So I have created around 100 articles of a specific content type and provided all of them a menu path under a specific menu.

Now the requirement is to alter these menu paths and give these nodes a new menu path under another menu. The longer and obvious way to go about doing this is to edit each of these content types manually and then edit the menu path to edit and point it to the new menu. This is a painstaking procedure that shall consume time. I am sure there are alternatives such as a Drupal module that let's you mass alter menu paths for a specific content type?

Alternately, is there a way for me to get into the drupal database and find out where these menu paths for a specific node/content type are stored? And I can simply execute a query that goes in and changes that?

Thanks!


texts: Apply for role - no activation email after account approval

texts:
After admin users select 'Approve' for a role application, the account automatically becomes active, but it bypasses the notification to the user that their account is active and critically, they don't get the One time login URL where they can set their password.

Is there any way to provide this token in an action of the Apply for role approval trigger?


texts: Commerce Kickstart new products aren't showing under manage products

texts:
I'm working with the Commerce Kickstart 2 release and I'm starting to figure out how this works, but I'm having one major issue.  I've created a new Product and content type, created taxonomy to populate it up into the menu etc. But I can't get the new products to show in under the "manage products".  It populates onto the new page under the new menu item so it's there.  I've re-indexed the Search API, and nothing happened.  I've taken a look at the views that are being indexed and it looks fine too.
Has anyone else had this issue - if so were you able to resolve it?
Thanks!


texts: Filter after Custom Field Type in Custom Filter

texts:
I'm facing a problem with a custom field type in a custom filter. The field type isn't showing up in my filter-criterias in views. Do I have to tell the fieldtype somehow that it is filterable? Or is this a problem with my filter? I suppose the error is somewhere here:

function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $this->view->init_style();

    // Allow to choose all fields as possible.
    if ($this->view->style_plugin->uses_fields()) {
      $options = array();
      foreach ($this->view->display_handler->get_handlers('field') as $name => $field) {
        $options[$name] = $field->ui_name(TRUE);
      }
      if ($options) {
        $form['fields'] = array(
          '#type' => 'select',
          '#title' => t('Choose fields to combine for filtering'),
          '#description' => t("This filter doesn't work for very special field handlers."),
          '#multiple' => TRUE,
          '#options' => $options,
          '#default_value' => $this->options['fields'],
        );
      }
      else {
        form_set_error('', t('You have to add some fields to be able to use this filter.'));
      }
    }
  }

This is from my filter where it should show all fields, but does show only a few.


texts: How can I limit the number of chars/words in a long text field to 3000?

texts: I would like to limit the amount of text that my users can input in a text field. I want it to be a text area so I made a field called "Solution" then I made it a type "Long Text" and a widget type of "Text Area." I would like to limit the number of characters that the user can post to 3000 characters. Is there an easy way to do this?


texts: How can I get the length of a list in Rules?

texts: If there is another way to check if a list is empty, that is fine too.


texts: How can i add a block below the content of a node?

texts:
I created many blocks and used them in my nodes regarding to contet types.

But i need another thing.
I created new block.
In the "/admin/structure/block" page i dragged this block to "Content" region.
The block appeared in content region. But it appeared above the node body.

In content part of "/admin/structure/block" there is 2 blocks:
"Main page content" and "My own block".
My own block is below the other block. But still it appears above the content body.
Should i pay attention any other thing?
Thank you.


texts: use jquery to add a div wrapper to a dynamically created drupal modual div

texts:
I need to add a div with class=row around a bunch of divs that are being dynamically created by a drupal module (cant do it in the view either)

i was trying this, but since it is created dynamically, it does not work:

$("#row").prepend("<div id='edit-secondary-wrapper'/>");

this is the div that the module spits out that i want a row around

id='edit-secondary-wrapper'


texts: View based on months or days - display certain items during specified times of the year

texts:
I am trying to create a calendar-type view that will display links to specific nodes during certain months of the year. For example, this would show 'Taxes' in Feb and April, 'Travel' from May to September, etc.
So far I have added a boolean field to my node to appear in the view, but I am stuck on how to implement the date selector. Theoretically I would like to have people select the months that this node should appear in the view, and the view will contextually display the nodes depending on the current month.
The problems I'm running into are:

The date field seems to require a year, but I want this to be year agnostic
The date field doesn't allow selection of multiple months

I am thinking that I will have to use a date field so that I can use contextual filters to display based on month of the year. I don't have access to the codebase so I need to do all of this within the UI using modules, if possible.
Any tips on how I can achieve this?


texts: CDN Module, CDN Mapping for multiple source domains

texts: I have a Drupal 7 site with the CDN module working nicely (with MaxCDN). The CDN mapping is working perfectly for mapping all of my assets to the pull zone. Additionally, I have images on the site that are loaded from a third party (real estate listing images). How can I configure images from that domain to have a second CDN mapping configuration (I have a pull zone created for this second domain). Thank you for any help.


texts: How do I rename Company field and remove Address2 field in a multiple value field in Addressfield module

texts: I was able to remove the Address field with hook alter when it's single value field but don't know how to do it when it's a multiple value field. Same with renaming the fields. Thanks.


texts: different drop down list for different nodes

texts: I am using drupal 7.10.I have a content type bank details which is for entering bank details like bank name,address,contact details etc.,Now for each bank i need a drop down list which shows a list of agents of that particular bank.Note this is for each individual bank node.need help on this.Thanks.


texts: Add a default value for existing Image alt field

texts:
I have an image field in article content type and have created hundreds of nodes for article content type, but now I need to add a value for image alt fields for these existing nodes.
Even the default value field for image alt is not showing when I try to edit the field.

How can I add values for the alt attribute of the image field in existing nodes?


texts: How to remove Storage API without data loss

texts:
I'm working on application based on Drupal 7.39 that use the Storage Api module version 7.x-1.8 with FTP container.

I'm trying to achieve is to remove this module and use the normal flow to save assets (I think that all assets will be saved in app/sites/default/files).

I downloaded all files from FTP container in app/sites/default/files folder.

I tried to disable the module, but I noticed that images fields served by the plugin are not available anymore. The association in content pages are still present but I only see a broken link.

How can I update all the fields served by the plugin to use files that are in app/sites/default/files? In other words I want to remove the plugin and all his associations to files. Is that possible? Can I migrate these associations?

Thank you.

UPDATE

As Jonathan Rhodes suggests me, here's the procedure to update uris.

$queryString = "SELECT * FROM db.file_managed WHERE uri REGEXP '^storage-a*'";

try {
    $db = new PDO("mysql:host=localhost;dbname=db;charset=utf8", "root", "root");
    $query = $db->prepare($queryString);
    $query->execute();

    $rows = $query->fetchAll(PDO::FETCH_ASSOC);

    $func = function ($element) use ($db) {
        $uri = $element['uri'];
        $uriReplaced = preg_replace('/^(storage-.*)(:\/\/.*)/', "public$2", $uri);
        $queryUpdate = "UPDATE db.file_managed SET uri = :uri WHERE fid = :fid";
        $query = $db->prepare($queryUpdate);
        $query->execute(['uri' => $uriReplaced, 'fid' => (int) $element['fid']]);
    };

    echo count($rows);
    array_map($func, $rows);
} catch (PDOException  $e) {
    echo "Error: " . $e;
}

echo 'ok';


texts:
I am working on creating the XML feeds for the contents of a specific content type. But after creating XML feeds, I noticed that the blank space is appearing at top of the XML feeds.

How can I remove that?


texts: Different filters in view for each product page

texts:
Working in drupal 7.

Im not sure how to do this actually, but i have a big view with a lot of products and a long list of filters were you can search the product.

But lets say i want to go to cars page, then the filters from all the others products is still there, how can i hide those filters from that particular page? So it don´t affects the "see all" page where all the filters should be.

It´s made in one view which is called search-products, and that view is in all the pages.

Under advanced i have added taxonomy term with depths. And also have the better exposed filters installed, i´ve tried to hide some filters under BEF settings and only for this page, but didn´t work, it also hides it in the "all page".


texts: Feeds for the module information of drupal.org

texts:
http://simplytest.me/ has a nifty autocomplete option for the module suggestions. Screenshot attached.

I did a little digging and figured it out that ajax call being made is to the following url.

  http://simplytest.me/simplytest/projects/autocomplete?string=views

I could be use the same end point but I need to get the permission and also the data available is not sufficient for my use case. I wanted to know if Drupal.org provides any authentic feeds of modules so that I will be able to list other details, say the download url for the tarball file.


texts:
Does anyone know why Drupal 7 takes all of my URL aliases, and adds a /search at the end of each URL?

So it's creating duplicate content, duplicate title tags, etc, delivering the same content and 2 different URLS.

Does anyone know how to fix this?


texts: Can I creat a View output using the root path?

texts:
just need a simple task. I need to change the homepage based on a view.

If I edit the path inside view settings something like /home it works. But if I try to use the default site root path it displays:

Display "Page" uses a path but the path is undefined.

That means I am forced to set up my site homepage to www.domain.com/home

Can someone help?


texts:
Is there a way to use Wildcards (like *) in Views filters. I do not want to give the user the dropdown with all the operators but use a wildcard.
For example, when he writes name it will use "ends with", on name "begins with", on name "contains" and so on. Is there something out there that can do that, or do I have to write it on my own?


texts: How to run custom command running drush cron via sudo?

texts:
The documentation for drush cron says:

  You should set up crontab to run your cron tasks as the same user that runs the web server; for example, if you run your webserver as the user www-data:

I wrote a wrapper drush command to do this.  In my drush_hook_COMMAND, I call

system('sudo -i -u www-data /usr/bin/drush --uri=http://BLAH --root=BLAH cron');

This works in almost all ways.  However it does not correctly check for updates.  On my drupal status page I get

  There was a problem checking available updates for Drupal...

I've tried using drush_shell_exec instead of system, just the same.  However if I do it via drush eval, it does work:

drush eval "system('sudo -i -u www-data /usr/bin/drush --uri=http://BLAH --root=BLAH cron');"

So I'm completely baffled.  Any idea what could be different between eval and the command hook?


texts: Gmap Views - Proximity filter for user locations based off of a specific node location

texts:
I am trying to build a view that shows the location of any users that are within a certain radius of a node's location. I can get a specific node's location to show up using its nid as the argument, and I can get the users' locations to show up (content profile location), but I can't get BOTH to display on the same map.

I'm thinking the problem is that I only have one option for the datatype that views uses to generate the markers. I've also tried displaying the node's marker through a gmap macro, but when view is displayed, the marker information from the macro is gone, and only the locations rendered by the view's fields are displayed.


texts:
I have JavaScript attached to an element in a form that sends it's new value to a PHP callback function. The callback function queries the database and then returns a value that JavaScript then puts in a text box as its value.

I have experimented, and found that callbacks do not work on node edit forms. I assume it has something to do with the new AJAX functionality built into forms.

How to get around this problem?


texts:
Hy Drupal Masters!

My question is about commerce module.
I managed to do the followings:

create taxonomies (for creating menu and categorizing products - type - , AND for classifying products in other context - package)
create product types
create the appropiate content types to product types
creating product variations(variations based on 2 fields in content types: "type" and "package" )

For example
I have 3 menu-category with products: prod1(products of category: prod1-1, prod1-2, prod1-3), prod2(prod2-1, prod2-2, prod2-3), prod3(prod3-1, prod3-2, prod3-3)

Each product in one category has 3 variation: small, medium, large
At the moment, if I click one of the categories, the product list appear with the good products, and each product has only one variation.
(eg. I click prod1, I'll see the products, like: prod1-1small, prod1-2small, prod1-3small)

How I expected...but:

I wold like to place a selector(select list or checkboxes, I don't mind) to the top of the product list under each category that is containing small, medium, large elements. Than if I select "medium", the product list needed to change according to the selection.(I would like to see the: prod1-1medium, prod1-2medium, prod1-3medium)

In a product details page I could do this, but in a product list page, I couldn't.

I am using drupal 7

Please somebody help me!


texts:
Currently my users are being redirected to a node after trying to first access that node's comment page (comment/reply/nid) via a link in a view.  This is because I've set it so you have to be logged in to leave a comment.  In the message area, on the node that they are redirected to, is an error message, "Error message: You are not authorized to post comments."

I want to change this so that when an anonymous user accesses the comment/reply/nid she is presented with a login page and then directed back to the comment/reply/nid.

I've tried logintoboggin, but that doesn't seem to work.  This is possibly because an access denied message is being displayed, not a 403.

I have a view that displays links to comment on various nodes, and I tried altering the links in this view via hook_views_pre_render.  I was going to try and add a modal window containing a login form if the user was anonymous by taking a more html and js approach a la Twitter Bootstrap.  But I was unable to locate the link in the massive view array.  I was hoping for a render array to modify (add a class, add an attribute, etc).  Not even sure if this would be a "Drupal kosher" approach.

Any ideas?


texts: How to filter the values of an array in drupal

texts:
In drupal we have check_plain function to filter the unwanted codes from a text, I have an array which I am storing directly, in that case, I need to check each value before storing, is there a function to which we can pass the array and it should filter and reset the array.

Ex - I have a form where users can add as many names as they want using (multiple textfield) the name of the textfield is - guarantors[]

So I have an array where all the userinput is there, inorder to filter, I need to filter each value of array using foreach.

is there a function or way, so that I can directly pass the array to a function and it should return me an array with safe values, i.e each values should be parsed using check_plain function.

I think an expample may help you answer better, here is my example array.

Array
(
[0] => Array
    (
        [keyword] => lucidus
        [color] => #00ff00
    )

[1] => Array
    (
        [keyword] => commoveo
        [color] => #998899
    )

[2] => Array
    (
        [keyword] => dolus
        [color] => #ff0099
    )

)

NOTE :: keyword and color are user input values. And those needs to be filtered, it is and can be a multidimensional array.

Many Thanks


texts: Is there a simple way to increase the maxlength value of a plain text field that has data in it already?


texts: How to get a separate form_id for each of the taxonomy/term/%term exposed form?

texts:
I'm trying to combine in a smart way Contextual filters Has taxonomy term ID with Remember the last selection feature of exposed form filters in a view.

Context

A taxonomy vocabulary called destinations (countries & regions)
A view of content tagged with destinations terms : Contextual filters : Content: Has taxonomy term ID (with depth)
Exposed filters such as travel duration, price...
Important point, Remember the last selection is ticked for all the filters
Ajax enabled, and the whole thing displayed as a content pane

The issue

Let's say I visit taxonomy/term/spain and filter the view by price < 700$, then go to taxonomy/term/india e.g, the view will be already filtered by price < 700$, and may return empty result, which is an unwanted behaviour.

This is because across all the taxonomy/term/% paths, the exposed form form_id remains the same views_exposed_form.

How could I get a separate form_id for each of the taxonomy/term/% exposed form, so that the last selection would be kept for each term ?

Or setup my view in order to get the expected features ?


texts: Drush command to delete content going out of memeory. What can I do?

texts:
I have implemented drush hooks to build a drush command that deletes a lot of legacy nodes. It basically does a node_delete on a lot of nodes in a loop. However, I have the memory limit set to ~380MiB in settings.php and when I run the command to delete large number of nodes, say 100 000, drush terminates abnormally with an error indicating that it ran out of memeory. This happens by the time it deletes 20000 nodes. I have looked around and checked the definition of node_delete. In the definition there is a comment about the possibility of going out of memory.

I tried unsetting variables, and I tried doing node_load(NULL,NULL,TRUE)-- as suggested one drupaler on this forum-- hoping to release some memory every number of iterations but this did not work. So is there anything I can do? I am trying to avoid breaking it into chunks for ease of release.


texts: Is this the correct way of iterating through users and check if they have a determined permission?

texts:
I'm developing a module where I need to retrieve all users of a website and check if they have a specific permission.

<?php
$reviewers = array();

$result = db_query('SELECT uid, name FROM {users} ORDER BY uid');

while ($record = db_fetch_object($result)) {

    if ($record->uid != 0) {
        if (user_access('review article', user_load($record->uid), TRUE)) {

            $reviewers[$record->uid] = (string) $record->name . '@domain.com';

        }
    }
}

I'm using this code and it works but it can become quite slow. I've tested in a site with 5.000 bogus users and it takes about 30 secs to complete.


texts:
My dynamic Competition form has two basic parts:

1- Basic Info

Name
Size Dropdown

2- Ajax Fields

Options dropdown based on Size

When I change the value in Size, a new combobox is loaded via AJAX with related values.

Here is part of my form:

if ($competition->size == 0)
    {
        $form['country'] = array(
            '#type' => 'select',
            '#title' => t('Country'),
            '#weight' =>3,
            '#required' => FALSE,
            '#zurb_class'=> 'cleared',
            '#default_value' => $competition->country_id,
            '#options' => _ajax_countries_dropdown_options(),
            '#prefix' => '
',
            '#suffix' => '
',
        );
    }
    else if ($competition->size == 1)
    {
        $form['continent'] = array(
            '#type' => 'select',
            '#title' => t('Continent'),
            '#default_value' => $competition->continent_id,
            '#weight' =>2,
            '#required' => FALSE,
            '#options' => _ajax_continents_dropdown_options(),
            '#prefix' => '
',
            '#suffix' => '
',

        );
    }
    else
    {
        $suffix = '

';
    }

    $form['size'] = array(
        '#type' => 'select',
        '#title' => t('Size'),
        '#default_value' => $competition->size,
        '#weight' =>1,
        '#options' => $options_size,
        '#required' => FALSE,
        '#ajax' => array(
            'callback' => 'ajax_competition_size_dropdown_callback',
            'wrapper' => 'dropdown-competition-size-replace',
            'method' => 'replace',
            'effect' => 'fade',
        ),
        '#suffix' => $suffix,
    );

Ajax Callback

function ajax_competition_size_dropdown_callback($form, $form_state) {
    $size = $form_state['values']['size'];

    if ($size == 0)
    {
        return array(
            '#name' => 'country',
            '#type' => 'select',
            '#title' => t('Country'),
            '#weight' =>3,
            '#required' => FALSE,
            '#zurb_class'=> 'cleared',
            '#default_value' => $competition->country_id,
            '#options' => _ajax_countries_dropdown_options(),
            '#prefix' => '
',
            '#suffix' => '
',
        );
    }
    else if ($size == 1)
    {
        return array(
            '#name' => 'continent',
            '#type' => 'select',
            '#title' => t('Continent'),
            '#default_value' => $competition->continent_id,
            '#weight' =>2,
            '#required' => FALSE,
            '#options' => _ajax_continents_dropdown_options(),
            '#prefix' => '
',
            '#suffix' => '
',
        );
    }
    else
    {
        return '

';
    }
}

Steps I made so far:

When I change the first select when editing, the values are not saved.
Debugging Backend
The form changes on the front (AJAX), but it does not change on the backend
Apparently the problem is I am creating the form fields based on size, Drupal will only recognize this fields. So when I change the select and load the second, it won't parsed by Drupal
I tried to use $form_state['rebuild'] = TRUE; but it didn't fix anything, actually avoided the redirection after submission.


texts:
I'm trying to send user edit page to the user profile page (/user), so I can get user profile informations and user edit form on the same page.

function hook_preprocess_user_profile(&$vars) {
  global $user;
  $account = user_load($user->uid);
  $vars['form'] = drupal_get_form('user_profile_form', $account);
}

Then in user-profile.tpl.php I have the following :

<?php print drupal_render($form['field_user_address']); ?>
<?php // Print necessary validation fields and remove others
      unset($form['field_user_society_id']);
      unset($form['field_user_locations']);
      unset($form['locale']);
      unset($form['account']);
      print drupal_render($form);
 ?>

It works well, I have my form, the datas are coming into it but when saving it, even if I get status message "Changes have been saved" actually no datas are saved.

I tried to put module_load_include('inc', 'user', 'user.pages');in a hook_init() and in a form_alter, but no way to get the form datas saved.

Thanks for helping.


texts: Improving performance with Field Collections?

texts:
I'm using using entity reference, field collection , and field collection table modules on a site that features "courses" and "lessons" as content types. A field collection with unlimited values is embedded in the course content type, and it contains two fields: a text field for "section" and an entity reference field for "lesson". This allows the same lessons to be reused in different courses, while appearing under a different section. (see screen for reference).

This works pretty well, but performance when editing course nodes starts to degrade significantly after about 30 lessons are added to a course. At 100 lessons, it takes about 15 seconds to load a course for editing. With 140 lessons in a course, it takes about 22 seconds to edit a course node. I'm testing locally on a new D7 test site with devel-generated content.

Questions:

(1) Are there any obvious steps I should take to improve performance with field collections?

(2) As an alternative to field collections, would creating a compound field in code likely improve performance significantly?

(3) For testing performance generally, is there a simple profiling tool I can use with Drupal?

Example of a small course with 10 lessons added as field collections:


texts: Display user role with the Advanced forum module

texts:
I use the Advanced forum and the Author pane modules.

I want to show the role the user has, as in the following screenshot.

I looked everywhere, but I have not found a real solution.

NB: I'm not a PHP expert.


texts: Permissions and ownership of /var/www and /var/www/example_drupalsite.com

texts:
I would like to get some feedback on my setup of permissions and ownerships for the following directoriess:

/var/www/
/var/www/drupalsite.com

Right now I have the following for:

drwxr-x--- 11 root www-data 4096 2012-01-01 00:00 www
drwxr-x---  4 root www-data 4096 2012-01-01 00:00 drupalsite.com

I am a single user on this vps: developer1
in a group called : developers

Is this secure and logical? A default ubuntu install starts with root as the owner and group with permissions of drwxr-xr-x but using those if I set these this /var/www/drupalsite.com becomes unavailable.
What's the best to do if I want to be able to have write permission as developer1 to the files in /var/www/drupalsite.com?


texts: How to make a numeric textField in Drupal WebForm?

texts: Can anyone suggest how to make a numeric only textfield in WebForm for a mobile number field?


texts:
I created my own theme in Drupal 7. It is not sub-theme. Simple I created a folder at sites/all/themes/my_foundation, a template.info as usual, then an empty page.tpl.php.
I expected that a blank white page is obtained after enabling the new theme and visiting the home page. However, I have got a page with some contents as screenshot:

I need to know how it was occurred and how could I get the expected behavior?


texts: absolute url of inline images in body using views and services

texts: I am using services module in Drupal 8 to output node body in JSON format. The inline images are broken in android app which uses json to render node. Is there any code/method or module for D8 which can rewrite relative inline images path to absolute. My drupal version is 8.0.5


texts: Showing Taxonomy Terms with Empty Descriptions in Views

texts:
I'm trying to display a list of terms from a single vocabulary that have blank descriptions. I'm using views, and I've tried to set up some regexes as filters. A simple: [\w] returns all of the non-blank ones. However, when I try to do something like ((?!.[\w]).) which should negate the string, I get some sql errors. I tried filtering with not containing certain words (i.e. any words), and I tried "shorter than" 1, but it seems that the truly empty description fields don't show up on any of these.

Any thoughts?


texts: Why is the third level not showing in my superfish menu?

texts:
I'm having a super fish menu wih three layers of menu points but my second layer links do not seem to be expanding even tho "Show as expanded" is checked for the individual menu points (2nd level) that is selected as "Parent item" for the 3rd level page.

Some links:
menu point with submenus: http://www.lslib.ca/content/skwlax-daycare
Third level page(hidden from the menu): http://www.lslib.ca/content/admin

How can I get the third level to display?

EDIT 1

I don't exaxctly know how Superfish binds into the configration either. Maybe a link to the page would help: http://www.lslib.ca/
Under Blocks, I only see Content assigned to a Region. I'm officially confused here... :o

EDIT 2

The name of the theme is Nexus Theme, under admin/appearance it says: Nexus Theme is a premium Drupal 7 theme. Developed by Devsaran.com.

In page.tpl.php I have the following:

<nav id="navigation" role="navigation">
  <div id="main-menu">
    <?php
      if (module_exists('i18n_menu')) {
        $main_menu_tree = i18n_menu_translated_tree(variable_get('menu_main_links_source', 'main-menu'));
      } else {
        $main_menu_tree = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
      }
      print drupal_render($main_menu_tree);
    ?>
  </div>
</nav>


texts: 'Flags: Node flag relationship' - Search Api - Solr - Views

texts:
Flag - 7.x-3.0-alpha4
Search API - 7.x-1.3
Solr search - 7.x-1.0-rc2+13-dev
Apache Solr - 3.5

I have Flag 3.x working fine in my Solr Views.  I am able to flag/unflag correctly.  Flag comes with a default 'My Bookmarks' view, that shows the current user what they have flagged at the moment.  I basically took that view and recreated it using Solr Views.  But I am unable to find the Flags: Node flag relationship to only Include only flagged content by Current User.  I believe I am just missing something that is already there, because Flag 3 now uses entities, and relationships are solved for the most part.  If someone could shed some light on this so I don't end up writing unnecessary code, I would appreciate it.


texts: Drupal 7 form alter required field is not working when i used field from "Add existing field"

texts:
I have added two fields in to my custom content type using "Add existing field".

For specific URL, I need to set these two fields as Required.

So I have altered my form and set required condition. After setting it, I have printed the form using devel, these fields are having required settings.

$form['field_name']['und']['#required'] = TRUE;
$form['field_email']['und']['#required'] = 1;
dsm($form);

But required condition is not applied.

That is, I could not see red color required indication as well as its not working in the form submit.


texts: problems with entity translation insert hook

texts:
I'm using the entity_translation_insert() hook to set the value of a field when a node is translated.
I can successfully edit the $entity from within the implementation, but how should I save the resulting node?

I can't call node_save because it would start an endless loop. I tried field_attach_update but the result is the same (i.e. loop).

I've tried following this article, with no luck: http://anthonypower.com/notebook/assigning-node-field-values-hook-insert-and-update-right-way


texts: Deleting Aliases unchecks 'generate automatic alias'

texts:
I'm sure this is a bug.

I have a bunch of alias paths set where page URLs are generated based on menu location. I'm testing to see if I restructure the site and move a lot of content around, can I use path-auto, bulk update to change all the URLs.

Obviously I can't update without deleting the existing ones first (tested).

So I went in and delete all the aliases via Admin > Config > Search > URL aliases > Delete aliases. All aliases deleted, great.

But Bulk update won't give me new aliases. After a bit of poking around it turns out that running Delete Aliases has caused the 'Generate Automatic Alias" checkbox to be turned OFF on all my content.

so...

Why did running Delete Aliases cause all my content to change to using custom aliases?
Can I (somehow) revert all pages to automatic aliases?

Note - I'm using the govCMS distribution, so adding modules like VBO is not an option. I have almost zero understanding of drush, but I'm willing to dive in with instructions.

Note again - I had pathauto persistant state enabled when this happened.