texts: how to filter view having three group with one or and two and group?

texts:
I am having a view with three group filter i want to add condition like this

Example Below:

group1

field1 (and)
filed2

AND

group2

field1 (or)
filed2

OR

group3

field1 (or)
filed2

what issue i actually face is when i change the second and  third group filter to AND automatically the first and second group value is changing to OR how to solve this

Thanks in advance.


texts:
One of my webform component is using Webform Encrypt. The Encrypt feature is from Encrypt and Key modules. I set the key and encrypt as following. Everything is working fine in the submission data, but how can I decrypt the encrypted data if I send the data to someone? I have been searching this for days with no solution. Some online AES calculator has "IV" input and I don't know where to get that information.

Key:
type type: AES Encryption
key size: 256
key provider: file
file location: something/encrypt_key.key with based64-encoded

Encrypt:
General setting: enabled
Encryption Method: Mcrypt AES (CBC mode)
Key Provider: Key module(It's the key I made from Key module)

--- update question --- Apr 14th 12:24pm
How the person decrypt the data when I sent the encrypted data to him/her?


texts: How do I use field_view_field inside a custom views .tpl?

texts:
I have a view set up that uses an image from a node, I have customized the views-view-field.tpl to change the url the image links to dependent on the content type. I am trying to print out the picture using field_view_field in the .tpl, but its just printing out "array". Here is what I'm working with.

<?php if ($row->node_type =='article'): ?>
<?php print field_view_field('node', $row, 'field_field_image');?>

What am I doing wrong?
Thanks.


texts: Commerce minimum quantity and purchase multiplier

texts:
I have added a field to content type Product with the purchase quantity (default 1). Products can only be purchased by this quantity. For example, if its value is 5, you could buy 5, 10, 15, and so on. This is configured by products, and some products could have a value of 1, and others could have a value greater than 1.
After read some post about "quantities" and "minimum quantity", I haven't found how to do it. I have tried with some modules like Commerce Extras, and Commerce Add to Cart Extras. But without success.
Could some one give me some ideas how to do it?
Thanks in advance.


texts: Importing large flat-file data sources with Drupal 7 with Views 3 integration

texts:
My goal is to produce a fast, reliable and automated method for accessing read-only data contained in several very large flat-file data sources (CSVs, Fixed Width and XML docs) using Drupal 7 that can be queried against using the Views 3 module.  I would prefer to use already available modules, but building a custom module is also an option.

To help rule out modules and methods not suited for the task, here are the stats on the files I'm working with:

Yearly Import: 8,500,000 line CSV file. (Purged and reloaded yearly. Has primary key.)
Weekly Import: 350,000 line fixed width file. (Purged and reloaded weekly. No primary key.)
Hourly Import: 3,400 line CSV file. (Would like to update and sync as often as possible, but no more than every 20 min. Has primary key)
Daily Import: 200 item XML file. (Purged and reloaded daily. Has primary key)

Converting between the three formats is not an issue and can be done if it will improve import performance or allow better tools to be made available. (AWK for Fixed Width to CSV, etc.) Retrieval and conversion automation is easy via cron and sh scripts, but still need to automate the Drupal 7 integration. The use of custom tables is also possible as long as vews can reference the data using relationships.

What would be the best practice to accomplish this type of data integration with Drupal 7?  Also, am I leaving out any important details regarding the data or what I'm trying to accomplish?

Here are a few projects I'm currently looking at to find a solution.  I would like to expand on this to help others decide which route to take when working with larger data imports.

Importing data into nodes:

Feeds (Currently Alpha for D7)

Feeds will import the data reliably.  Speed is reasonable for the smaller data sources but is too slow for the 300k+ tables.

Automation available using cron and Job Scheduler (Currently Alpha for D7).

Migrate

Not having an index or unique key available in the source data is making this difficult to use.  It is faster than feeds, but still slow to import the very large tables.

Automation is available via drush and cron.

Custom Tables Instead of Nodes

Data Module (Currently Alpha for D7)

The Data module looks very promising, but is very buggy for D7 at the moment. The automation and import speed requirements would be easily met using data, but reliability is lacking.  The views integration (link is for D6) looks very promising.

Table Wizard (Not available for D7)

Added this for reference.  There is no D7 candidate at this point, but could serve as a starting point for a custom module.

Views Schema (Abandoned, D6 only)

Added this for reference.  This seems to have been absorbed by Table Wizard in Drupal 6.  Again, added only for reference.

Importer (RC2 for D7)

Seems to require Table Wizard (D6 only) for Views integration.  Added for reference, but doesn't meet Views requirement.

@MPD - Added "Custom Tables" as a possible solution, and expanded modules.  Thank you for this addition.


texts: Prepopulate an entity reference in an inline entity form

texts:
Using Drupal 8...

I have a content type, called "Qualification".

In Qualification is an entityreference field called "Specification Sections" (field_specification_sections).

The entityreference (field_specification_section) field uses an inline entity form to create a node of type "Specification Text Section" (specification_text_section).

In other parts of my site, I need to be able to call the 'parent' of Specification Text Section, so there is a entityreference field called that refers back to qualification.

I need to prepopulate, the field_qualification entityreference, when I create the Specification Text Section.

I've been struggling with using hook_inline_entity_form_entity_form_alter, trying to get the field_qualification to prepopulate.

I am currently using:

function mymodule_inline_entity_form_entity_form_alter(&$entity_form, &$form_state) {
     // get qualification node id from request
     $nodeId = \Drupal::request()->attributes->get('node');

     // load the node entity
     $node = is_numeric($nodeId) ? \Drupal\node\Entity\Node::load($nodeId) : null;

     if ($entity_form['#entity_type'] == 'specification_text_section'){
           $form['field_qualification']['widget'][0]['target_id']['#default_value'] = $node;

    }
}

But, this is not prepopulating the field in the inline entity reference.

If I still had hair, I'd be pulling it out!

Can anyone point me in the right direction?

Thanks


texts: How to add new tab in user edit page drupal

texts:
How can i add a new tab in user edit page. In user view page it is coming , but user edit page is not giving any result.

function usermail_menu() {
$items = array();
$items['user/%/invoice'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Subscription Invoice',
    'page callback' => 'usermail_invoice',
    'access callback' => 'user_is_logged_in',
    'weight' => 3
);
return $items;
}

This is working correctly. For user edit page i changed the path as

function usermail_menu() {
$items = array();
$items['user/%/edit/invoice'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Subscription Invoice',
    'page callback' => 'usermail_invoice',
    'access callback' => 'user_is_logged_in',
    'weight' => 3
);
return $items;
}

But it is not coming. Please help me. Do i want to add something else?


texts: How do I use Bootstrap theme's modal.jquery.ui.bridge's mapped events?

texts:
I am using a Bootstrap subtheme, and would like to trigger an event when a modal is closed.

Reviewing the main theme's modal.jquery.ui.bridge.js file, I see that the bridge is intending to map jQuery UI events (beforeClose, close) to framework events (hide.bs.modal, hidden.bs.modal).

I'm struggling with figuring out how to properly declare the data-dialog-options attribute of the triggering link to pass this event through the bridge.

In the JS file, this.options.jQueryUiBridge is true when typeof options === 'object'. My guess is that my options are not typeof object.

My attributes array on the Url object is

  $attributes = [
    'class' => ['use-ajax'],
    'data-dialog-type' => 'modal',
    'data-dialog-options' => Json::encode([
      'dialogClass' => 'modal-content--special-class',
      'beforeClose' => 'function() {console.log("closed");}',
    ]),
  ];

which results in the rendered link

My Link Text

What am I missing?


texts: How to create a chart using an uploaded CSV file as input?

texts:
I wish to generate a table and chart using an uploaded csv file (in Drupal 7).

I have uploaded the CSV file using the Feed Importer module and created a view (using the Views module). The view uses a display format of 'Chart', which is one of the possible views 'styles' you will have after enabling the Chart module.

My question: I don't know how to apply this to the uploaded CSV file.


texts: Uncaught PHP Exception: MissingValueContextException

texts:
After upgrading to version 8.8.5, I can't access the main web page, but I can log in to the admin panel. When I turn on the verbose logging funcionality I receive the following error message:

Drupal\Component\Plugin\Exception\MissingValueContextException: Required contexts without a value: view_mode in Drupal\Core\Plugin\Context\ContextHandler->applyContextMapping() (line 155 of core/lib/Drupal/Core/Plugin/Context/ContextHandler.php).

Drupal\panels\Plugin\DisplayBuilder\StandardDisplayBuilder->buildRegions() (Line: 183)
Drupal\panels\Plugin\DisplayBuilder\StandardDisplayBuilder->build() (Line: 338)
Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant->build() (Line: 29)
Drupal\page_manager\Entity\PageVariantViewBuilder->view() (Line: 105)
Drupal\Core\Entity\Controller\EntityViewController->view() call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch() (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup() (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)

I don't know if this is a core or a module error, any help appreciated.

Actual system: Drupal 8.8.5, PHP 7.4.5, 5.5.5-10.1.44-MariaDB-0+deb9u1

Thanks.


texts: How do I set the title tag for the maintenance page?

texts:
I need to change the default title tag for the maintenance page, which currently is "Site under maintenance | [sitename]".

I tried to set $variables['head_title'] in hook_preprocess_maintenance_page() but it doesn't work.

Also I think it can be set in hook_preprocess_html(), but I don't know how to check the served page is the maintenance page.

How can I achieve this?


texts: Node access control based on users at the node edit page

texts:
I want to ask is it possible to assign customized roles to particular users at the node edit page? For example, the node author/admin can assign "editor" role to user A & user B and assign "admin" role to user C at the node edit page. The node access control is different among different nodes and different users.

I found some related modules such as Permissions by Term and Permission by field but none of these can perfectly fulfill my requirements. I am using Drupal 8 so some modules may not suitable for me.

Is there any solution for that?


texts: How can I change the "content type" field name particularly in a view?

texts:
I have a few content types on my Drupal instance. Eg. case study, forum topic etc.

I have built a view, to display few nodes and their content types.

In this view, I want to display the content type as case studies instead of case study, forum topics instead of forum topic.

I don't want to change the content type globally, but I want to change the content type only in this view.

Is there any hook that I can write to make this change?


texts: Why is this block found but not installed?

texts:
I have a custom block that is found by "Place Block" but does not actually get placed. The spinny just spins for second and then nothing happens; the screen just stays at the list of available blocks.

Is there any method within Drupal 8 to see what the error is?
What incompatibilities might be causing this?

Setup Notes

Drupal 8.1
Lots of cache refreshing attempts
Lots of uninstall/reinstall attempts
Same behavior on a fresh D8 install
The module does install and the controller works at its prescribed URL
The base directory of the module is nrs_raceroftheday

This is the content of ROTDBlock.php.

/**
 * @file
 * Contains \Drupal\nrs_raceroftheday\Plugin\Block\ROTDBlock.
 */

namespace Drupal\nrs_raceroftheday\Plugin\Block;
use Drupal\Core\Block\BlockBase;

/**
 * Provides a 'Racer Of the Day' Block
 *
 * @Block(
 *   id = "rotd_block",
 *   admin_label = @Translation("RacerOTD v4 block"),
 *   )
 */
class ROTDBlock extends BlockBase {
  /**
   * {@inheritdoc}
   */
  public function build()
    {
    $pageContent='asdf';
    return array('#markup' => $this->t($pageContent),  );
  }
}

Here's the routing file nrs_raceroftheday.routing.yml.

nrs_raceroftheday.controller:
  path: '/racer-of-the-day'
  defaults:
    _controller: 'Drupal\nrs_raceroftheday\Controller\NrsRacerOfTheDayController::content'
    _title: 'Racer of the Day'
  requirements:
    _permission: 'access content'


texts: Custom fields added via form api not working as expected

texts:
I'm having a whole mess of issues adding text fields to a form in Drupal 6. I want to add a text field with an autocomplete. I tried adding the field in hook_form_alter() like so:

$form['my_field_name'] = array(
  '#type' => 'textfield',
  '#title' => 'My Title',
  '#required' => true,
  '#default_value' => 'my_default_value',
  '#autocomplete_path' => 'url/to/autocomplete'
);
$output .= drupal_render($form['my_field_name']);

When I output this, the field output to html does not have an id or name attribute, and the autocomplete doesn't work (presumably because the id is missing. Additionally, the default value is not populated in the field.

I can overcome some of these issues by adding in a custom #id, #name, and #value, like so:

$form['my_field_name'] = array(
  '#type' => 'textfield',
  '#title' => 'My Title',
  '#id' => 'my_field_id',
  '#name' => 'my_field_name',
  '#required' => true,
  '#value' => 'my_default_value',
  '#autocomplete_path' => 'url/to/autocomplete'
);
$output .= drupal_render($form['my_field_name']);

This gets the autocomplete working as expected, gives a name and id attribute, and fills in the default value, but unfortunately now the autocomplete does not actually change the value of the field, so I can't enter and submit a new value.

How can I overcome these problems with form_alter?


texts: I just made a new tab (quicktabs) with the drupal interface, but it is not displayed like the other tabs. In fact, it doesn't show at all. How can I debug such a problem?


texts:
How to use Taxes on Commerce 2.x ?
I created a Tax Type (European Union VAT), enabled it in the store, but no tax is applied.
It seems that all issues regarding tax module development are closed, so I don't understand.


texts: How to comment on image in colorbox (modal form)?

texts:
I have created view to display images and also user to display it in popup using Colorbox trigger in view.

I want to allow users to comment on each individual image in modal form only. Just like Facebook. I have printed the comment form on popup but it is coming with preview button which redirects user to the photo's node page. And allow there to POST comment which I don't want.

What I want is user should be able to comment in popup with post button and the comment should be posted in modal form only (Should be visible in modal and node page as well). Is there any module to workout this?


texts: How do I get a HTML value from $form_state?

texts:
I am dynamically showing the radio box values from database on a form.

<input id="edit-info-prog-dates-0" class="form-radio" type="radio" value="0" name="info[prog_dates]">

Aug 13, 2012 - Sep 24, 2012

$350.00 CAD

I am using the following code to generate the above HTML.

 $form['info']['prog_dates'] = array(
    '#type' => 'radios',
    '#title' => t('Select Dates'),
    '#required' => TRUE,
    '#options' => $dates,
    '#prefix' => '
',
    '#suffix' => '
'
);

I want to save the value for the cost in database. If I write the following code, I am only getting the input value '0'.

$form_state['info']['prog_dates']

How do I fetch the cost value, which is inside the  and  in HTML?


texts:
How can I add a class to first query result?

$number_of_slides = '3';
$slides_result = db_query_range("SELECT nid FROM {term_node} WHERE tid = 1 ORDER BY nid DESC", array(), 0, $number_of_slides);
while ($slidesid = db_result($slides_result)) {
$slides = node_load($slidesid);
print $slides->title;
}

anyway I tried this but it doesn't work.

aaa

bbb

ccc


texts:
I am using Drupal Commerce version 7.

I came across requirement for FEDEX shipping module. I installed it but in it's requirements, uc_quote is missing. I didn't find this module for Drupal 7.

I searched for this but it is supported only in Drupal 6.


texts: Semver, core_version_requirement and update hooks

texts:
I have read a little bit about using semver for contrib modules in the updated documentation Transitioning from 8.x-* to semantic versioning and Drupal.org release version numbers allow semantic versioning. While I do understand that we need to tag these branches & releases incrementally based on your current 8.x version, how is this taken into practise?

My module for example is considered compatible for both Drupal 8 and 9, tagged with a release 8.x-2.1 on branch 8.x-2.x. So would I switch to a new branch 3.x and tag 3.0.0, or can this tag be on the same 8.x-2.x branch as they are essentially running the same codebase? Otherwise I have to apply all bug fixes and changes onto 2 branches.

How would this work in conjunction with the core_version_requirement key, as I believe semver is only supported starting from Drupal 8.7.7 core version?

And finally if I am able to use the same codebase for either semver or without, how would this work with update hooks or are they maintaining the same format?


texts: Filter nodes by date ( excluding year ) show upcoming/previous based on today

texts:
i have content type called Race. This races happens every year so i want to have a page that show latest 5 upcoming races and past 5 races.

Is there a way that i can disable year in date api when adding a new race so that only month and day are taken for reference?

And not really sure how to setup views to filter this?


texts: delete a specific element within field collection programmatically

texts:
This is driving me crazy it just sounds simple, but I cannot find the answer.

I have a field collection in a content type called field_collection_mine how you now while creating the node you can add elements to the field collection.

I have tried this:

$wrapper = entity_metadata_wrapper($entity_type, $entity);
$wrapper->field_collection_mine = array();
entity_save('field_collection_item',$wrapper);

The code above delete all the elements within the field collection, but that is now what I want!! I just want to delete for example the last element. E.g:

Field Collection mine
Element1
Element2
Element3

How can I for example delete just the element 3? The above code deletes all the elements, so field_collection_mine is left empty.


texts: How to change the title of a modal window?

texts:
I have a link that displays a modal window.

The link redirects to a page view.

When I click on it, it is marked in the title of the modal window Array.

How to customize the title ?

<?php

namespace Drupal\commerce_agree_cgv\Plugin\Commerce\CheckoutPane;

use Drupal\Component\Serialization\Json;
use Drupal\Core\Form\FormStateInterface;
use Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\CheckoutPaneBase;
use Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\CheckoutPaneInterface;
use Drupal\Core\Link;
use Drupal\Core\Url;

/**
 * Provides the completion message pane.
 *
 * @CommerceCheckoutPane(
 *   id = "agree_cgv",
 *   label = @Translation("Agree CGV"),
 *   default_step = "review",
 * )
 */
class AgreeCGV extends CheckoutPaneBase implements CheckoutPaneInterface {

  /**
   * {@inheritdoc}
   */
  public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form) {
    $store_name = $this->order->getStore()->getName();
    $store_id = $this->order->getStoreId();
    $pane_form['#attached']['library'][] = 'core/drupal.dialog.ajax';
    $attributes = [
      'attributes' => [
        'class' => 'use-ajax',
        'data-dialog-type' => 'modal',
        'data-dialog-options' => Json::encode([
          'width' => auto,
        ]),
      ],
    ];
    $link = Link::fromTextAndUrl(
      $this->t('the general terms and conditions of the store "@store_name"', ['@store_name' => $store_name]),
      Url::fromUri("internal:/store/$store_id/cgv", $attributes)
    )->toString();
    $pane_form['cgv'] = [
      '#type' => 'checkbox',
      '#default_value' => FALSE,
      '#title' => $this->t('I have read and accept @cgv.', ['@cgv' => $link]),
      '#required' => TRUE,
      '#weight' => $this->getWeight(),
    ];
    return $pane_form;
  }

}


texts: Form with manged_file filed is not submitted?

texts:
I have a form in my drupal module. in my form, I have used manged_file field.
form name is "difference_form" and I have created two functions.
one is "function diffence_form" for form definitions.
here is code:

function difference_form() {
  $validators = [];
  $form['new_image'] = [
    '#type' => 'managed_file',
    '#name' => 'new_personal_image',
    '#title' => 'New Image',
    '#description' => theme('file_upload_help', [
      'description' => 'Please insert your new image.',
      'upload_validators' => $validators,
    ]),
    '#upload_location' => $path,
    '#default_value' => variable_get('new_image', ''),
    '#upload_validators' => $validators,
  ];

  $form['submit'] = [
    '#type' => 'submit',
    '#value' => 'submit',
  ];

  return $form;
}

function difference_form_submit($form, &$form_state) {
  drupal_set_message('test_form_submit called');
}

and also I have created a block for this form in hook_block_view.

function customize_block_view($delta = '') {

  $block = NULL;
  $block['content'] = drupal_get_form('difference_form');
  $block['subject'] = 'Difference Form';
  return $block;
}

Form is rendered correctly, but when I click on submit button, submit function is not called.

I tried to debug my codes. I found if I remove file_managed field from form definition, submit function works.

also if I found if I renamed all difference_form to another name for example "test_form"

drupal_get_form('test_form');
function test_form(){....}
and
function test_form_submit(......

submit function works.
it seems system is sensitive on "difference_form" only

I am thinking might the expression "difference_form" be blocked in database or somewhere else ?


texts: Module enable / disable is slow using drush cim

texts:
I have 2 drupal sites which takes a high time to enable or disable modules, while other sites are faster. It is true these slow sites are more complex: it has a lot more of modules.

Is there any solution for this problem or some way to debug it?


texts: How to count number of published nodes of a specific content type in twig template?

texts:
I'm looking for a way to achieve this in my Twig file; if the number of published entities of a content type 'promotions' is at least one, a certain entity should be displayed in a content type Shop. I'm trying to show a banner only if there is at least one published promotion entity.
I could use some help with the if-function. I've written it down with I'm trying to do.
if(published promotion entities > 0){
{{ drupal_entity('node', 2668) }}
}

Any ideas to get me going? Thanks!


texts: Integrating Drupal and Non-Drupal Site Content

texts:
I'm on a project to build some interactive data visualizations in D3. At no time during the discussion phase with the client did they mention the site had to be in Drupal.

We've now developed a draft site, and my team builds sites with just HTML, CSS and JavaScript, and no one has experience with Drupal. I know it's technically possible to implement what we've done in Drupal, but way beyond the scope of what was agreed upon.

The client seems open to having a launch page in Drupal that goes to the non-Drupal site with the fancy data viz stuff, but I'm not really sure how to go about this. Any recommendations?

All I can think of right now is just to have bunch of links back and forth between the two platforms, but seems kludgy.


texts: How to send variable value in POST Method in Drupal

texts: How to send variable value to another page by using POST Method in Drupal?


texts: How to display comment status with radio buttons?

texts:
How can I display the comment status (open and close) with radio buttons in the comment submit page? I want it be selectable during comment submission by the user.

Actually, I have a content type which has an comment field with two radio buttons:

Satisfied
Unsatisfied

My goal is that, when users select the "Satisfied" button, the comment will be closed automatically; when the "Unsatisfied" button is selected, the users are able to send the next comment.


texts: where is the breadcrumb printed at in the omega kickstart theme?

texts: can someone tell me where omega kickstart breadcrumb is printed in code I have looked in the templates dir and there dosent seem to be a page.tpl.php and the template.tpl.php in the main dir dosent have it either I want to move it to just over the content


texts: Categorised Multiple File uploads within a page in Drupal 7

texts:
I have a situation where I have to upload multiple files within categories. This can be explained by the following picture.
As you can see I need to upload multiple files, but also need to categorize them. Each category has different files and even though below picture shows the same name of the files, they are not shared. How can I do it in Drupal 7. Any idea?
Thanks


texts:
How can I add the red error border to a webform component programmatically?

I am doing so custom form validation when the form submits and I need to set the red border on under rules very specific to my module.

Currently, I am doing the following:

form_set_error('email_address', 'Please supply matching email addresses');

It adds an error message and stops the form from being submitted but it does not highlight the form field I am validating. That makes it difficult for the users to see the problem area at a glance


texts: How to display a colorbox only one time when a page loads

texts:
I have created a colorbox effect to show the login form when the home page loads using the following jQuery code:

jQuery(document).ready(function() {
  jQuery.fn.colorbox(
    {href:"user/login/colorbox",open:true}
  );
});

Now I want to do the same to display a registration form, but this registration form should only be displayed one time.

Please can any one help me find a solution..


texts: Post Migrate Development to Live Production Server issue

texts:
I'm positive I've successfully done this before but in testing a project today from a localhost Development (Ubuntu) to a live Production server (shared server, general market provider ala Bluehost) I'm getting a White Screen Of Death (WSOD) after importing the main filename.sql via phpmyadmin and I'm not sure why it's not working correctly.

Here's what I'm doing:

1) - copy via FTP all core and /sites/modules and my relevant dir contents.

2) - setup all Database with user/passwords including Admin as required.

3) - install generic Drupal v.7.2x onto server using Drupal /install.php

this then gets me a 'Standard' install but without all my data content but all accessable as per a generic standard Drupal install.

Next, back to phpmyAdmin, go to the relevant DB structure and chose 'Import', because I'm using a raw. sql I can just select the 22.5mg .sql file and wait, then I get the 'Success' message. I cannot use Backup & Migrate (M&G) Module due to the file limitation given my B&M.

After this point, I get a WSOD and cannot move forward.

The only thing I know that is different is that on my locahost Dev I used a simple 'Admin' name and a simple Password such as 'DeadEasy'. On the live Prod site, I changed this for better security to a name relevant to a SuperUser (ie AlphaBravoCharlie,(thats NOT real!!), Password: such as "DrG6%7DyE".

FYI, I did have some Fatal Errors yesterday based on Memory allocation, (I'm allowed 128meg max) but the example highlighted here is after I reduced module load to resolve the previous fatal error given.

Can anyone shed any light on what may have happened?

Notes #1:
I had thought it may have been that I hadn't uploaded my 'sites/all/themes', but it wasn't. #2 any other 'test' index.html work fine (as in temporarily disabling the index.php).


texts: How to troubleshoot general module issues?

texts:
My site has a somewhat complex setup, so I therefore have a good number of modules installed. As a result, sometimes different things will randomly stop working, and I am not sure what exactly the cause was. Posting in issue queues can only go so far, and I'd like to start learning how to troubleshoot these problems myself.

For instance, I'm currently using Entity Reference Prepopulate to help prepopulate fields in a "Review" entity type. I'm also using LoginToboggan to redirect users to a login page when they don't have permission to view the current field. Upon login, they are supposed to be redirected to the last page that they were on. So, with Prepopulate, the URL is something like http://www.gigindie.com/node/add/review?field_review_venue_reference=235, but after logging in with the LoginToboggan login form, the user is redirected back to http://www.gigindie.com/node/add/review instead of http://www.gigindie.com/node/add/review?field_review_venue_reference=235, which does not include the Prepopulate portion of the URL.

Obviously the above example is a specific use case, and help with that would be appreciated, but this question is a more general one. How do I go about figuring out why a module might not be working, and which other modules are conflicting with it, if any? Are there any tactics that would help specifically with troubleshooting module malfunctions?


texts: debug_backtrace and _drupal_error_handler_real with very high mem usage, can I disable?

texts:
I was profiling some of my code with xhprof, and I noticed that debug_backtrace() and _drupal_error_handler_real() have a very high memory usage.

I set "Error message display" to "None" at admin/config/development/logging, and I also have database logging module disabled. Still, these functions seem to collect error information. Do you have any idea why it happens?

My code does generate some PHP warnings. If I fix them, would these error calls disappear?


texts: Is it possible to have placeholder text on a view filter with type date_text?

texts:
I've got an exposed filter on my view that allows users to specify a date, and I want to specify a placeholder for this text field.

I've tried doing this using the following code in a hook:

$form['field_start_end_dates_value']['value']['#attributes'] = array('placeholder' => array(t('Search')));

(I know this is in the correct hook as I'm successfully altering other form elements within the same form)

I've var_dumped the form variable, and I'm getting the following output for the date filter:

[field_start_end_dates_value] => Array
        (
            [#tree] => 1
            [value] => Array
                (
                    [#title] =>
                    [#type] => date_text
                    [#size] => 20
                    [#default_value] =>
                    [#date_format] => j M Y
                    [#date_label_position] => within
                    [#date_year_range] => -3:+3
                    [#process] => Array
                        (
                            [0] => date_text_element_process
                        )

                    [#prefix] =>
                    [#suffix] =>
                    [#attributes] => Array
                        (
                            [placeholder] => Array
                                (
                                    [0] => Specify Date
                                )

                        )

                )

        )

This looks right to me, but I'm not seeing the placeholder on the front end.

I've tried flushing the cache multiple times, and loading the page without JavaScript enabled.

What am I doing wrong?


texts: Is there a way to use the views attachment as its own block? I would like to take the attachment from the "Glossary" view and output it elsewhere on my site.


texts: Customize the display of error messages from the webform module

texts:
I am embedding the webform in drupal 6 in my home page but the error messages are shown on the webform page, is there a way to customize it so that 'on unsuccessful submission it still shows error messages on my websites home page instead of the webforms page'?

Thanks.


texts: How to pass values or data from a page to a webform using webform link field?

texts:
If we have a link to a webform in a content type and we need to pass data or values to that webform from the fields available from the content type. How do we achieve this.

I'm using webform 8.x-5

I had hardly any success with 'Field Token Value' or setting default values from the available token of the webform build settings.


texts:
According to my client's requirement, I need to change the order of meta tags. The requirements are also to hide some of the meta tags.

The order requested is similar to the following one.

<Title>
<Description>
<keywords>

Is there a module to achieve this easily, do I need to edit the files of the Metatag module?


texts: Drush site-upgrade : "Unknown option: --uninstall"

texts:
I'm trying to upgrade a Drupal site from 6.34 to 7.x using Drush.
When I run drush site-upgrade @alias, everything goes well until step 12-a where it ends up throwing this error :

Unknown option: --uninstall.  See `drush help pm-disable` for available options. To suppress this error, add the option --strict=0.

I made some search about this and tried a few things :

I created a file ~/.drush/my.drushrc.php using the example code given here : http://api.drush.org/api/drush/examples%21example.drushrc.php/6.x
I then uncommented line 198 :

$options['strict'] = FALSE;

In that same drushrc file, I added this line :

$command_specific['pm-disable'] = array('strict' => 0);

This solution was proposed here : https://www.drupal.org/node/2074781

I then tried defining a drush alias in my .bash_aliases (https://drupal.stackexchange.com/a/128974/39434)

alias  drush='drush --strict=0'

Neither of these solutions helped, I always get the same error.

OS: Ubuntu 14.10
Drush : 6.2.0
PHP: 5.5.12-2ubuntu4.1 (cli)


texts: Adding fields, account registrations and editing profile

texts:
By default Drupal has a profile system in place that stores user name, password and email.

Profile2 extends this to allow specific roles upon account creation as well as more options for adding fields.

The problem is there are now two sections for adding fields, two tabs for editing account info, and no way to separate account editing into unique sections, or combine everything onto one edit page.

How can I have fields be on specific edit forms separated by how I feel they should be categorized.

Example:
On user page there is an edit tab in user menu. when clicked there is a sub menu that has inks to specific edit forms: 1. edit profile 2. security info (password, phone number)  3. photos and media 4. Address 5. personal info 6. social networks

Why I asked the question: I sat down to add fields to the users pages, such as first name, last name and zip code and was very confuse where I should create these fields and which edit form they should live, the profile2 edit form or the core edit form.


texts: Sites module: get the unprefixed, global URL

texts:
Drupal beginner here.

I'm working on a site which uses the Sites module to create location-specific URL's for all nodes. So say we have three locations: New York, London and Hong Kong. Plus Global of course. Then the Sites module prefixes each node URL with the location in order to serve up some locally relevant content in some cases, but the nodes are generally pretty much the same for all locations. So a blog post (article node) with the title The year ahead would have the global URL /blog/the-year-ahead and the location-specific URL's /newyork/blog/the-year-ahead etc.

The thing I want to do is add the global, unprefixed version of the URL as the canonical URL so search engines would not see duplicate content for a whole bunch of "different" urls. We have the Metatags module installed, so adding a default canonical metatag shouldn't be hard, but I noticed Sites inserts the prefix at a pretty early stage so using tokens in the metatag admin interface proved futile. I also tried a whole bunch of array value replacement in the various preprocess scripts, but to no avail (either no canonical meta tags would show or there would be duplicates). So I thought I would ask here before I pull out the regexp's!

EDIT: My issue is actually two-fold: 1. Get the global url, 2. Insert is as a meta tag. I have found no solutions to either.

TL; DR: For a Sites-module created URL like /newyork/blog/the-year-ahead I want the canonical meta tag to contain /blog/the-year-ahead. I have not found a good way to accomplish this.


texts: How can I get row field in hook_preprocess_views_view_unformatted(&$variables)?

texts:
Is there a way to get a field from the view in the hook_preprocess_views_view_unformatted(&$variables)?

$rows = $variables['rows'];
foreach ($rows as $id => $row) {
   // $row['field_name'] or something?
}


texts: Allow user to select which registration type on Entity Registration module

texts:
H, I am using the Entity Registration module, but I would like the user to be able to select what kind of registration type - e.g. registering as a participant, a facilitator or a resource-provider.
Is this possible? as it seems as though its only possible to enable one registration type on a registration field.


texts: How to force login before submitting webform?

texts:
Drupal 7.17, Webform 7.x-3.18 : I'm presenting a webform that anyone can fill out, but upon submit, if the user is anonymous, or not logged in/authenticated, I want to force a redirect to the login page (with a callback to the redirect of the webform). In other words, they must register or login in prior to submitting data in that webform.

So far, I've tried Rules to no avail. If (content type is Webform), and Site User Role is Anonymous, then Page Redirect to [site-url: login].

I suspect a webform relies on the Form API, but maybe forcing login at the submit handler might work (webform api?), but how do I get a callback to the form redirect within that submit handler?

I noticed Confirm Form - http://api.drupal.org/api/drupal/modules%21system%21system.module/function/confirm_form/7, but we're not confirming, it's more of a validation?

Keep in mind, I want the anonymous user to see the form, so using content access or limit visibility of form by role won't necessarily work. Thanks in advance for any advice!


texts: Drupal 7 - better navigation for Pages in custom menu

texts:
I have several custom menus that link to Pages in my Drupal 7 site.  One custom menu is called Announcements.  When I visit a Page that is linked in the Announcements menu, I would like to display in the sidebar the other links that are in the Announcements menu.  I don't want to have to create a menu block for Announcements and manually maintain a list of nodes on which to show the menu block, to make it show only on the Announcements pages.  How can I dynamically list links from the custom menu that links to the current page?

It would also be nice if...

I have a page called News Archives on which a menu block is displayed for the Announcements menu as well as some other menus.  It would be nice to have a custom breadcrumb for any Page linked in the Announcements menu like 'Home > News Archives > [the current page]'.  I have the Custom Breadcrumbs module installed, if someone can think of a way to use this for this purpose.
The Pages in a given menu don't have any pattern to their URL, or hierarchy.  Many of them are just off the root site, e.g., http://mysite.com/page_linked_in_announcements_menu.  Is there any way to dynamically change a Page's URL alias to reflect which custom menu it belongs to?  So on the edit page for a Page, the URL alias might be "blah", but it's linked in the Announcements menu, so I can access it at /announcements/blah.  Then if I moved "blah" to My Other Custom Menu, its URL would automatically become /my-other-custom-menu/blah, without me having to edit the URL alias by hand.

This is a cross-post from Stack Overflow because I didn't know how to port the question over.


texts:
I just like the way the tags work out in stack exchange communities.  The way it gets description for each tag in a dropdown and key based tagging.

How come it works?? Do we need to use jQuery???

I just want to know whether these kind of tags can be developed in Drupal 7

Is there any module in Drupal 7 to make our tags appear like the one shown in the above image.


texts:
Let's say I have the view with arguments. My path to view page is /products. The path that contains argument eg. 3 looks like this /products/3.

Now as the view is displayed without arguments and the product path is in the main menu - active class for menu item is displayed correctly, however if I add path with argument product/3 and link it in my menu then there's not active item.

How to extort Drupal to show active item?


texts:
I am trying to use \Drupal\node\Entity\Node::load($nid) to store a node object in a variable and pass the variable into drupal 8's serialization component or even symphony's serialization methods. All my efforts have resulted in a JSON object that is only encoding the first property of the node which is {"in_preview":null}.

For example the following callback returns {"in_preview":null}

public function page(){

  $nrm = new \Drupal\Component\Serialization\Json;
  $node = Node::load(2);
  $json = $nrm -> encode($node, 'json');

  return $json;

}

What class/method would accomplish serialization of $node in the above code?


texts: Can Drupal 8 Form #states API be used to expand/collapse

texts:
Given a checkbox field with two options:

"Closed" (selected by default)
"Open"

I'd like to expand or collapse the <details> container of a different field (in our specific case an Address field). In HTML terms, this means adding the open HTML5 attribute to the <details> tag and adding aria-expanded=true to the <summary> tag when the "Open" radio button value is clicked, and ensure it is removed when that radio option is not selected (which means by default at page load time as well).

I've found a few older semi-related issues and the documentation page for Drupal 8's drupal_process_states, but it's looking like this isn't possible with the Form #states API in Drupal 8. The docs do not include "open" in the list of valid states that may be applied to an element.

The valid states are:

enabled
disabled
required
optional
visible
invisible
checked
unchecked
expanded
collapsed

One would think that maybe the expanded and collapsed options could work, however this does not seem to be the case with my sample code below:

function mymodule_form_node_<type>_form_alter(&$form, FormStateInterface $form_state) {
  $form['field_address']['#states'] = [
    // Expand address field container when the Trigger field is 'Open'.
    'expanded' => [
      ':input[name="field_trigger"]' => [
        'value' => 'open'
      ],
    ],
  ];
}

Replacing 'expanded' state with 'open' in the above does not work, nor does the inverse logic using 'collapsed' state work:

function mymodule_form_node_<type>_form_alter(&$form, FormStateInterface $form_state) {
  $form['field_address']['#states'] = [
    // Collapse address field container when the Trigger field is 'Closed'.
    'collapsed' => [
      ':input[name="field_trigger"]' => [
        'value' => 'closed'
      ],
    ],
  ];
}


texts:
I have implemented breadcrumbs in Drupal 7, using the following code in mytheme.inc file. It is working fine for all the custom pages but for a particular content type lets say CT1, I have url alias setup as homepage/page2/page3/[node:title] so the breadcrumb trail display as homepage > page2 > page3 > title of content but it is only displaying as homepage > title of content. Please advise what I am missing here to make it work the way I want.

function mytheme_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    $crumbs = null;
    if (!empty($breadcrumb)) {
        $array_size = count($breadcrumb);
        $i = 0;
        while ($i < $array_size) {
            $crumbs .= '
' . $breadcrumb[$i] . '
';
            $i++;
        }
        $crumbs .= '
' . menu_get_item()['title'] . '
';
        return $crumbs;
    } else {
        return '
Homepage
';
    }
}


texts: Page visible for authenticated user, not custom role

texts:
I have a custom module that has type MENU_LOCAL_TASK with path user/%/custom-page.

The page callback is displaying a content and with custom page arguments and access arguments functions, only the author of the content can see that content. So far so good.

I have authenticated users and custom role (editor).

Now my goal is to display the MENU_LOCAL_TASK with the page callback content only for the authenticated users, not the editor.

All authenticated users are with role[3] and the Editor is with role[5].
Because of the role "Editor" is automatically authenticated user I cannot set the custom page to be visible only for the other authenticated users.

On my page.tpl.php I've managed to display links that will be visible only for authenticated user without user with role[5] (editor) with this code and its working great.

<?php
if(isset($user->roles[3])){
    //visible only for roles[3], the ordinary authenticated users
}

How can I do this with my custom module?

I didn't find an examples in hook_menu for roles.

Hook_permission() didn't helped, because when I choose the authenticated user in drupal permissions UI, automatically marks the editor role.

I'm using Drupal 7.


texts: setErrorByName not working properly if field is in #details

texts:
In a form, some fields are defined in '#details':

$form['person2'] = [
  '#type' => 'details',
  '#title' => t('Person2'),
];
$form['person2']['lastname2'] = [
  '#type' => 'textfield',
  '#title' => $this->t('Last Name'),
  '#size' => 32,
  '#default_value' => $this->store->get('lastname2') ? $this->store->get('lastname2') : '',
];
$form['person2']['firstname2'] = [
  '#type' => 'textfield',
  '#title' => $this->t('First Name'),
  '#size' => 32,
  '#default_value' => $this->store->get('firstname2') ? $this->store->get('firstname2') : '',
];
$form['person2']['email2'] = [
  '#type' => 'email',
  '#title' => $this->t('Email'),
  '#size' => 64,
  '#default_value' => $this->store->get('email2') ? $this->store->get('email2') : '',
  '#weight' => $weight,
];

In validateForm() I have some controls: if one of the fields has a value, the others should have one too.
I use setErrorByName but I can't have the faulty field highlighted in red, though the control fires as expected...
Here is the code:

  if (!$form_state->getValue('firstname2')) {
    $form_state->setErrorByName('lastname2', $this->t('This field is required.'));
  }


texts: Validate a group of fields so that form can only be submitted if 0 or 2+ fields have been completed

texts:
In Drupal 7 I need to validate several cck fields so that the node can only be saved if 0 or two or more fields have been completed. So if only one of the fields is completed validation would fail with an error message like 'Please submit two or more years worth of data, or no data at all'.

I know that I can useField Group and Field Group Multiple To set up groups of fields. I can see that Field Validation provides basic validation options, including checking that a minimum of 1 of several fields have been completed. But as far as I can see it does not have the capacity to achieve what I need it to do.

Could you please suggest how to go about forcing a user to either complete 2+ fields or none at all?

Thanks


texts: Adding custom module pages to the Solr index

texts:
We're using Drupal 6.
I have written several custom modules that generate a number of pages. All the paths are "given" to drupal using hook_menu() so the system is fully aware of how to access them.

However, if I search for something that I know is on a page I have created with one of these custom modules, it does not appear in search results. We're building a lot of content using custom modules which are pulling data out of pre-existing databases. We need these to be searchable.

How can I add these new paths and the content on these pages into the Solr index?


texts: How do I add JavaScript to the administrative area?

texts: I'd like to add some Javascript into Drupal's admin area (content creation to be specific) and was wondering what's the best approach to do it: I'm using the admin theme Rubik. Shall I just add the JS as part of the Rubik theme? Should I create a sub-theme? But its just one file...


texts: Response comes after 6 min while creating user using services module of Drupal 7?

texts: I have a client side application developed in angularJS. As i am sending POST request to Drupal to create user, user is getting created without any delay if i check in Backend. But i get response after 6minutes!. The request just goes on and on!! Any advice what i am doing wrong?


texts: How should I solve a module load order problem in a custom install profile?

texts:
I'm building a custom install profile for Drupal 8.4. It uses the new core Media module, and includes custom config files for the entity forms for media's image and file entities. One of those changes depends on the Path module being enabled.

I have both "media" and "path" listed in my install profile's dependencies.

I have the following two custom files:

docroot/profiles/custom/myprofile/core.entity_form_display.media.file.default.yml
docroot/profiles/custom/myprofile/core.entity_form_display.media.image.default.yml

And each of these form display files includes "path" among its own module dependencies. When I try to run the installer, I get the following error:

  Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by media have unmet dependencies: core.entity_form_display.media.file.default (path) in Drupal\Core\Config\UnmetDependenciesException::create() (line 98 of /Users/dicksb/Sites/devdesktop/drupal84/docroot/core/lib/Drupal/Core/Config/UnmetDependenciesException.php).

This error does not occur if I remove the two config files.

I believe the problem is simply that "media" is being enabled, and reading these config files, before "path" is enabled, because the media module itself doesn't require path. I reported this as a bug, but didn't really get anywhere; see https://www.drupal.org/project/drupal/issues/2908046.

I get that making media depend on path is not the right solution, but I'm not sure what is.

A workaround

I'm not sure if this is the best, or even a good, way to do this, but it seems to work. I've moved the troublesome configuration files from myprofile/config/install to myprofile/config/post-install. I've then added the following code to a task that runs after installation is complete:

$dir = DRUPAL_ROOT . '/profiles/custom/myprofile/config/post-install';
$files = glob($dir . '/*.yml');
$source = new \Drupal\Core\Config\FileStorage($dir);
$config_storage = \Drupal::service('config.storage');
foreach ($files as $file) {
  $components = explode(DIRECTORY_SEPARATOR, $file);
  $config_name = str_replace('.yml', '', end($components));
  $config_storage->write($config_name, $source->read($config_name));
}


texts: How to set the ordering of a taxonomy term's listing page

texts:
When you click on a tag term (or any other taxonomy term), a page is displayed listing the nodes tagged with that term. How can the nodes be displayed alphabetically?

The only module that looks like it could yield results is this one: http://drupal.org/project/taxonomy_display

But as of yet, can't get this to work as expected.


texts: field_attach_form not working as expected

texts:
I created an entity like this:

<?php
/**
* Implement hook_entity_info()
*/
function fy_teacher_entity_info()
{
    $entity['fy_teacher'] = array(
        'label' => t('teacher'),
        'controller class' => 'TeacherController',
        'base table' => 'fy_teacher',
        'uri callback' => 'fy_teacher_uri',
        'fieldable' => TRUE,
        'entity keys' => array(
            'label' => 'name',
            'id' => 'tid'
        ),
        'bundles' => array(
            'teacher' => array(
                'label' => t('teacher'),
                'admin' => array(
                    'path' => 'admin/structure/teachers',
                    'access arguments' => array('administer teachers')
                ),
            )
        ),
        'static cache' => TRUE,
        'view modes' => array(
            'full' => array(
                'label' => t('Full content'),
                'custom settings' => FALSE,
            ),
            'teaser' => array(
                'label' => t('Teaser'),
                'custom settings' => FALSE,
            ),
        ),
        'views controller class' => 'EntityDefaultViewsController',
    );
    return $entity;
}
?>

And this is the form I created to add/edit this entity.

<?php
/**
* teacher add/edit form
*/
function fy_teacher_form($form, &$form_state, $teacher)
{
    $form_state['fy_teacher'] = $teacher;
    $form['name'] = array(
        '#type' => 'textfield',
        '#title' => t('Name'),
        '#default_value' => $teacher->name,
        '#weight' => '-5',
        '#required' => TRUE
    );

    field_attach_form('fy_teacher', $teacher, $form, $form_state);
    //Save button
    $form['buttons'] = array();
    $form['buttons']['#weight'] = 100;
    $form['buttons']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Save'),
        '#submit' => array('fy_teacher_form_submit')
    );

    // Delete button if on edit page
    if ($teacher->tid) {
        $form['buttons']['delete'] = array(
            '#access' => user_access('administer teachers'),
            '#type' => 'submit',
            '#value' => t('Delete'),
            '#submit' => array('fy_teacher_form_submit_delete')
        );
    }

    $form['#validate'][] = 'fy_teacher_form_validate';
    debug($form);
    return $form;
}
?>

I can add fields in the backed (admin ui) of this entity. But somehow the fields I added there aren't showing up.


texts:
I try to add 'site gate' to http://bartenderlab.it.
It's alcohol content so people under 18 are not allowed to view this site.

I created module with hook_init:

function gate_init() {

    $curr_uri = request_uri():
    if (strpos($curr_uri, '/gate') === FALSE) {

        if (! isset($_SESSION[GATE_SESSION_NAME])) {

            if (! isset($_COOKIE[GATE_COOKIE_NAME])) {

                    if(strlen($curr_uri) > 1) {

                        drupal_goto('gate', array('destination' => substr($curr_uri, 1)));

                    }
                    drupal_goto('gate');

            } else {

                $_SESSION[GATE_SESSION_NAME] = TRUE;

            }
        }
    } else if(isset($_SESSION[GATE_SESSION_NAME])) {

        drupal_goto('<front>');

    }
}

Under /gate url is form with:

function gate_form_submit($form_id, &$form_state) {

    $post = $form_state['values'];
    $day = intval($post['gate_day']);
    $month = intval($post['gate_month']);
    $year = intval($post['gate_year']);
    $isRemember = $post['gate_remember_me'];
    if($day && $month && $year) {

        $allowed_age = (int) variable_get('gate_minimal_age', 18);
        $min_born_time = mktime(0, 0, 0, date("m"), date("d"), date("Y") - $allowed_age);
        $born_time = mktime(0, 0, 0, $month, $day, $year);

        if($min_born_time >= $born_time) {

            $_SESSION[GATE_SESSION_NAME] = TRUE;
            if($isRemember) {

                setcookie(GATE_COOKIE_NAME, sha1($born_time + srand()), time() + 60 * 60 * 24 * 7, '/');

            }
            $dst = '<front>';

            if(isset($_GET['destination'])) {

                $dst = $_GET['destination'];

            }

            drupal_goto($dst);
        }
    }
}

If checkbox for $isRemember is not checked user should only view site until browser close.

so I set:

ini_set('session.cookie_lifetime',  0);

in settings.php

But after restart browser gate page doesn't appear.

Also after user logout I am redirect to gate page instead of front page.

Please help.


texts:
I would like to change the heading of a page. I've created a menu item as node/13/something, its name is Enquiries. The page is showing the same name of the menu item as heading. I would like to show a different heading like 'This is a test' for the page instead of Enquiries. I've

tried hook_preprocess_page() with that I could only change the meta tag title.

Any suggestion is helpfulll


texts: Within bootstrap theme, print radio item with label and input as siblings instead of parent -> child

texts:
By default, Bootstrap will render the input radio and checkbox elements as children of the label.  This is done in Drupal\bootstrap\Plugin\Preprocess\FormElement, starting at line 45:

// Place single checkboxes and radios in the label field.
if (($checkbox || $radio)) {
  $label = Element::create($variables['label']);
  $children = &$label->getProperty('children', '');

In some instances, I don't want these printed as siblings - how can I undo this?  form-element.html.twig isn't helpful unless I can somehow print the children first e.g. {{ label.#children }} and then twig will know not to print them again.  Not sure if that solution is even possible.

Thanks!


texts:
Boost reacts and caches only GET requests. Does anybody know how to force it to cache POST requests too e.g. using specific key param in URL?

Or at least how to call Boost method that caches request and method that check whether this page exists in cache?

Update :

Answer below is good and marked it as an answer but i decided that i am not so familiar with Boost and Drupal to go so deep so now i am using Boost for cashing GET requests and my own module to cache POSTs. Boost works faster because it uses redirects within HTACCESS but it requires additional setup. Even though method below is a little slower it allowed me to change execution of my AJAX from 5 seconds to 900 ms in average.

My module :

It maybe absolutely wrong so do not think that this is a recommendation, just keep in mind that this is easy enough even without Boost.

// I am caching AJAX POST requests and thus separate these actions by URL params

function customactions_init() {

    $template = null;
    $cache = isset($_REQUEST['cache']);

    if ($cache) {

        switch (true) {
            case isset($_REQUEST['views']) : $template = json_encode((array) $_REQUEST['views']); break;
            case isset($_REQUEST['nodes']) : $template = json_encode((array) $_REQUEST['nodes']); break;
            case isset($_REQUEST['loaders']) : $template = json_encode((array) $_REQUEST['loaders']); break;
        }

        $cache = DRUPAL_ROOT . '/sites/cache/' . md5($template);

        // if file cache was found - use it and stop everything else

        if (is_file($cache)) {
            die(file_get_contents($cache));
        }
    }
}

// Define some static path - can be moved somewhere to config

function customactions_get_directory() {
    return DRUPAL_ROOT . '/sites/cache/';
}

// Returns path to cached content that was built based on URL params

function customactions_get_key($params) {
    return customactions_get_directory() . md5(json_encode((array) $params));
}

// Clear cache when some node changes

function customactions_node_presave($node) {
    @array_map('unlink', glob(customactions_get_directory() . '*'));
}

Any template file, e.g. page.tpl.php :

<?php

    $nodes = array();
    $ids = array_unique((array) $_REQUEST['nodes']); // Get node IDs from AJAX

    foreach ($ids as $k => $v) {
        $nodes[$v] = drupal_render(node_view(node_load($v))); // Create nodes
    }

    ob_start(); // Start buffering output
?>

    <?php print sonifi_render(sonifi_device() . '/header.php') ?>

        <?php print implode('', $nodes) ?>

    <?php print views_embed_view('footer', 'default'); ?>

<?php

    $output = ob_get_clean(); // Closing buffer

    // If module and its function are enabled then create cache file

    if (function_exists('customactions_get_key')) {
        file_put_contents(customactions_get_key($_REQUEST['nodes']), $output);
    }

    print $output; // otherwise show content as usual
?>


texts:
Question:
How can I access a taxonomy's description in the "Rules" module? When I create a new taxonomy entity I can only set the name of the term, I'd like to also add the term's description.

Goal (in case I'm doing this entirely wrong!):
Anonymous submission of new taxonomy terms with a description, for approval by a role. When node type of "new term" is approved, it copes it to a taxonomy vocabulary and then deletes the original node.


texts: How to disable modules using config split?

texts:
I have created different split for each environement (local, dev, test, prod) using the Configuration Split module. How can manage modules (enable/disable) in each environment?

Should I keep core.extensions.yml in each split and remove the module to be uninstalled from the list?


texts: Looking for either "Date Field Popup Widget (Views Filtering)" or "Date Field Reference (with Popup widget)"

texts:
I've been looking for quite a while, but I can't seem to find a solution in Drupal 7.

Anyone know a module or a method of filtering a date field popup widget, to only allow dates to be selected based on a views filter in the node creation form?

Or a way to reference another date field (possibly via Entity reference) that allows me to still use the date popup widget?

Any help would be much appreciated. Thank you.


texts: The following SSH command responded with a non-zero exit status (drupal-vm)

texts:
My environment:

Vagrant 2.2.4
VirtualBox 6.0.6r130049
ansible 2.7.10
config file = None

Mac OS Mojave (10.14.4)

I use drupal-vm to build my local development environment.

I cloned this repo and run vagrant up. After first time vagrant up everything was fine and Drupal was installed correctly. Then I did vagrant halt, to stop my VM.

After I do vagrant up again I get this error:

==> drupalvm: [vagrant-hostsupdater] This operation requires administrative access. You may skip it by manually adding equivalent entries to the hosts file.
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

 setup

Stdout from the command:

Stderr from the command:

bash: line 5: setup: command not found

What do I have to do and what's wrong?


texts:
I want to know which Drupal version I am currently using, and when it was updated.

There is a global VERSION that returns the current version. Is there a way to get how Drupal was updated?


texts:
I need a similar module as hierarchical select to display taxonomy tree in my view because hierarchical select to drupal 7 doesn't work with views module.

Please help me !


texts: How can I change the value of a field in Entity B based on the value of a field in Entity A?

texts:
I need a bit of help with Rules. I'm trying to create a rule that if a check box is checked on one entity, change the value of another checkbox on another entity. I have the conditions "Entity has field - Checkbox A" + "Data Comparison Checkbox A, value = Checked". But for the Action, I don't know how to set the value of Checkbox B on the other entity.

More detail: it's for a hotel booking site. I have an entity for the booking and an entity for the room itself. I want it so that when the "Checked-out" box is selected in the booking entity, the "Needs Cleaning" box in the room entity is checked. The two entities are linked by the room_ID number.


texts: How can I display the results of webform submission in a block and place it on front page?

texts:
So I'm using the Webform module to collect data, and I want to display the results in a Drupal block and place it in an appropriate theme region in my site.

Like for example the following: I want to display the analysis with the charts  of my result (created with the Charts module) in the front page of my site.

Is that doable?


texts: How can I show a single block only if the user is on iOS?

texts:
I have a Picture content type that allows users to upload picture files, something that iOS does not support.  Since Apple in 2012 can't support something my first computer running Netscape Navigator was able to do in the early 1990s, I'd like to give a message to iOS users that they will have to e-mail me the photos instead.

I installed the Browscap module but it only detects the user agent; it doesn't do anything by itself.  On Drupal 6 I used Mobile Tools, but it has yet to see a stable release for D7.

I only want to show a single block on a single content type to iOS users, so I'm looking for the simplest possible solution.


texts:
I'm building a module with several blocks. But only one is showing up in blocks list.
Calendar shows up in block list but could you see why I cant see my 'frontdoor' block ?

function businesshours_block_info() {
    $blocks['calendar'] = array (
        'info' => t('Little calendar'),
        'status' => true,
        'visibility' => 1,
        );
    $blocks['frontdoor'] = array (
        'info' => t('The Front Door'),
        'status' => FALSE,
        'visibility' => 0,
        );
    return $blocks;
}
function businesshours_block_view($delta) {
    $block = array();
    switch ($delta) {
        case 'calendar':
            $block['content'] = businesshours_block_contents($delta);
            $block['subject'] = t('toto');
            return $block;
            break;
        case 'frontdoor':
            $block['content'] = businesshours_block_contents($delta);
            $block['subject'] = t('front');
            break;
    }
    return $block;

}
function businesshours_block_contents($delta) {
    switch ($delta) {
        case 'calendar':
            return array('#markup' => '
' . _build_calendar() . '
');
            break;
        case 'frontdoor':
            return array('#markup' => '
' . _build_frontdoor() . '
');
            break;
    }
}

Thx in advance.


texts: Views : Output the field as link - not showing the field properties properly

texts:
I want to output an image field as a link in views. I've seen many tutorials but get stuck at one point.

I already added the link on top of the image field. By clicking on the image at rewrite results I could check "output this field as a link" - but checking will not give me the fields properties where I could fill in the link field details - as shown in the below screenshot

Do you know what I'm missing?

Here's a picture of it.


texts:
I have made my custom block content. I created a block with it and I assigned it to a region.

How can I export the actual block content not the block type?


texts: Views REST Endpoint With paragraph field

texts:
I've created a REST export view to get a paragraph field in a JSON format but I cannot get the result properly, so I used Rest Views module but I got the results including something like these characters \u003Ca href=\u0022\/colors\/gray-metallic\u0022 hreflang=\u0022en\u0022\u003EGray Metallic\u003C\/a\u003E

Also, this paragraph field includes a term reference field.

So I want to render the data properly without these characters and as a plain text


texts: On logout as admin, PHP code from node pages is executed.

texts:
When I log out from site as Admin, PHP code in the node pages is being executed.
For testing, I had put node access rebuild function in one of pages and the site went slow after that. When I checked in the xdebug profiler scripts, I came across this eval() call.
Is it the default functionality or is it some of my code that has affected this?


texts: Default theme css wrongly included in another theme

texts:
I have 2 themes enabled on a Drupal 7 installation. The have one css file each included in their .info files:

sites/all/themes/themeA/css/screen.css
sites/all/themes/themeB/css/screen.css

The default themeA is the default theme. Using hook_custom_theme, I'm setting the theme to themeB for a certain section of the website based on path. The theme changes successfully and the page renders using themeB when it should.

There is something strange that happens though and the css file from themeA loads as well, breaking parts of the page.

I am checking in hook_css_alter in themeB and there is no mention of themeA/css/screen.css. I am checking in hook_css_alter in themeA and it is never executed.

I have solved this by removing the file from themeA.info and adding it in themeA_css_alter(). I would prefer though and it would be interesting as well to find out why this happens, so that I can put back the the file inclusion where it should normally be.

Any insights?


texts: How to find the src for an uploaded file?

texts:
I'm working on a simple module to create a field formatter that uses FlowPlayer to display videos.

My problem is that I need the src path to my uploaded video as a variable in my .tpl.php file.

Using hook_field_formatter_view() I can get the file's fid, filename, and uri but I don't know of a good way to turn that into an src value.

My video is at:

drupal/sites/default/files/MY_VIDEO_NAME.mp4

My .tpl.php file is at:

drupal/sites/default/modules/custom/flowplayer/flowplayer_video.tpl.php

I could just hard code the path and then just use the file name (../../../files/$filename) but that seems like a bit of a hack and it would break as soon as I started moving files around. I've spent several hours now, hunting around, and I think I'm missing something obvious.

Thanks


texts: I am adding a contrib module to a project and I would like the module enabling to happen automatically on deployment. My deployment script pulls the code and runs a config update via drush config-import. What would the YML be to enable the module in the codebase on config update?


texts:
I've enabled the Custom Breadcrumbs module and given the administator (me) rights to create custom breadcrumbs.
I am seeing this message on nodes, where it should allow me to set the custom breadcrumb:

Custom breadcrumbs have not been created for this test_content_type page. Use the Custom Breadcrumbs Administration Page to create a breadcrumb.

Going to this page the settings are as follows:
Show only custom_breadcrumbs where

Type is node

Where I see:
Namesort descending Breadcrumb Type Operations
No custom breadcrumbs have been defined.

What am I missing?


texts: Which SELinux setting prevents module upload via Admin interface?

texts: Just wondering if anyone knows which SELinux boolean(s) is/are blocking the installation of new modules via the admin (FTP) upload interface. I have VSFTPD installed, and can upload via FTP client. I just wanted to know for future reference. If I use "setenforce 0", it works fine.


texts:
I have a new module I made called kameleon_create_report, and I want to add a menu item to Reports. So I created my .module

<?php
function create_report() {
    print "test";
}

function kameleon_create_report_menu() {
    $items['admin/reports/orderreport'] = array(
        'title' => 'Order Report',
        'page callback' => 'create_report',
        'weight' => 1,
        'type' => MENU_LOCAL_TASK
      );
}
?>

And the info

; $Id$
name = Create Report
description = Report generator for orders
core = 6.x

But it's not showing up, even after a refresh.


texts: How to query Nodes by a referenced Term Value (via EntityFieldQuery)?

texts:
I have to query my content types (firm_unit) based on different fields conditions, and for that I came to use EntityFieldQuery.

$query = new EntityFieldQuery;

$query
  ->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', $type = 'firm_unit')
  ->propertyCondition('status', 1);

This is nice when I want to query conditions on direct content fields, like these:

$query->fieldCondition('field_name', 'value', $keyword, 'CONTAINS');
$query->fieldCondition('field_sector', 'value', $sector, '=');

It seems to be unable to directly access, and then query by, referenced contents, like names/titles and fields of referenced terms (it just can access their tids).

Which is then the way I may query my node contents based on term referenced values?

Should I query the tid before (is the _taxonomy_get_tid_from_term  func the proper to use?), and then query the content like this?

$my_tid = _taxonomy_get_tid_from_term ($term_to_match);<br/>
$query->fieldCondition('term_fieldname', 'tid', $my_tid);


texts: How to add call a js file in custom module that are added in libraries folder in drupal 7?

texts:
I am creating a custom module in drupal 7 and adding a js file in sites/all/libraries folder but its not working.Please check my code

function mymodule_library(){
$libraries['mymodule'] = array(
    'title' => 'My custom',
    'website' => 'http://www.test.com/test',
    'version' => '1.7.14',
    'js' => array(
      'sites/all/libraries/mymod/custom.js' => array(),
    ),
);
return $libraries;

}


texts: How to use tokens as watermark on images

texts:
I need to create a watermark on images in my website. The watermark should contain a text which consists of the node ID and its author ID.

So for every image a unique watermark is created. How can I do that?

I tried the following modules so far but I am not sure if they can do what I need:

Imagecache Actions
ImageMagick
textimage
IMCE Watermark
Media watermark


texts: Using Static Variables in a Custom Module

texts:
I'm trying to define a static variable for use in my custom module. I want it to let me pass a number from function to function. I'm using drupal_static() but I can't get it to work. How do I do this?

This is the code I'm using to define my static variable.

$var = &drupal_static(__FUNCTION__);
if (!isset($var)) {
  // generate contents of static variable
  $var = '8';
}
return $var;

I've tried putting it in a custom module.

 function viewusercontact_locateuser($value, $key, &$counter) {
   global $user;

   /**********In here***********/

   if ($value['uid'] == $user->uid) {
      ........
   }
}

I can't seem to get it to work. What am I doing wrong?

(I got my code from the following guides)

https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_static/7
http://www.lullabot.com/blog/article/beginners-guide-caching-data-drupal-7
http://erikwebb.net/blog/drupal-design-patterns/static


texts: Redirecting user links to their profile2 pages

texts: I'm using the profiles2 module for my user profiles.  I want to keep the user accounts hidden, and instead, use the profiles for public viewing.  I disabled user pictures in users, and added an image field to the profile entity.  When users post comments, the links point back to the user account.  How can I change that behavior so links point back to that user's profile page?  Also, how can I display the profile pics for these comments?  Essentially, I'm wanting the normal user functionality to occur with profiles instead of users.


texts: Add '?' and '=' characters to query string

texts:
I'm trying to pass '?' and '=' symbols to a page using routing.yml

company.calc:
  path: '/form?company={nid}'
  defaults:
    _controller: FrameworkBundle:Redirect:redirect
    _title: 'Calc'
 requirements:
   _permission: 'access content'

but the symbols are transcoded to HTML-entities. It looks like form%3Fcompany%3D%3Fcompany%3D18141 and leads to page 404.

Any ideas how to pass the string like

/form?company=1234

? This string is necessary to prepopulate the form's field.

Find the same question here but no reply, no solution :(.


texts:
I want to use a new variable in a view using global PHP. Between the available variables, I have $row->my_field, and I want to put its value in a new variable.

$new = $row->my_field;
echo $new

I'm using this code in Output Code. I get the following error:

  Syntax error, unexpected 'echo' (T_ECHO) ...

I cannot even use array_unique().

Is it possible to add a new variable? and Is it possible to use a function like array_unique()?


texts: I don't know why, but I can't find a straight answer to this anywhere. I have a site that was by the vulnerability patched by SA-CORE-2014-005. I went into the database and deleted the user and applied the update via ftp, but I still can't log in. /user gives me a 403. How do I fix this?


texts:
I am following instructions at https://www.drupal.org/node/2366283 to install Drush at bluehost.com using PuTTY. I'm stuck at the install composer step. I tried the curl -sS https://getcomposer.org/installer | php command and got 500 Internal Server Error. Support at bluehost was useless.

I tried wget https://getcomposer.org/installer | php and got the following messages.

--2015-10-27 10:00:40--  https://getcomposer.org/installer
Resolving getcomposer.org... 87.98.253.108, 2001:41d0:a:7b19::1
Connecting to getcomposer.org|87.98.253.108|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 275841 (269K) [application/octet-stream]
Saving to: `installer'

100%[======================================>] 275,841      344K/s   in 0.8s

2015-10-27 10:00:42 (344 KB/s) - `installer' saved [275841/275841]

Content-type: text/html

I then went to the next step and typed mv composer.phar bin/composer.phar

I got the following.
mv: cannot stat `composer.phar': No such file or directory

What does this mean? How can I fix this?


texts: listing users filtered by whether they have posted content or not

texts:
I've been fiddling with the filters in views but none of the filters seem to work on if they posted content or not.

Is custom code necessary for this?


texts: In Webform 8 - can you omit the fieldset label in a confirmation email?

texts:
In Webform 8x I would like the email sent with the webform_submission_values to not include the fieldset labels.

What would be the way to achieve this?

Alternatively, is there a way to not send the Page label in the email?

What is happening is that the page label and fieldset label are the same so in the confirmation email it is coming up twice.


texts: Main page teaser with module paragraphs?

texts:
The paragraphs module is the only module I know which would enable me to create flexible content with floating inline images without using a WYSIWYG editor. I use the beta4 paragraphs version in connection with the Garland theme.

I was able to setup certain paragraph bundles and also a content type where it is possible to add up paragraphs to different type (e.g. text only, text with image etc.)
See example below:

However, I failed totally to configure a teaser view which makes sense. The reason: I cannot control the number of paragraph bundles to be shown in the teaser view as ist can be seen here:

In my test site the number fields next to the Fomat field in the above picture is missing. So I can only show the total article or nothing as teaser. How can I fix this?


texts: Content Types and the db tables they create

texts:
I'm creating an application where I want a content type with quite a few extra fields.
When I try and retrieve this type programatically the DB is showing that each of the extra fields are stored in their own table. This is fine I guess but will mean my queries/views will be quite long and any changes to the fields via the admin console will require a bit of back end work.

Is this just a price I have to pay or is there another option?
If possible I want to be able to administer the fields as normal (changing their names say and maybe adding new ones) and not have this affect my code too much - so in essence I want my cake and eat it!

As always, thanks again...

(drupal-7.14 Lamp)


texts: db_affected_rows in Drupal 7 for db_query

texts:
I just noticed that @Berdir was so nice to remove db_affected_rows from Drupal 7. I'm now wondering what the best practice is now to detect if the query you ran changed anything in the database.

A typical usecase would be to.

db_query(...);
if (!db_affected_rows()) {
  db_query(...);
}

I took a look at the query object returned from db_query, but it didn't seem like much help.

Update:
I see I was a bit unclear as to what circumstances I needed the info.

My current use case, is a quite simple one. I have a table for a node type with a nid column and some data columns. I have a form an upon submitting the form, I want to either insert or update the row in the db.

The problem with db_update/db_insert is that, if I use update first, and insert if update returns 0, I wont catch the condition, where the form was submitted with the value in the db. If I use db_insert first, that will raise en error if there already is a row in the db.

I suppose I in this specific condition could insert a blank value when the node is created and then only use update, but for some cases that might not be possible, if I needed to store info that was keyed to an external database. I would also like to avoid having to depend on database values for my code to function.

My usual strategy for such cases, has been to do a

db_query("INSERT IGNORE INTO ...")
if (!db_affected_rows()) {
  db_query("UPDATE ...");
}

Doing this is both simple and error free no matter what condition the db is in. The best option I can see right now, would be to handle it with SQL and do this:

db_query("INSERT ... ON DUPLICATE KEY UPDATE");

But I was hoping that the db API would be able to handle this.


texts:
So I am looking to fetch child page of current node for eg

Birds
 - Great Blue Heron
 - Wood Duck
 - Willet
Fish
 - Bass
 - Catfish
 - Tilapia

When I am on Bird page I would like to show
 - Great Blue Heron
 - Wood Duck
 - Willet

When I am Willet as Willet have no child pages it should show parent page and if do have child pages it should show its child pages

Is it possible to do it automatically like Admin creates a page he doesnt need to go to menu and add it himself to the menu , I tried https://www.drupal.org/project/menu_block seems like there are 2 steps involved

Create Page
Than Add to Menu

I want to get Node id and automatically fetch its child and sub-child pages


texts:
Drupal 8, two versions of a site - dev and production.

How to move changes, especially changes in content from dev to production without destroying DB on production?

I know we have Features for configuration, but what about content?

Ideally, I would like to be able to add nodes, pages and edit existing ones, and then carry changes to the prod site, without destroying changes users created on the dev site - comments, new registrations and such.

What's the solution here? Export content to code?

Can someone give step-by-step on dev cycle?


texts:
I have a url structured as such:

http://www.example.com/blog/unimportant-term/taxonomy-term

(is it a term or alias when the - dash has been added?)

I need to filter my result set based on the taxonomy term, and I don't know how to set that up in my view arguments.

Basically my view is getting all my blog posts, and depending on if there's a taxonomy term present, it will use that argument to filter the posts.


texts:
I'm writing a custom installation profile, and most things work, except that I can't get it to change the site name.

function myprofile_install() {
  include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
    standard_install();

    // ...

    variable_set('site_name', st('My Site Name'));

    // ...
}

the variable_set has no effect. So I tried adding

$GLOBALS['config']['site_name'] = "My Site Name";

at the end of the function to see if it got a different result, but it did not. Other parts of my profile work, so I know it's running. Other profiles seem to be able to use variable_set in their hook_install, so I don't think it's forbidden. Is there something else that I need to do to get the variables to "take"?

This question seems to indicate that I am doing it correctly, as do this one and this one. I've re-checed the RTFM and sample profiles to see if there's a step I'm missing, but if there is, I can't find it. The title of this question looked promising, but it turned out to be an unrelated issue.

If I add an echo statement inside of myprofile_install it indicates that the value has been set properly (and that the myprofile_install function is being read all the way through), but when I log into the site, it has the default 'site-install' name.

I am building the site via a drush command, not via the gui:

drush -y si myprofile --db-url=mysql://###:###@localhost:8080/mysite username=### pass=### dbname=###

In response to @clive's comment (thanks!), I neglected to mention that I also have

function myprofile_form_install_configure_form_alter(&$form, $form_state) {
    if (!function_exists("system_form_install_configure_form_alter")) {
        function system_form_install_configure_form_alter(&$form, $form_state) {
            $form['site_information']['site_name']['#default_value'] = 'mysite';
        }
    }
 }

in the .profile file. I assumed this code wasn't being called at all, since I wasn't using the gui form. But if the form were invisibly clobbering the values I set in the .install file, it seems like it would be setting it to mysite rather than to site-install?


texts: Remotes: Can a local Drush 8 be used to send commands to a remote Drupal 8.4 site which includes Drush 9?

texts:
Let's say we have a dev-ops administrator who isn't a developer and doesn't want or (normally) need a local copy of the website.

As of Drupal 8.4, Drush 9 is required, and Drush 9 doesn't have a way to install it globally. But Drush 8 still does.

So the question is, can someone use Drush 8 locally with aliases for a remote Drupal >8.4 site with Drush 9 as a dependency?

If not, then, is there another way someone can use a local Drush 9 without building the entire site?

What's the best practice for someone who needs to run Drush locally to control remote sites in the Drush 9 world, where "someone" means someone who isn't working on a local copy of the site?


texts: Overriding Page Title with Contextual Links

texts:
View Path:  team/member/%
Contextual Input:  Numeric User ID, single variable

The purpose of my view is to 1) use Views Responsive Grid to layout the page appropriately, which I have done, and 2) leverage the power of views to include future content / fields / etc.  After I finished building everything and themed it the way I wanted, I found that the page title was blank.

My question:  Is there a way to override the page title before the HTML is processed for this Views path?  Ideally, I would like the title to be:  "[first name] [last name] | Site Name"  The user's separated first and last names are available as fields.

I appreciate everyone's help with this! (view the bottom image in a new tab, it's pretty wide)


texts: Users can't use a name in comments that is equal to the username of a registred user

texts:
I have a Drupal 7.7 installation for which I'm activating comments using the standard Comments module. Everything works just fine except for a annoying quirk.

The admin username is "Christoffer", and for some reason anonymous users can not use the name "Christoffer" for their comments. If I add an additional character or change the spelling it works but it seems that an anonymous user cannot have the same name as a registred user. Can I allow it somehow?

Thanks


texts: Field definition in custom field and varchar_ascii

texts:
When making custom field and doing field definitions for string I came upon this setting.

  'type' => $field_definition->getSetting('is_ascii') === TRUE ? 'varchar_ascii' : 'varchar',

I just cant find a reference what would it be if a field definition is set to "varchar_ascii" is it something to do with "Collation" ?


texts:
I am very new to Drupal programming and I am now trying to take my first steps there. I want to start off with the very basics such as iterate thought the items of a node and print them.

Based on this node object reference I have something like this in my code

$value = $node->title;
dpm($value , $name = "Node's title");

but how would I iterate though the node's fields. Here's an example of some fields printed from devel

  field_event (Array, 1 element)

0 (Array, 5 elements)
    value (String, 19 characters ) 2012-03-17 08:00:00
    value2 (String, 19 characters ) 2012-03-18 15:00:00
    timezone (String, 13 characters ) Europe/Athens
    timezone_db (String, 3 characters ) UTC
    date_type (String, 8 characters ) datetime

  field_city (Array, 1 element)

0 (Array, 2 elements)
    tid (String, 1 characters ) 1
    taxonomy_term (Object) stdClass
        tid (String, 1 characters ) 1
        vid (String, 1 characters ) 2
        name (String, 10 characters ) London
        description (String, 0 characters )
        format (String, 13 characters ) filtered_html
        weight (String, 1 characters ) 0
        vocabulary_machine_name (String, 4 characters ) city
        rdf_mapping (Array, 5 elements)

The first one is a date object and the second one is a taxonomy object. How would I access their data? Let's say I want the value2 for the date field and the name of the taxonomy term. Is this how you would go grab them?

$value = $node->field_event[0]->value2;
$value = $node->field_city[0]->taxonomy_term->name;

I am pretty confused on how you iterate though this maze of objects and arrays. Any simple explanations with examples?


texts: Adding a wrapper to contain tables using grouping field in views / display suite

texts:
I'm using a table to display fields data in views 3. Within this i've got a field selected to group these items which produces a heading and then a table for each group. All good up to this point.
The issue i'm trying to solve is a way to manipulate all these tables - so i'd like to add a container, with an id to style accordingly.
I'm able to access the wrapper for the whole via https://api.drupal.org/api/views/theme%21views-view.tpl.php/7
and the template for the table which in my instance is views-bootstrap-table-plugin-style.tpl.php (which allows me to markup for each table)
What i'm looking is where the loop occurs for the grouped field so i can put a wrapper round the loop. Any suggestions?

EDIT: here is a grab of my view https://www.dropbox.com/s/a2mb85m1lo2oxr4/views-display.png
The region i am trying to wrap is below the exposed filters form.
I am using Display Suite > Views Displays to layout the view with exposed filters and views content in the left column and the map as an attachment in the right column.

EDIT: removing the view having its template defined via DS Views has given a result with markup with a .view-content wrapper around the tables (which is good) but isn't entirely helpful as i still need to split the view into two columns (which is why i was using DS).

https://www.dropbox.com/s/7aukgjkkux2xycs/views-display-no-ds.png

Whilst creating a custom template to do this by modifying an existing DS template and making a region specifically for my grouped table seems the quickest way to solve this, it certainly seems a bit messy as this will need to be done for every time i set to use grouped fields.


texts: How can I get an empty region not to render in a field_layout template?

texts:
I've got a layout_discovery template set up like this, for use in a field layout:

{% if content %}

    {{ content.main }}

  {% if content.sidebar %}

    {{ content.sidebar }}

  {% endif %}

{% endif %}

(I have also tried {% if content.sidebar|trim|length > 0 %} with no change in the result.)

A content type using this layout puts a single, optional field into the sidebar region. If that field is empty, I would expect content.sidebar to be empty, so that the sidebar div won't be output and the main div can expand to fill the space. However, instead I get an empty sidebar div:

Is there any way to accomplish this in a field layout, or do I need to build a custom node template instead?


texts:
I have a website that is generating /category pages and /taxonomy archive type pages, with a list of posts containing a certain taxonomy term.  I do not have a template for this page and they seem unnecessary/duplicate content.  Is there any way to prevent them from being created?

category/region/all/boston?page=2&region=DEFAULT
/taxonomy/term/14/”?page=19&region=DEFAULT

link to one of these pages
http://nyc.thedelimagazine.com/taxonomy/term/14/%E2%80%9D?page=19&region=DEFAULT


texts:
The advanced forum module has search implemented using a block. It works decently, however, when searching, it doesn't highlight the matched terms with some context, it just lists the matching threads.

Is there any way to modify it so that the actual matched text is displayed?


texts: How to select a view inside a custom module form

texts:
I would like to have "select" with some views so I can chosse one of them and the submit the selection to display the result. something like this:

And this is close to what I want :

  $form['title'] = array(
'#type' => 'select',
'#title' => t('Display amount'),
//'#required' => TRUE,
'#options' => drupal_map_assoc(array('1','2', '3', '4', '5', '6', '7', '8')),
'#default_value' => 5,
'#ajax' => array(
    'callback' => 'form_ajax_submit',
    'wrapper' => 'contenido-div',
    'method' => 'replace',
    'effect' => 'fade',
   ),
    );

 $form['content'] = array(
'#type' => 'select',
'#title' => t('Content'),
'#options' => array(node_type_get_names()),
'#ajax' => array(
    'callback' => 'form_ajax_submit',
    'wrapper' => 'contenido-div',
    'method' => 'replace',
    'effect' => 'fade',
),
);

$form['views'] = array(
'#type' => 'select',
'#title' => t('views'),
'#options' => array(),
'#ajax' => array(
    'callback' => 'form_ajax_submit',
    'wrapper' => 'contenido-div',
    'method' => 'replace',
    'effect' => 'fade',
 ),
);

Thanks


texts: How can I speed up the module registry approval proces on Drupal.org?

texts:
The module is done, the code and documentation meets the prescribed standards for Drupal projects, the sandbox project has been created and submitted for review. What more can be done to help speed the review process for a contributors first module?

I don't actually have a module in this position, but recently met a developer who was trying to get a module approved that integrated his new CAPTCHA service into Drupal. Hopefully someone has reviewed and approved it, but you can take a look at the application here to see how the approval process can stagnate.


texts: form_submit() and form_validate() doesn't work for tableselect

texts:
I'm trying to create sort of slider that slides the user selected blocks. to do so I need to list all of the blocks and let the user to select them, I used tableselect. this is my MODULE.module

function deckslider_permission() {
return array(
        'administer deckslider' => array(
                'title' => t('Administer deckslider module'),
                'description' => t('Perform administration tasks for Trails module.'),
        ),
);
}

function deckslider_menu() {
$items['admin/config/deckslider'] = array(
        'title' => 'Deck Slider',
        'description' => 'deckslider configuration',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('deckslider_admin_settings'),
        'access arguments' => array('administer deckslider'),
        'file' => 'deckslider.admin.inc',
        'file path' => drupal_get_path('module', 'deckslider'),
);
return $items;
}

function select_blocks_submit(&$form, &$form_state, $form_id) {
dsm("Hello");
print "Hello";
}

function deckslider_form_select_blocks_alter(){
    $form['#submit'][]='my_submit';
}

function my_submit(){
    dsm("Hello");
    print "d";
}

and it is deckslider.admin.inc:

function deckslider_admin_settings() {
    global $theme;
    $blocks = _block_rehash($theme);
    $header = array(
        'title' => t('Block'),
    );

    $options = array();
    for ($i = 0 ; $i < count($blocks) ; $i++){
        $options[] = array('title' => t($blocks[$i]['info']));
    }

    $form['select_blocks'] = array(
        '#type' => "tableselect",
        '#header' => $header,
        '#options' => $options,
        '#multiple' => TRUE,
    );
    return system_settings_form($form);
}

The problem is the form has a default save configuration button and I can't trigger any function for its submission. this is the output


texts:
Use Case: I have two differnent Content Types, A and B, each with a taxonomy fields 'State'.

Content Type A has two nodes, with California and South Dakota selected.

Content Type B has two nodes, with Alabama selected in both nodes.

The requirement is to created a tabular View that would look like this:

So within the Views interface, how do I create this?

http://filedb.experts-exchange.com/incoming/2015/04_w17/909525/view.jpg