texts: Unable to send email local configuration problem

texts:
I'm getting strange email errors on User Registration, when a user creates an account on my website, it emails them a link to activate their account, however, its started showing errors at the top of the email as shown below. I had everything working fine, emails going out, now i get these errors and Im not sure what I have changed to cause this. I did install the Honeypot module and Captua module last night (also have User Registration Password), but Im sure I tested afterwards and it was working fine. Any ideas? I have changed the email addresses below to make them anonymous.

On 8 Feb 2016, at 13:23, Mail Delivery System  wrote:

A message that you sent was rejected by the local scanning code that checks incoming messages on this system. The following error was given:

local configuration problem

------ This is a copy of your message, including all the headers. ------

Received: from 707134 by linweb.ahost.me with local (Exim 4.80.1)
   (envelope-from )
   id 1aSlmr-0003aW-L4
   for yyy@gmail.com; Mon, 08 Feb 2016 13:23:29 +0000
To: yyy@gmail.com
Subject: Account details for testuser at zzz Club
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8Bit
X-Mailer: Drupal
Sender: xxx@icloud.com
From: xxx@icloud.com
Message-Id:
Date: Mon, 08 Feb 2016 13:23:29 +0000

testuser,

Thank you for registering at zzz Club. You may now log in and
verify your account by …..


texts:
small question

I've created a content type 'Player' with the necessary fields. With the 'Inline Entity Form' module i've added this tot the default user registration form.

Now when a user register, he immediately creates a node for the content type 'Player'. And when he edit his user profile, he also edit the node.

Now I want to have the option, that a user can choose to register as a player or a coach. When a coach register, he should fill in other fields, and so create a node for the content type 'Coach' .

With which modules can I realize this?


texts: Selection of Nodes Based on Taxonomy Terms Percentages

texts: I am developing a huge Questions bank, where teachers submit questions,which actually are nodes,and the topic subjects are taxonomies..NOw at the end of the term, teachers generate question papers of 100 questions each, but based on percentages of topics,say if it mathematics paper, so 30 percent questions from algebra(a taxonomy term) 20% from SETS( Taxonomy terms)....so how can i get this done?i am currently using database level custom procedure, but it is hardly being maintained...any suggestions plz


texts:
I am getting this Error

Warning: Cannot modify header information - headers already sent by
(output started at
/home/aigair1/public_html/site1/sites/default/settings.php:1) in
drupal_send_headers() (line 1236 of
/home/aigair1/public_html/site1/includes/bootstrap.inc).
Warning:
Cannot modify header information - headers already sent by (output
started at
/home/aigair1/public_html/site1/sites/default/settings.php:1) in
drupal_send_headers() (line 1236 of
/home/aigair1/public_html/site1/includes/bootstrap.inc).
Warning:
Cannot modify header information - headers already sent by (output
started at
/home/aigair1/public_html/site1/sites/default/settings.php:1) in
drupal_send_headers() (line 1236 of
/home/aigair1/public_html/site1/includes/bootstrap.inc).
Warning:
Cannot modify header information - headers already sent by (output
started at
/home/aigair1/public_html/site1/sites/default/settings.php:1) in
drupal_send_headers() (line 1236 of
/home/aigair1/public_html/site1/includes/bootstrap.inc).

I don't get this when my website in Localhost(Xampp), But When I upload site to web I get this. What's problem ?
Here is the Setting.php file as txt


texts: How can I conditionally create a user account based on field in registration?

texts:
Here is the scenario:
Prospective employees (PE) who need to access this Drupal site for onboarding resources will be sent an access code from someone in HR (to prevent random people from creating accounts).
The PE goes to Drupal site and "registers" for a user account and they enter the access code into a field.
Only approve the account if the access code is correct. If it is correct, approve account and set role to prospect. If it is not correct, block account (until that user registers with correct access code or alternately, someone in HR manually approves it).
What should the account settings be for who can register account? How to test access value and approve/grant role or block based on registration field? Is there a hook or class to extend?


texts:
I need to list nodes both in the main site navigation and within a section side navigation. Is it possible to target a specific menu for the Pathauto module to reference?

This is an example of the two menu structure.

Main Nav:
- Home
-- Page A
--- Page A Child 1
--- Page A Child 2
-- Page B

Page A Side Nav:
- Page A Child 1
- Page A Child 2

This results in Page A Child 1 and  Page A Child 2 having /Page-A-Child-1 and /Page-A-Child-2 as respective paths.

What I want is for both menus to have /Page-A/Page-A-Child-1 and /Page-A/Page-A-Child-2 as paths.

The pattern I'm using is [node:menu-link:parents:join-path]/[node:title].


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

texts:
I have Drupal 7.43 installed on my hosting account, and I am using phpmailer to send all emails. It is giving the following error:

  Type phpmailer
  Date Monday, March 21, 2016 - 15:39
  User shyamzawar
  Location http://bmcc-troika.net/?q=admin/config/system/phpmailer&render=overlay
  Message SMTP error: Could not connect to SMTP host.

  Subject: PHPMailer test e-mail

  Body:

  Your site is properly configured to send e-mails using the PHPMailer
  library.

  Message:

   array (
     'id' => 'phpmailer_test', 'module' => 'phpmailer',
     'key' => 'test', 'to' => 'shyamzawar@ymail.com',
     'from' => 'shyam007zawar@gmail.com', 'language' => NULL, 'send' => true,
     'headers' => array(
       'X-Mailer' => 'Drupal',
     ),
   )

  Severity error


texts: How can I use a controller to render a form in a template file?

texts:
I'm looking to add a form inside a custom template.

opacsearchmodule.routing.yml

opacsearchmodule.route1:
  path: '/form-test/object-builder'
  defaults:
    _form: '\Drupal\opacsearchmodule\Form\opacSearchForm'
  requirements:
    _access: 'TRUE'

opacsearchmodule.login:
  path: '/form-login/object-builder'
  defaults:
    _form: '\Drupal\opacsearchmodule\Form\loginForm'
  requirements:
    _access: 'TRUE'

LoginForm.php

 public function buildForm(array $form, FormStateInterface $form_state)
  {
    // TODO: Implement buildForm() method.
    $form['#theme'] = 'front_page';

    $form['user_name'] = array(
      '#type' => 'textfield',
      '#title' => t(' '),
      '#label_display' => before,
      '#attributes' => array(
        'placeholder' =>  t(''),
        'style'=>'',
        'class' => ['form-control']
      ),
      '#required' => TRUE,

    );

    $form['password'] = array(
      '#type' => 'password',
      '#title' => t(' '),
      '#label_display' => before,
      '#attributes' => array(
        'placeholder' =>  t(''),
        'style'=>'',
        'class' => ['form-control']
      ),
      '#required' => TRUE,
    );

opacsearchmodule.module

function opacsearchmodule_theme($existing, $type, $theme, $path)
{
    return array(
        'opac_search'=> array(
            'variables'=>array('branches'=>NULL,'mattypes'=>NULL,'title'=>'','searchresults'=>NULL)
        ),
        'search_results'=> array(
            'variables'=>array('branches'=>NULL,'mattypes'=>NULL,'title'=>'','searchresults'=>NULL)
        ),
        'book_details'=> array(
          'variables'=>array('branches'=>NULL,'mattypes'=>NULL,'title'=>'','searchresults'=>NULL,'id'=>NULL)
        ),
      'category_page'=> array(
            'variables'=>array()
        ),

      'front_page' => array(
        'template' =>'front_page',
        'render element' => 'form'
      ),
    );
 }

The controller contains the following code.

 public function openLoginPage(){
    $form = \Drupal::formBuilder()->getForm('Drupal\opacsearchmodule\Form\loginForm');

    return [
      '#theme' => 'front_page',
      'form' => $form,
    ];
  }

The template filename is front-page.html.twig. If I open form using path registered inside routing.yml file, it works; if I try to use it inside a custom template it doesn't work.


texts: Trying to create a widget that submits a form and takes you to another search page

texts:
The original example http://www.trellon.com/content/blog/apachesolr-and-facetapi uses an auto submitter, which I don't want. I'm trying to modify it to use checkboxes and submit with a submit button, however that doesn't appear to be working. I can select different boxes and submit, but it doesn't take me to another search page.

class ResourceLibraryWidget extends FacetapiWidget {
   /**
   * Renders the form.
   */
  public function execute() {
    $elements = &$this->build[$this->facet['field alias']];
    $elements = drupal_get_form('resource_library_facetapi_select', $elements);
  }
}

function resource_library_facetapi_select($form, &$form_state, $elements) {
  // Build options from facet elements.
  //$options = array('' => t('- Select -'));
  foreach ($elements as $element) {
    if ($element['#active']) {
      continue;
    }
    $options[serialize($element['#query'])] = $element['#markup']; //. '(' . $element['#count'] . ')';
  }

  $form['select'] = array(
    '#type' => 'checkboxes',
    '#options' => $options,
    //'#attributes' => array('class' => array('ctools-auto-submit')),
    'default_value' => '',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Find Resources'),
    //'#attributes' => array('class' => array('ctools-use-ajax', 'ctools-auto-submit-click')),
  );

  // Lets add autosubmit js functionality from ctools.
  $form['#attached']['js'][] = drupal_get_path('module', 'ctools') . '/js/auto-submit.js';
  // Add javascript that hides Filter button.
  //$form['#attached']['js'][] = drupal_get_path('module', 'example') . '/js/example-hide-submit.js';

  $form['#attributes']['class'][] = 'resource-library-checkbox-facet';

  return $form;
}

Why isn't it working the way I intend? I'm trying to change different values on the submit button, but that doesn't seem to do anything.


texts: Webform to add row to specific sql table

texts:
I have drupal running and have enabled a few modules including the webform module. I have opened phpmyadmin and added a new table with specific rows.

Now I want to link the two so that a user can log in to the site, fill out the webform with some data each day and I can insert a new row in the table and send each field to a specific column in that row. Later I will build a page for the user to view his inputs, maybe with graphs etc.

Am I on the right track? Is a webform the correct way to do this? And how do I make that link between the two?


texts:
I have a Drupal 8 website with customer contributed content. The images uploaded by customers are not optimized, so I am using image optimization pipeline of  the imageapi_optimize contrib module to take care of the responsive images. however, I found that the original image is uploaded without compression or optimization.
While fully knowing the intention of keeping the original image intact, I need to do optimization for images uploaded by users having role 'xyz' using the custom_entity_presave hook.
The following code segment, however, is not making any changes to the images, and all the images are stored in full size. i.e. $pipeline->applyToImage($uri); is not executed or it is not making any impact.
Can you please help me crack this problem?
PS: The image optimization pipeline "Local Binaries" is working well, as I can see the generated responsive images are optimized. Only the code segment below is not working!
if($entity->getEntityTypeId() == 'file') {
    if (
\Drupal\user\Entity\User::load(\Drupal::currentUser()->id())->hasRole('xyz')) {
    $uri = $entity->getFileUri();
    $image = \Drupal::service('image.factory')->get($uri);

    if ($image->isValid()) {
      $pipeline = \Drupal\imageapi_optimize\Entity\ImageAPIOptimizePipeline::load('local_binaries');
      if ($pipeline instanceof ImageAPIOptimizePipeline) {
        $pipeline->applyToImage($uri);
      }
    }
   }
  }


texts: How to render mini panel in custom template programatically?

texts: I have a minipanel and I have a custom template. How can I render minipanel in my custom template programatically?


texts:
I want use db_update to update a field,instead of update a field with new value (replace) , I want add a value to last value,
I know I can do it with mysql command

UPDATE `databasename`.`tablename` SET fieldB = fieldB + 1 WHERE fieldA='2';

but I use below code, It is not add to credit field, only replace it with $credit value,
anybody know where is my problem and how can I achieve this job?

$cr_update_no = db_update('rah_cc_credit') // Table name no longer needs {}
                ->fields(array('uid' => $user->uid,'update_date'=>REQUEST_TIME,'last_code'=>$code ,'credit' => 'credit'+ $credit))
                ->condition('uid', $user->uid, '=')
                ->execute();


texts: How do I do custom shapes (Complex Multipoint Geometry) using Geofield and Leaflet?

texts:
I need to create regional boundaries using Geofield 2.x and Leaflet. How gan I go about doing this?

I have tried using Leaflet Widget for Geofield but it currently doesn't support the 2.x version of Geofield and the patch in the queue to make it compatible doesn't work.

I am looking for alternative method to the Leaflet Widget for Geofield module, perhaps using just Geofield.

I am not looking for a complete walkthrough. Just point me in the right direction and I will figure the rest out. :)


texts: How can I allow users to cancel their accounts without requiring e-mail confirmation?

texts:
In Drupal 7, users can cancel their accounts from the account settings page.  However, by default this requires e-mail confirmation.

There is an option "Require e-mail verification when a visitor creates an account" but no option "Do not require e-mail verification when a user cancels an account."

Is there some way to allow users to simply cancel their accounts while logged in rather than requiring them to verify the cancellation via e-mail?


texts: How do I update the documentation on someone elses module?

texts:
I want to update the documentation on the Agenda module on Drupal to provide a bit more clarity on how to get it set up.

I have contacted the author and he said great!

How do I do this on drupal.org?  I see the code can be changed via git, is the documentation part of the git repo?


texts: Panels Mini-Panels vs Block Regions vs Display Suite vs Stylizer vs Page Manager vs Theme

texts:
I am new to Drupal and I am having a hard time finding clear and comprehensive documentation explaining how designing layouts and pages works in Drupal.

I have identified several concepts:

Panels & Mini-Panels
Block & Regions
Display Suite
Page Manager
Stylizer
Theme
Selection Rules
Context
Variant

There are many tutorials explaining a subset of those concepts, but there is no global picture connecting the dots.

Can someone help clarify each concept?
Can someone explain how each concept is related to others? Which is complementary to which? Is any concept replacing any another concept?
Which concepts a user should learn about in order to design customized screens and layouts, while still being able to use delivered screen (for example: those for creating content)?


texts:
Semi-new to Drupal. I'm trying to find a way to render HTML inside my custom module.

Right now I'm using this method

$page = 'hello world';
return $page;

Which can get pretty dirty once you had some logic into it.

Is there a better way to do this? Maybe render it to some kind of template file and pass an array of vars?

Any help is appreciated :)


texts: How to give link to edit in user profile page and node page?

texts:
I have removed all tabs of user's page and node page with the help of Tab Tamer module, but i want to keep only one tab enabled i.e "Edit".

how to enabled only tab(Edit) or a link to edit profile on the user's page and edit link on node page.


texts:
Within the e-mail handlers I've selected the body as 'twig template'.
But no HTML is sent.
I've activated Swiftmailer to send attachments ... is that the problem?

Submitted values:

{{ webform_token('[webform_submission:values]', webform_submission, [], options) }}

 URL: {{ webform_token('[current-page:url]', webform_submission, [], options) }}

 Page name: {{ webform_token('[current-page:title]', webform_submission, [], options) }}

Value in body (email):
Submitted values: *Name* sfd dsf *E-mail* test@test.com [1] *Phone* sdfsdfsdf [2] *VAT* sdfsdfdfs *Question?* Yes *Newsletter* List1, List2, List3 *Message* sdfsdf sdf sdf s dfsdfs URL: https://test.test.com/page/title/subtitle Page name: Pagename [1] test2@test.com [2] tel:sdfsdfsdf


texts: Is there a way to change the title of an article depending on where the aricle is linked?

texts: If I have an article linked in different places on my site.  Is there a way to vary the headline to the article based on where it shows up, or how it links?  Some places the liinks are teasers and in others they are not.  Is there a way to change what the headline is?  I already have two different fields prepared for different headlines.


texts: Views merge rows: merge uniques values and show the first one

texts:
I'm using Views merge rows to grouping rows by some fields, It worked good for me, but in some fields I want to show just the first filled value that means: merge uniques values+use the first value.
View after using VMR

Orginal view

Is there a way to do that using views merge rows? or I have to use an other solution?
Or how I can hide/remove rows which have cycle smaller than the max cycle value  for every every container -see the image above-? I couldn't do it with views filter.

I'll explain my use case below to show the purpose of creating this view:

  The objective was tracking the containers, so I have to show
  containers and there currents and previous places. The container
  pass by a number of positions (in depot, at port of delivery, at port
  of loading...) until being in the vessel( position: on board), or it
  can be in an exceptional position like "reformed". I called the
  passage through those positions from the start to the end a
  "cycle" If the container is on board we have to fill all
  information about previous positions in a form "bill of lading". What
  I did as solution, I created 3 content type : container,position,bill
  of lading. The position content type reference the container and
  contains a select list field "position container" and 10 field
  collection field, every field collection contains a specifics fields
  for  a single position. So for every node position, I fill the field
  container, I select "position container" , I fill the field collection
  fields corresponding to the position selected. For example if I
  created a new position for the container "blk001" in position "in
  depot", I fill the field collection fields "name depot" and "date in
  depot". For the bill of lading content type it reference the
  containers also, I redirect to it every time the node position is
  saved and "position container" is "on board". Now the challenge is
  providing a list of containers,with the current bill of lading "N°
  B/L", the current cycle and merging all the positions fields
  corresponding to this cycle.


texts: drush pm-update of 6.27 to 6.28 yields this error: Allowed memory size of 67108864 bytes

texts:
Possible Duplicate:
  “Allowed memory size” errors on common tasks

we put our site into maintenance mode,
temporariliy removed some symbolic links that have confused drush in the past,
and tried to do this:
[~/drupal-6.25]# drush pm-update

where we got this error:

Refreshing update status information ...

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 199690 bytes) in /home/kettles/drupal-6.25/modules/update/update.module on line 549
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 199690 bytes) in
/home/kettles/drupal-6.25/modules/update/update.module, line 549
[~/drupal-6.25]#

The directory is called drupal-6.25 but really holds a 6.27 install.

Thanks,


texts: Is it possible to make multilingual site with each language has own domain? So I want to manage all domains with one code and database. All languages will be exactly same translated content.


texts: How to automatically add new users to a OG Group (MyCommunity) using Rules?

texts:
This is a configuration task.

it continues the request here:
Automatic add user to organic groups

Task

Using Rules UI: all new users are automatically members to group MyCommunity

Steps

Events: After saving a new user account
Conditions : none
Actions: OG: Add entity to a group

But how to configure data selector to get a specific group: MyCommunity?

UPDATE

Apparently there is no clean way to do that other by a patch: https://drupal.org/node/1706884


texts: how to add fields for drupal registration form internally souce code of drupal7.17 application

texts:
generally all you are editing template in this location  files C:\wamp\www\drupal\themes\bartik\template.php
i think so ...
so please guide me how to create customise registration form step by step in this folder
like adding fields like

first name:-
last name:-
date of birth:-
email:-
user name:-
password:-
confirm password:-
location:-
referer:-

{not graphically using  wampserver opening site and login go to configuration/managefields}.
show me code method where we insert source code

example:-like using other applications
home.html,about us.html,form.html,contact.html

we are interlinking these pages..
generally we insert username password field in first page
if the user is not register we will add one more option signup
,when user click signup it will display registartion form
like this i want to create ....how it is possible
and also show database connectivity in dos command base
by using my sql software application

not in wamp server application ....create database

please any one suggest me  step by step using bartik theme.... or others.

thank you in advance
& sorry for bad english


texts: How to alter Core's user login final function

texts:
In user.module, I need to alter the message that is displayed if the username/password is not recognized. I'm using the email registration module so I don't use usernames at all. I want the last form error message in the code below to show email/password instead, as well as add a custom redirect to it.

I've googled for quite some time, but cannot find how to hook onto this function. Any help would be appreciated!

function user_login_final_validate($form, &$form_state) {
  if (empty($form_state['uid'])) {
  // Always register an IP-based failed login event.
  flood_register_event('failed_login_attempt_ip', variable_get('user_failed_login_ip_window', 3600));
  // Register a per-user failed login event.
  if (isset($form_state['flood_control_user_identifier'])) {
  flood_register_event('failed_login_attempt_user', variable_get('user_failed_login_user_window', 21600), $form_state['flood_control_user_identifier']);
}

if (isset($form_state['flood_control_triggered'])) {
  if ($form_state['flood_control_triggered'] == 'user') {
    form_set_error('name', format_plural(variable_get('user_failed_login_user_limit', 5), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or request a new password.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.', array('@url' => url('user/password'))));
  }
  else {
    // We did not find a uid, so the limit is IP-based.
    form_set_error('name', t('Sorry, too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or request a new password.', array('@url' => url('user/password'))));
  }
}
else {
  // Fix password reset messages
  form_set_error('name', t('Sorry, unrecognized username or password. Have you forgotten your password?', array('@password' => url('user/password', array('query' => array('name' => $form_state['values']['name']))))));
  watchdog('user', 'Login attempt failed for %user.', array('%user' => $form_state['values']['name']));
}

}


texts: How i can create VIEW table using Drupal hook_schema()

texts:
i want to create a view table in my custom module .install file and i want join with another table like i did in my db_query function but i want this thing in hook_schema function.

 db_query('CREATE VIEW Sample_Label_Data_By_CategoryId AS
                select
                `sample_label_library`.`SampleNumber` AS `SampleNumber`,
                `sample_label_category`.`CategoryName` AS `CategoryName`,
                `sample_label_and_category`.`CategoryID` AS `CategoryID`,
                `sample_label_library`.`MaterialName` AS `MaterialName`,
                `sample_label_library`.`EPANumber` AS `EPANumber`,
                `sample_label_library`.`SampleFilename` AS `SampleFilename`,
                `sample_label_library`.`LabelFilename` AS `LabelFilename`
                from ((`sample_label_and_category` join `sample_label_library`
                    on((`sample_label_and_category`.`SampleNumber` = `sample_label_library`.`SampleNumber`)))
                    join `sample_label_category` on((`sample_label_and_category`.`CategoryID` = `sample_label_category`.`CategoryID`)))')
    ->execute();


texts: Implementing redirection on node viewing without affecting solr search indexing

texts:
My logic demands that for a specific content type provided a node (Ex) node/123 has one if its CCK field named web link with a URL value like http://someothersite.com in it, viewing the given node mysite/node/123 should redirect to the respective URL http://someothersite.com given in that field.

I've implemented this with a custom module's hook_nodeapi view case to check the value of the field and perform the redirect. However doing so has inadvertently affected my apachesolr search indexing which invokes the hook on view condition (through node_build_content) to generate the node for being indexed.

This has forced me to currently skip such specific nodes from not being indexed, however I wish to know if there's a better way of programatically implementing the aforementioned redirect without hook_nodeapi to keep the sanity of search indexing intact.


texts:
I have (D7) code that uses menu_load_all() to get a list of menus to pass as options for checkboxes to the admin interface of a module I'm writing.

To test and make sure my little snippet was returning the correct values for menu titles, I pasted it into a block of eval'd code in the content of my staging site, and it was fine. It returned a nice little array of titles and so I straight copy/pasted it into my module's code.

Now when I enable my module, I get this error:

Fatal error: Call to undefined function menu_load_all()

WTH? Why did this work in eval'd and not in my module, and what do I do to get my module access to this API function?

Full code of module available for your perusal.


texts: How to interlace ouput of nodes two content types in views

texts:
I have nodes of two different content types and want to output them interlacing in a view. So nodes of type A are on odd places and nodes of type B on even ones.

Is there a straight-forward way to do this?


texts: How to save values on each form submit without overriding saved datas?

texts:
i am having a form with 2 values to save on submit:

 public function submitForm(array &$form, FormStateInterface $form_state) {
    if ($_POST['op'] == 'Import Accounts') {
      $filter = $form_state->getValue('ldap_filter');
      \Drupal::configFactory()->getEditable('amu_import_ldap.settings')
        ->set('ldap_filter', $filter)
        ->save();

      $roles = $form_state->getValue('roles_list');
      \Drupal::configFactory()->getEditable('amu_import_ldap.settings')
        ->set('roles', $roles)
        ->save();
      }

It is working but each save override the previous one.

How can i structure the yml to save a list of datas iterately

/config/install/my_module.settings.yml

ldap_filter: ""
roles: null

i have been trying a schema file although i am not sure it if it is considered at all

/config/schema/my_module.schema.yml

amu_import_ldap.settings:
  type: config_object
  label: 'couple filtreLDAP / roles'
  mapping:
    ldap_filter:
      type: text
      label: 'Filtre LDAP'
    role:
      type: array
      label: 'Rôles'

i have seen things like

  node.type.*:

?


texts: What is the parent name for the admin menu?

texts:
what is the parent name for the admin menu ?  if I put system.admin_structure in the mymodule.links.menu.yml file as below, it places the new menu item under the structure tab on the menu.  How do I get it on the first level of the menu.?
mymodule.demo:

title: Demo Link
  description: 'This is a demo link'
  parent: system.admin_structure
  url: 'internal:/taxonomy/term/3'
  //route_name: entity.taxonomy_vocabulary.overview_form
  menu_name: admin
  weight: -79


texts: is it possible to have more than one active theme? Basically what I'm trying to achieve is another theme that has none of the extra CSS/JS output by Drupal modules -- this would only be used for E-Newsletter display. I see the "default" setting for a theme, but how would I apply certain content types, etc to a specific theme? I've searched a bit and am stuck in the mud at the moment. Any help would be greatly appreciated. Thanks!


texts: Content entity form not displaying the previously selected value

texts:
Even though I can see that my data is being saved it doesn't ever appear to be set when I go back to edit my entity via a form. Am I missing something in my setup?

Here's what I have:

      $fields['content_display'] = BaseFieldDefinition::create('list_integer')
          ->setDisplayOptions('form', [
              'type' => 'options_buttons',
              'weight' => -4,
          ])
          ->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED)
          ->setSetting('allowed_values', $values)
          ->setDisplayConfigurable('form', TRUE);


texts: How do I alter a template file in a multishared child-site?

texts:
The site I am working on is the child-site (is that the correct terminology?) of a larger parent site.
The company I am working with uses the main, parent site as a sort of framework or base. It has a basic theme that the child sites use and build off from.

I want to alter the HTML of a pane element. The original template file for this is located back in a module directory of the parent site. There is no equivalent module or folder structure on the child-site.
I don't want to change the template file on the parent site as this would affect the other child-sites.

I've read up that you can copy the template and place it into the child-sites structure. Is this true?
If so, would I need to re-create the directory path to replicate that of the parent site's?
What's the correct way to go about this?


texts: How do I simply make the whole site use a secure connection?

texts:
In Drupal 7, I used the Secure login module to run the site on a secure connection, but it seems it doesn't revert back to http on logout. I would like to just run the whole site as https:// as a simplification.

Is there a simple way to do this without the use of module?


texts: Node access, Cron, and DANGEROUS_ACCESS_CHECK_OPT_OUT'

texts:
Observations:

Anonymous users can view nodes of a certain type
Cron runs as an anonymous user
Cron cannot access nodes of this type when
using EntityFieldQuery
Cron can access nodes of this type when the tag 'DANGEROUS_ACCESS_CHECK_OPT_OUT' is added to the query.

It seems to me that DANGEROUS_ACCESS_CHECK_OPT_OUT is a misnomer and should actually be DANGEROUS_ACCESS_CHECK_OPT_IN. If access was checked, Cron would know that anonymous users have access to this type of node, or am I missing something?

Based on the initial comments I think my question is not clear, so I am going to rephrase it. What I am seeing is that I allow the anonymous user to see this type of node, but Cron cannot query it. The references to this issue are ambiguous about the reason. If Cron runs as an anonymous user, then Cron should not get different access than an anonymous site user. Or Cron does not run with any user profile at all. That would actually make sense, but that is not how people explain this. So what is really going on? Is the flag a misnomer, or do people not make a clear distinction between "anonymous user" and "no user"?


texts: node visibility only selected users from a list?

texts:
PROJECT
I am creating a 'web portal' with Drupal 7:
Each registered user is a admin of a your group. (organic groups)
This admin-user may invite other users to your group.
All users of Group can create Nodes.
I WOULD LIKE:
I would like this nodes are not visible to all group's users, but I want that who create the node can select (from a list of all users in the group!) the users who can see this specific node.

Can anyone recommend a way?
...or advise me some modules?

Thanks!


texts: In Drush what is the difference between ard and arb?

texts: In Drush what is the difference between ard and arb commands? When should I use one over the other?


texts: Taxonomy views exposed sort sorting only with all terms

texts:
i am building eshop using ubercart
i am using views3 to show catalog categories (taxonomy terms)

everything works fine, but when i create exposed sort by price field, and use it, it show all terms, so in the url of site is catalog/all (not catalog/3)
i solved it with jquery (form action link replaced)

BUT sorting works only with "all" in site url.(catalog/all?sort_by=sell_price&sort_order=)ASC)
so when i use manually term id it not works (catalog/3?sort_by=sell_price&sort_order=ASC)

has someone knows why?

thank you a lot for you time, guys.
and sorry for my english :D


texts:
I have a Webform with address field and other fields as well.
Is there a way to alter the order of address field form elements within other fields? If so how can this be done?


texts: Import image using feeds and image path?

texts:
With Drupal 7, I am using feeds to import an XML file. That file has a relative image path I can import, but not the image itself.

How can I save the image to the node itself instead of saving the image path?


texts: Customise Publishing Options based on Role

texts: Is there a simple way to customise the Publishing options so that certain Roles are only able to create content but not publish it. I have tried the Workflow and Workbench modules but they are way too complicated!


texts: 8 - Node::load is generating an object with circular reference which is crashing kint() and var_export()

texts:
I have a content type with a Taxonomy term which has fields. When I try and load a node (or possibly nodes) of this type I get unexpected results. While debugging with kint() and var_export() I get errors about "circular references". Is this normal in Drupal 8 node structures?

Or is there an underlying misconfig in the content type or taxonomy causing this problem?


texts:
I'm running Drush 9.5.2.

I set up a site alias. Drush recognizes it, but it will not connect via SSH. I get the following error:

ssh: connect to host mysite.com port 22: Operation timed out

The server doesn't use port 22. It uses port 2234.

My SSH config is set to use port 2234. I can SSH in if Drush isn't involved. There's nothing in the docs that addresses this. What am I missing?


texts: LDAP Module - Notice: Trying to get property of non-object in ldap_authentication_init() appears

texts:
I have a site with Drupal 7.41 and LDAP module version 7.x-2.0-beta8. My goal is to connect my drupal site with an Active Directory account.
After I installed LDAP module i saw a error message: Notice: Trying to get property of non-object in ldap_authentication_init() (line 223 of  [... ] ldap/ldap_authentication/ldap_authentication.module)
But i thought that was a part of Module. When i configure and test my module, this error message still appears. The stack of test is:

            sid = empresa.cl
            numeric_sid = 1
            name = empresa.cl
            status = 1
            ldap_type = default
            address = XX.XXX.X.XXX
            port = 389
            tls = 0
            followrefs = 0
            bind_method = 2
            basedn = Array ( [0] => ou=chile,dc=empresa,dc=cl )
            binddn =
            user_dn_expression = empresa//%username
            user_attr = samaccountname
            account_name_attr =
            mail_attr = mail
            mail_template =
            picture_attr =
            unique_persistent_attr =
            unique_persistent_attr_binary = 0
            ldap_to_drupal_user =
            testing_drupal_username = nombre
            testing_drupal_user_dn = CN=nombre, OU=chile, DC=empresa, DC=cl
            grp_unused = 0
            grp_object_cat =
            grp_nested = 0
            grp_user_memb_attr_exists = 0
            grp_user_memb_attr =
            grp_memb_attr =
            grp_memb_attr_match_user_attr =
            grp_derive_from_dn = 0
            grp_derive_from_dn_attr =
            grp_test_grp_dn =
            grp_test_grp_dn_writeable =
            search_pagination = 0
            search_page_size = 1000

Any possible suggestion or advice for this problem?


texts: MedialEment.js module not seeing the installed library

texts:
I've just installed the MediaElement.js module and downloaded the corresponding library but in the modules page it won't turn on because it's not finding the library.

i have other libraries running so i know it's in the right place.

the Media Module version is 7x-1.2 and the on the webpage the version is
2.15.1

i've cleared the cache, run Cron and renamed the folder to mediaelement

how the freak do you trouble shoot something like this? this should take like 10 mins to do and now it's going on 40mins trying to troubleshoot.


texts: How to delete a managed folder and its contents programmatically via hook_uninstall?

texts:
My hook_update_N() implementation looks like this:

$directory2 = 'public://folder_name';
file_prepare_directory($directory2, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);

How can I remove "folder_name" and its contents in hook_uninstall using drupal's API?


texts: CCK field value count is never less than 1

texts:
I have got a CCK field set up so that unlimited values can be entered upon node creation (number of values: unlimited).

When I try to print values in a node with the following code

if ($node->field_tip != NULL) {
  foreach ((array)$node->field_tip as $tip) {
   print "
" . $tip['view'] ."
";
  }
}

or I print count($node->field_tip), the value is never less than 1, and

 is always displayed, even if there aren't values entered in that field.


texts: drupal_match_path() for multiple wildcard patterns?

texts:
I want to add some CSS and JS to multiple matched wildcard URL patterns. According to Add javascript to multiple specific urls, I can use a wildcard using drupal_match_path() and that works well for one pattern. However, I am trying to use a few patterns to add the same JS and CSS. So far I've tried these:

  // By path matching wildcard patterns.
  $path = drupal_get_path_alias();
  $pattern = 'portfolio/* || photo-blog';

and

  $path = drupal_get_path_alias();
  $pattern = 'portfolio/*, photo-blog';

and

  $pattern = 'portfolio/*' 'photo-blog';
  $path = drupal_get_path_alias();

... but none of these work. I am guessing it may not be possible in the context of:

if (drupal_match_path($path, $pattern)) {
// add JS and CSS based on above
  }


texts: Rules - How can I put a link into an email sent by a rule

texts: I would like to use rules to send an email to my admin staff when a new piece of content is created.  It would be great if the email contained a link to the content to make it easier to find.  Is there a way to insert the link?  Perhaps there is a token that I could use.


texts: Default images also as user selected image functionality

texts:
I have a content type with a taxonomy and based on that taxonomy, I want to have a default image to show unless the user wants to upload a different image. I'm not sure how to go about this functionality. Is there a module that should one could recommend or any suggestions?

I have used this to display taxonomy images https://www.drupal.org/node/1224916 and it works great but it doesn't give the user the option to upload their own pic.


texts: "list" plugin does not exist after upgrading from Drupal 8.3.x to 8.4.2

texts:
How can I tell exactly what is missing and from which module? (I assume it's draggableviews)

How can I remedy this error - or is it in the hands of a contrib module developer or where can I go to see how to contribute the missing plugin?

This is the output of drush @badev updb.

 ---------------- --------------------------------- --------------- -------------------------------------------------------------------------
  Module           Update ID                         Type            Description
 ---------------- --------------------------------- --------------- -------------------------------------------------------------------------
  draggableviews   8104                              hook_update_n   Implements hook_update().
  comment          enable_comment_admin_view         post-update     Enable the comment admin view.
  dblog            convert_recent_messages_to_view   post-update     Replace 'Recent log messages' with a view.
  field            remove_handler_submit_setting     post-update     Remove the stale 'handler_submit' setting for entity_reference fields.
  node             configure_status_field_widget     post-update     Load all form displays for nodes, add status with these settings, save.
  system           classy_message_library            post-update     Clear caches to ensure Classy's message library is always added.
  system           field_type_plugins                post-update     Force field type plugin definitions to be cleared.   @see
                                                                     https:www.drupal.orgnode2403703
  views            revision_metadata_fields          post-update     Fix table names for revision metadata fields.
 ---------------- --------------------------------- --------------- -------------------------------------------------------------------------

 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > yes

 [notice] Executing draggableviews_update_8104
 [error]  The "list" plugin does not exist.
 [ok] Performing draggableviews_update_8104
Array   Array
 [success] Cache rebuild complete.
 [success] Finished performing updates.
Connection to drupal8vm.dev closed.


texts:
I have a website where some holistic operators work together. I have created an Operator-Article node for every operator.

I also created a blog view to show the articles of each single operator.
This view uses the user ID of the article author.

I also created a view to show a list of operators in a table showing:

Photo
Name (link to curriculum page)
A link to the articles created by the user, which links to the blog view

To create the links to the blog view I used:

An hidden field (Created by) with the Entity ID formatter to get the user ID
A field using the following re-writing results:
Text: "Read its articles"
Link path: /blog/{{ uid }}

If I log in, the view works correctly, giving for example a link like
site/blog/75. If I am not logged-in, {{ uid }} is not rendered, and the link becomes site/blog/.

To test the view, I show the Created by fieldm and when I login I see the UID (for example 75).

If I am not logged-in, I don't see anything.

How can I solve this problem, and use {{ uid }} even when I'm not logged-in?


texts:
Someone gave me access to a website of theres, and they want me to export the theme from one Drupal 7 install to another.
(I couldn't find any export links on the /admin/appearance page.)
How do I export a theme?


texts: Trigger a function after saving content type

texts:
I've created my own search engine with a custom module and some XML.
I would like to add content to the XML file with a custom function in my module.

The content that needs to be added will be coming from some content types. Is there a way to trigger a function after a content type is saved (node saved)?

I know the Rules module can do this, but I need to do it from my custom module (i.e. I need to write a function to achieve this).

Is this even possible?


texts: Changing default overlay behaviour to not return to the top of the screen

texts:
I have a custom module which displays a page as an overlay, however when you click on the link it displays the overlay but the background page now returns to the top.

This behaviour can be seen when clicking on any of the Drupal admin options whilst scrolled slightly down the page, it then jumps back to the top of the scroll when displaying the admin overlay.

Is there any way I can disable this for the overlay page defined in my module?


texts:
I'm trying to use the Image Widget Crop inside a form API. I followed the example module but there's no explanation how to do it after a file is uploaded.

My form is set like the code below. It works with page reload but not when the file is uploaded, also the widget it's not attached to field image, if I remove the image the widget remains in the form with the image loaded previously.

<?php

$fid = isset($produto) ? $produto->field_produto_img->getValue()[0]['target_id'] : NULL;
$upload_location = \Drupal\field\Entity\FieldConfig::loadByName('node', 'produto', 'field_produto_img');
$form['image'] = [
  '#type' => 'managed_file',
  '#title' => t('Selecione a imagem do produto'),
  '#description' => t('Extensões permitidas: png jpg jpeg'),
  '#upload_location' => 'public://' . $this->token->replace($upload_location->getSetting('file_directory')),
  '#theme' => 'image_widget',
  '#preview_image_style' => 'medium',
  '#upload_validators' => [
    'file_validate_extensions' => ['png jpg jpeg'],
    'file_validate_size' => [512000],
  ],
  '#default_value' => !empty($fid) ? [$fid] : NULL,
];

if ($fid) {
  $form['image_crop'] = [
    '#type' => 'image_crop',
    '#title' => t('Cortar imagem'),
    '#file' => \Drupal\file\Entity\File::load($fid),
    '#crop_type_list' => ['crop_type_produto'],
    '#crop_preview_image_style' => 'crop_thumbnail',
    '#show_default_crop' => TRUE,
    '#show_crop_area' => FALSE,
    '#warn_mupltiple_usages' => TRUE,
  ];
}

?>

I tried to follow the instructions of the official repo https://github.com/drupal-media/image_widget_crop#configuration,
but I had no success.

I'm able to configure the theme after the file is uploaded. I tried to add the custom element image_crop but it didn't work.

<?php
function my_theme_preprocess_image_widget(&$variables) {
  $element = $variables['element'];

  $variables['attributes'] = array('class' => array('image-widget', 'js-form-managed-file', 'form-managed-file', 'clearfix'));

  if (!empty($element['fids']['#value'])) {
    $file = reset($element['#files']);
    $element['file_' . $file->id()]['filename']['#suffix'] = ' (' . format_size($file->getSize()) . ') ';
    $file_variables = array(
      'style_name' => $element['#preview_image_style'],
      'uri' => $file->getFileUri(),
    );

    // Determine image dimensions.
    if (isset($element['#value']['width']) && isset($element['#value']['height'])) {
      $file_variables['width'] = $element['#value']['width'];
      $file_variables['height'] = $element['#value']['height'];
    } else {
      $image = \Drupal::service('image.factory')->get($file->getFileUri());
      if ($image->isValid()) {
        $file_variables['width'] = $image->getWidth();
        $file_variables['height'] = $image->getHeight();
      }
      else {
        $file_variables['width'] = $file_variables['height'] = NULL;
      }
    }

    $element['preview'] = array(
      '#weight' => -10,
      '#theme' => 'image_style',
      '#width' => $file_variables['width'],
      '#height' => $file_variables['height'],
      '#style_name' => $file_variables['style_name'],
      '#uri' => $file_variables['uri'],
    );

    // Store the dimensions in the form so the file doesn't have to be
    // accessed again. This is important for remote files.
    $element['width'] = array(
      '#type' => 'hidden',
      '#value' => $file_variables['width'],
    );
    $element['height'] = array(
      '#type' => 'hidden',
      '#value' => $file_variables['height'],
    );
  }

  $variables['data'] = array();
  foreach (\Drupal\Core\Render\ElementElement::children($element) as $child) {
    $variables['data'][$child] = $element[$child];
  }
}
?>

Any help is welcome, thanks!


texts: Ckeditor - Not displaying text on edit node option

texts:
I've been using Ckeditor for a while to add text to created nodes.

But when editing the same nodes as an authenticated user, Ckeditor doesn't show the text in the body.

It still works for the administration role.


texts:
I have a Drupal install with 10 content types and 30 views being used as web app. The app uses MySQL as a database.

What I would like to do is to reuse the same app but with SQLite. Is there a way to migrate the theme, content types and views without re-building them from scratch? I am not interested in the content.


texts:
Just found out that on Drupal API hook_help() don't have break after in the end of switch statements. Is it supposed to be so?

function hook_help($path, $arg) {
  switch ($path) {
    // Main module help for the block module
    case 'admin/help#block':
      return '
' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '
';

      // Help for another path in the block module
    case 'admin/structure/block':
      return '
' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
';
  }
}


texts: Services won't authenticate email address used as username

texts: I've installed the Email Registration module because I want my site's users to be able to register an account, and use their email address as their login username. This works great on the web login, however I've built an app to log users into my Drupal site as well using the Services module. When I try and log users in with their email address username, access is denied (whereas when they log in via the website, it authenticates just fine). Any idea why this might be?


texts:
I have installed and setup PDFPreview module according to the instructions.  The PDF attachment file name has disappeared from the article pages with nothing in its place.  When I examined the HTML, there's an img tag pointing to the preview image, but it doesn't work.

When I access the preview image directly, it produces a 500 error with a (translated) error message indicating an error while producing the image.  The Drupal log at Reports > Recent log messages contains the error message

Unable to generate the derived image located at public://styles/medium/public/pdfpreview/3b350fd949abe27c0778b0f857ffa352.jpg.

I found this error report and tried the steps instructed in message #2.  I created the directory sites/default/files/styles/medium/public/pdfpreview/, have tested directory permissions up to 777, and tried switching the 'Image style' preference back and forth with no success.  The web server has ImageMagick 6.7.7-10 installed.

I have no idea how to even debug the issue further.  The Apache error logs contain nothing, and the Drupal error message doesn't provide any indication on what has caused the failure.

How can I further debug the issue?

Detailed Drupal error log:

(I have since reverted the configuration, so that users at least have the file name link visible.)


texts: How to preprocess file before Feeds upload

texts:
I am using Feeds 7.x-2.0-beta1 .  I am getting the data in a format that I need to change before inputting, since they are adding one item per row when some data has multiple values in one field . I want to modify the file to put all of those values in one field and one row before continuing with the feeds parser.
Where can I put the php code to do this? what hooks are available? thanks


texts:
For a teaser view mode I want to display the language of the content. I can get the langcode in twig with: {{ node.langcode.value }}
But how can I display the language name? In the field display I get only the string with "Language English", but I want only the name without any other thinks like "Language ...".

One way is to use preprocess node:

function mytheme_preprocess_node(&$variables) {
  $variables['lang_name'] = $variables['node']->language()->getName()
}

in the template file:

{{ lang_name }}

Is there a pure twig solution possible?


texts: Render all items of the main menu on one page

texts:
i am building a overview page of my website.
My Main Menu has the following structure:

MenuItem1

submenuitem1
submenuitem2
submenuitemn

MenuItem2

submenuitem1
submenuitem2
submenuitemn

MenuItem3

submenuitem1
submenuitem2
submenuitemn

MenuItem4

submenuitem1
submenuitem2
submenuitemn

I want to render each Menuitem with his submenuitems in a different div and add an image to it.
I know i can work with the menu block module. But because we have the domain access module running and lots of domains, it has to be a coded solution. Each domain has his own main menu and should build dynamically the overview.

I managed to  output the whole main menu expandend with this code:

$main_menu_tree = menu_tree_all_data('main-menu');
$main_menu_expanded = menu_tree_output($main_menu_tree);
print render($main_menu_expanded);

How can i accomplish my mission ?

Thx


texts: How to migrate custom user fields to Drupal 7?

texts:
I would like to migrate custom user fields from an external USER database table to the custom tables of Drupal 7.

I created custom fields for my users (First Name, Last Name, ...) under administration/configuration/account settings and I can confirm that these fields are created if I go to administration/people/ and click "edit" next to each user.

I also know that for each individual custom field that I have created, D7 created a new table of the form "field_data_field_[FIELD_NAME]" (ie. field_data_field_first_name, field_data_field_last_name, ...)

The specific commands I would like to find more information about are:

MigrateDestinationUser::getKeySchema();
$this->destination = new MigrateDestinationUser();

I understand the above command is the default used to import users to the default "users" database.

How can I migrate my content to another D7 table? Such as migrating the First Name from the external table to field_data_field_first_name?


texts: I can't get my drupal_http_request to go to the correct function

texts:
I am working with Drupal 7, I have a hook_services_resources() set up:

function Api_services_resources() {
  $api = array(
    'applicant' => array(
      'operations' => array(
        'retrieve' => array(
          'help' => 'Updates applicants',
          'callback' => '_Api_retrieve',
          'access callback' => 'user_access',
          'access arguments' => array('access content'),
          'access arguments append' => FALSE,
          'args' => array(
            array(
              'name' => 'gwf',
              'type' => 'text',
              'description' => 'GWF Number',
              'source' => array('path' => 0),
              'optional' => TRUE,
              'default' => '0',
            ),
          ),
        ),
        'create' => array(
          'help' => 'Creates applicants',
          'callback' => '_Api_create',
          'access callback' => 'user_access',
          'access arguments' => array('access content'),
          'access arguments append' => FALSE,
          'args' => array(
            array(
              'name' => 'data',
              'type' => 'array',
              'description' => 'User Account Info',
              'source' => 'data',
              'optional' => FALSE,
              'default' => '0',
            ),
          ),
        ),
        'test' => array(
          'help' => 'Tests API Connection',
          'callback' => '_Api_test',
          'access callback' => 'user_access',
          'access arguments' => array('access content'),
          'access arguments append' => FALSE,
          'args' => array(
            array(
              'name' => 'timestamp',
              'type' => 'text',
              'description' => 'Timestamp',
              'source' => array('path' => 0),
              'optional' => TRUE,
              'default' => '0',
            ),
          ),
        ),
      ),
    ),
  );

  return $api;
}

And am trying to post to it using:

$create_website_applicant_path = 'http://' . $website_url . '/api/applicant/create/';

      $applicant = array(

        'mail' => $user['applicant_email'],
        'pass' => user_password(8),
        'status' =>  1,
        'roles' =>  array(2 => 1, 3 => 0, 8 => 0, 7 => 0, 6 => 0, 9 => 0),
        'notify' => 0,
        'timezone' => drupal_get_user_timezone(),
        'field_given_name' => array('und' => array('0' => array('value' => $user['first_name']))),
        'field_family_name' => array('und' => array('0' => array('value' => $user['last_name']))),
        'field_gwf' => array('und' => array('0' => array('value' => $user['gwf']))),
        'field_vac_ip' => array('und' => array('0' => array('value' => $_SERVER['REMOTE_ADDR']))),
        'submit' => 'Create new account',
        'ldap_user_create_ldap_acct' => 0,
        'op' => 'Create new account',
        'signature_format' => 'filtered_html',
      );

      $create_website_applicant_params = array(
        'method' => 'POST',
        'data' => drupal_http_build_query($applicant),
        'timeout' => 15,
      );
      $create_website_applicant_result = drupal_http_request($create_website_applicant_path, $create_website_applicant_params);
      echo $create_website_applicant_path;
      print_r($create_website_applicant_result);

The only problem is that when I try to use POST I get an error saying 404:Not found: Could not find the controller.  I know the page is there, I can go to it in my browser.  If I try to use GET the function being called for /api/applicant/create is actually _Apt_retrieve().  I'm not sure why this is and can't get it to point to the other function.


texts: Theming site name in mayo over Flexslider slideshow header?

texts:
I asked this originally in the Mayo support on drupal.org but got directed here.

Continuing my development of my main work website has continued to use Mayo as I find it brilliant and simple.

This week I've managed to implement the Flexslider module using views slideshow and views to construct a new header.

The issue I have which i could do with some support with and that is theming the sitename and slogan to overlay on the left to match the title on the right. Ultimately I will link the title on the left to content of that service but first i need to get this sitename issue sorted.

No matter what i do, i cannot get the sitename to display in front of the flexslider?

I have managed to theme the title of the image within the view fine so i dont think its a flexslider issue but wondered if there is any thing i need to over ride with additional css within the mayo theme itself using css?

I currently have the sitename off until i sort this issue out but see the attached picture which shows the inspected code and where the div is currently via chrome inspect tool.


texts: Need help with taxonomy term creating a users view

texts:
I have a taxonomy field in the user registration form called location, I have a view listing all location terms (taxonomy terms).

I'm having trouble linking the terms to a view (containing the users info based on the location term), when the taxonomy term is clicked in a list of all terms, to display users that have the taxonomy term (with the same location). By default the taxonomy term view is set to display content and I'm having trouble changing that to display users.


texts: how to alter main menu to add custom class

texts:
How do I add custom class to main menu. The main menu links are like Fashion, Art, Life and nodes being viewed category can be any one. I want to make the main menu item active as per node being viewed category. e.g if example.com/node/44 -> category = fashion then the Fashion in main menu should be selected. I tried MYTHEME_menu_link and MYTHEME_menu_link_alter but they did not work for me.

Thanks for your help.


texts: How to replace the Secondary menu title with the current Username?

texts:
Secondary menu - this is the system secondary menu title.
I need to replace it with current username, the same as the User menu block has it.

I do not want to use the User menu block because of some reasons.
I would like to use the deafault system menu:

<?php if ($secondary_menu): ?>
  <div id="secondary-menu" class="navigation">
    <?php print theme('links__system_secondary_menu', array(
      'links' => $secondary_menu,
      'attributes' => array(
        'id' => 'secondary-menu-links',
        'class' => array('links', 'inline', 'clearfix'),
      ),
      'heading' => array(
        'text' => t('Secondary menu'),
        'level' => 'h2',
        'class' => array('element-invisible'),
      ),
    )); ?>
  </div> <!-- /#secondary-menu -->
<?php endif; ?>

Should I use token [current-user:name]?
If so, then where (file name) and how?

Note: I can not do it directly at /admin/structure/menu/manage/user-menu/edit because Menu name field is inactive.


texts: Can I use Feature for development and CMI only for deployment?

texts:
As a developer working in team I don't like using CMI to synch config from/into development server at all (cim/cex) in local development machine. Instead I'd like to use Feature. What I wanted to achieve is on below diagram.

Basically I want to use Features for development in first tier and use CMI only for deployment to PRD/IGR. Does it make sense? What do you think?


texts: Show audio file but require registration - suggestions for approach?

texts:
I am converting my guitar lessons site to drupal. On my previous site, I displayed an audio link, and upon clicking it, one could play the audio if they were registered. If not registered they were taken to a page asking them to register, then redirected to the lesson. The audio was in a protected folder. I am trying to do similarly in drupal. Any tips on how to get started? I am new to drupal...

Here is what I think would be ideal:

For the lesson page, use selection rule (via panels, views, or whatever) to display the embedded audio for the registered user
For guest user, display the embedded audio player but via guest class use javascript so when they press play they are redirected to register page, then have them register with captcha then redirect to lesson page. Or simpler, for guest user, just display a "play" icon that takes them to register page.

Ideas?

Regards


texts: How can I add an existing field to a new content type?

texts: I have a content type with name category and have title and an image under it. I want a select option with this category name while for my new content type "videos". How can I do this?


texts: Views remove link to content based on publication status

texts:
Drupal 8. I have a list of images that link back to a content page. If the page is unpublished I want to remove the link.

So far I've set up a hook_post_render that checks the publication status. The only way I can think to move forward is to make make the view put out a link as a separate field, then conditionally remove the value. I don't love it and I'd rather jump in to where views is wrapping the image.


texts: getting key of submitted entity list field

texts:
I'm having troubles with the following:
I created a form with entityforms and now i want to send a confirmation email with mimemail.
Getting that to work is no problem.

But i need to perform a small check with the php evaluation function of mimemail.

The form is for customers to place an order, but they have to specify 1 of 2 printing techniques available, 'fdm' or 'polyjet'. This is a 'list' field in the entityform with the two options.
And in the confirmation email i need to check what technique has been chosen so i can display some lines of text depending on the technique.

For my php evaluation i would like to get the key (machine readable name) of the submitted value.

So i can do something like this:

switch ($chosenkey){
    case "pol":
        echo "lines of text for polyjet";
        break;
    case "fdm":
        echo "lines of text for fdm";
        break;
    default:
        echo "error";
}

So basically i just need to know how i can create a variable ($chosenkey) that contains the submitted key of the chosen printing technique.

anyone any idea how i can accomplish this? I have googled around but can't find any relevant answer.


texts: How to remove link to personal contact form from tabs block?

texts: I created a link to personal contact form in page content, and I want to remove it from tabs. How to do that without breaking functionality?


texts: How to extract query placeholders for debug purposes?

texts:
When I cast query to string, I can see WHERE that will be passed to the database, like this:

WHERE  (idProperty = :db_condition_placeholder_0)
  AND  (idCategory = :db_condition_placeholder_1)

But how can I extract these placeholders?


texts: View with terms and if the're flagged or not on userpage

texts:
I want to make a subscription-page on the users-page. A user can flag terms. On the user-page there should

1) It's no problem to get a view with flagged content

relationship Flags [flag name]
contextual filter Flags: User uid

(see How to create view with user's flagged content?). The view shows only flagged terms.

2) It's no problem to get a view with flagged and not-flagged content

relationship Flags [flag name] with current user & include only flagged content NOT checked
path like /subscription

But as soon when i alter the path to user/%/subscribtion, every user can see other subscriptions by altering the path. When using this path with option 1), i see only flagged content (??). Removing the contextual filter, shows all content but accesible for everyone.

How can i restrict the access to the own subscriptions, showing flagged and unflagged terms?


texts:
Is there a way to adjust or add the "default store" value directly in a SQL table?

I have no default store listed - if it is applicable to version 1.x and all the products I imported from Ubercart are not attached to any store so I would also like to attach all the product with an SQL query to  the default store after I create it

I cannot find any "default" checkbox, and the only way to add a store is at admin/structure/entity-type/commerce_store/store - because Commerce Marketplace is installed - and there is no "default checkbox there either

I found this issue for Commerce 2.x on Drupal 8 and I do not know if this is 1.x issue also --- see --- https://www.drupal.org/project/commerce/issues/2945939


texts: How to check if a password reset token is still valid?

texts:
Is there a way to hook into the user_pass_reset form to detect if the provided hash is valid? Currently it seems to just throw a 403 error when submitting the form if the hash has already been used to change the password.

Using hook_form_alter(), I can retrieve the hash itself with explode("/",$form['#action'])[5], but am unsure how to check if it's already been used or not, or if it's expired. I see that this information might be part of the UserController class, but I'm not sure how to retrieve that.


texts: How exactly does module_load_include() load a file into the calling script?

texts:
Here is the code:

function module_load_include($type, $module, $name = NULL) {
  static $files = array();

  if (!isset($name)) {
    $name = $module;
  }

  $key = $type . ':' . $module . ':' . $name;
  if (isset($files[$key])) {
    return $files[$key];
  }

  if (function_exists('drupal_get_path')) {
    $file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type";
    if (is_file($file)) {
      require_once $file;
      $files[$key] = $file;
      return $file;
    }
    else {
      $files[$key] = FALSE;
    }
  }
  return FALSE;
}

module_load_include() is just a function that calls require_once from within itself to load an external file. But it seems to me that require_once should load external file into module_load_include() and subsequently, this loaded file should disappear when module_load_include() goes out of scope. Somehow "magically" the external file is successfully loaded into the calling script(eg: a page callback function) that calls module_load_include(). I don't understand how this is achieved.


texts: Sage 50 (Formerly Peachtree) integration question

texts:
I need to work on a membership website that needs to connect to a Peachtree database in order to verify the user's current balance. I've never worked on this kind of projects before and I am unable to find any kind of information between Drupal and Peachtree. Does the client needs to upgrade to Sage 50 in order to make this happen or can this integration still be done using Peachtree?

Thanks a lot!

Johann


texts: How can I use render arrays to programmatically create a chart in a block?

texts:
I'm programming a block in Drupal 8:

class B extends BlockBase implements BlockPluginInterface {
  public function build() {
    return []; // cannot figure out what to return here
  }
}

I read that in D8 a block's build function should return a render-array, like this:

return ['#markup' => 'Some HTML'];

Then in the Charts source code I found some examples here and there, especially in PHPDOC comments, so I built a render-array like this:

$return = [
  ‘chart’ => [
    '#type' => 'chart',
    '#chart_type' => 'line',
    '#chart_library' => 'c3',
    'xaxis' => [
                    '#type' => 'chart_xaxis',
                    '#title' => 'XTitle',
                    '#labels' => range(1, 10),
                ],
    'yaxis' => [
                    '#type' => 'chart_yaxis',
                    '#title' => 'YTitle'
                ],
    'series_1' => ['#type' => 'chart_data', '#title' => $seriesTitle,
                    '#data' => range(1, 10) ],
    // more series here keyed series_2, series_3 etc
  ]
];

Nothing is output (only block title).
No JS errors in console.
No error logs.
Example chart in demo module works, C3 is installed.

What am I doing wrong?

Versions:

Drupal: 8.4.2
Charts: charts-8.x-3.0-alpha6


texts: Is it possible to populate a field entity reference with query parameters?

texts:
I created an entity reference field for a node filtered by a view type "entity reference", but I need to pass an argument in the contextual filter of this view, to filter entities on my field.

I tried passing my argument on the URL in a query parameter (e.g. node/add/page_interieur?dossier=2), but I never get results in my field autocomplete.

Is it possible to do that with this method or another one?

Settings for the contextual filter with the Query parameter option

Settings for the Entity reference field


texts: How to get entity from transliterated argument in URL?

texts:
I have panel, where I have argument: taxonomy term name

term names are transliterated (like "My custom taxonomy title" into my-custom-taxonomy-title)

path is like this: my-custom-list-of-nodes/my-custom-taxonomy-title

How can I get in PHP code (in some hook) original taxonomy term name from argument "my-custom-taxonomy-title"?

Original string can have diacritics, uppercase, spaces.
How can I detect Term ID from transliterated argument "my-custom-taxonomy-title" ?


texts: MySQL tables full! 'update_cache' and 'block' both, presumably others

texts:
I inherited a D7 site. It's plagued with error messages that I can't quite figure out how to fix.

During my debugging process, I ran into some PDOExceptions where it says my MySQL tables are FULL! The site isn't launched yet, and there should be NO WAY that the tables should be full.

Some random things I've noticed

the update_cache table is full
the blocks table is full
none of the cache_* tables actually clear out when I run "flush caches"

related to this, there's a PDOException that gets squelched when I try to "flush caches." It can only be viewed from the Apache error_log, and it appears that it prevents the menus from being rebuilt (a problem I noticed trying to install a new module)

Does anyone have a clue as to why my MySQL tables would be filling up / why Drupal can't clear them out?

Thank you in advance!


texts: How to automatically enable custom modules upon theme activation?

texts: I have a custom module that I have defined in the [root]/modules/[custom module] directory. I want it to get activated as soon as someone installs my theme rather than handing over user the custom modules folder and asking to manually install that module one by one via the Extend option on the dashboard. How can we get that done in Drupal 8?


texts: How to handle blog tags in a contrib theme?

texts:
In blog or blog-like sites, taxonomy is often used for tags and categories.

In Drupal 6, node.tpl.php files could use the $taxonomy variable if they needed access to an array of unrendered taxonomy links associated with the current node. This variable was often assumed by contrib themes to contain the post tags and\or categories, and it was rendered accordingly.

In Drupal 7, $taxonomy is no longer available.

What's the alternative? How should themers handle taxonomy? In particular, how should contrib themes do it, in order to maximally preserve visual compatibility with the 6.x version?

BTW, the bit about that in the "converting themes to Drupal 7" guide is probably incorrect.


texts: Locked out of Drupal 8 site, and new user can't get in

texts:
I have an odd problem. My new Drupal 8 site is a distro, purchased from ThemeForest. After installing it, I thought I created a new user correctly but maybe the name had disallowed characters. In any case, after logging out for the first time, I can't get back in, even when using the browser-stored un/pw or my stored record. I then created a new user in Drush, elevated it to admin, and still can't get in, saying it doesn't recognize the user. I tried applying for new password, but when I try the link, I get this:

Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.

So then I thought, maybe I should have set my trusted domains to fix the error in the Status Report. I then edited my settings php to set my domain as trusted, similar to what I did for another Drupal 8 site that is side-by-side in the same public_html folder.

However, one difference is that the site I'm now locked out of is being redirected by htaccess. I had to do this because my hosting service by default wants to put my primary-domain site in the root of public_html, and I wanted it in a subfolder, just like the other sites. So I created this htaccess rule to point the main domain to a particular folder:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.mydomain.com$
RewriteCond %{REQUEST_URI} !folderitresidesin/
RewriteRule (.*) /folderwhereitresides/$1 [L]

Those are the most relevant facts I can think of. Now the question is: does this htaccess redirect affect login?  Do I need to do anything to make sure Drupal understands this htaccess redirect? Or is it something else?

I've looked into the "Drupal\Core\Routing\TrustedRedirectResponse" message but that seems to b aimed at redirecting to external urls. I don't see how that applies to me.

Thanks in advance to any good samaritan who can help!


texts:
I have a Page that contains two views one that list the latest news and the other list the latest event

The problem now is that each view has a pager but when I change the page of one of them both view will change.
i.e If I want to see page number 3 in news view,the event view will also change to page number 3

Is there is a way to make that even programmatically
also I don't want to make it ajax because I need to share the url

Thanks


texts: How do I include the main navigation block twice?

texts: How can I put one block, for example the main navigation block, in two different regions. In Drupal 7 this was possible through the Menu Block module, but as this module won't be ported to Drupal 8, I guess there is an other method.


texts: Is it possible to have common content for several users?

texts:
For example, sometimes there is a situation when several project's users need to work with common content not using one account for them.
That is, each member of the group has his own account with his login and password. But they need to have possibility edit and delete data inputed by other member of the group before.
Are there any solutions which can realize it ? And it is desirable to the solution wouldn't be the Organic Groups module or based on creating of a lot of roles.
And if there isn't the solution, how, by you opinion, is the best way to create this feature ? Can one try to use the Relation module and overriding Access control to perform it ?


texts: Drush CC all returning "No Drupal site found, only 'drush' cache was cleared"

texts:
I've tried other solutions, but none of them are specific to my setup. I just started using the new Linux subsystem featured in the recent Windows 10 update. I'm using WAMP x64 v3.0.6, and have successfully cloned my website and got it up and running. At the root of the Linux subsystem, I installed Drush globally with Composer, using the directions given on the Drupal webapage.

Typing drush status returns the following when I run it in my default directory:

Drupal version         :  7.50
 Site URI               :  http://default
 Database driver        :  mysql
 Database hostname      :  localhost
 Database port          :
 Database username      :  root
 Database name          :  aerosphere
 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php5/cli/php.ini
 PHP OS                 :  Linux
 Drush script           :  /home/bob/.composer/vendor/drush/drush/drush.php
 Drush version          :  7.1.0
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  /mnt/c/wamp64/www/drupal-7.50
 Site path              :  sites/default

But, as mentioned in the title, drush cc all returns No Drupal site found, only 'drush' cache was cleared.[warning] I assume it has something to do with adding a path to the .bashrc, but I don't know what to add. Any tips would be greatly appreciated!

My question is different from "Drush - No Drupal Site Found when clearing cache", they're on a Mac and using MAMP, and I'm using WAMP on Windows. I've tried the solutions offered on that post, but the issue has not been resolved.

I'm obviously having issues connecting to MySQL as I get this when I run mysql command:

  The program 'mysql' can be found in the following packages: * mysql-client-core-5.5 * mariadb-client-core-5.5 * mysql-client-core-5.6 * percona-xtradb-cluster-client-5.5

  Try: sudo apt-get install .

So I've added these lines to my .bashrc file:

PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH="/mnt/c/wamp64/mysql/mysql5.7.14/bin:$PATH"

The top line was added to get drush working. I've checked multiple times, and I have the path correctly set, but it's still not working.


texts: Creating node with multiple custom blocks, best method

texts: What is the best method to create a node that includes multiple custom blocks with content related to only this node? The main concern is having a method that content editors will be able to understand with all the blocks related to this node editable from the node edit page for example. Having multiple custom blocks with each having an edit page is really confusing.


texts:
I have a registration form, when submitted, the user gets logged in automatically.

I want to redirect the users to a specific page on login. Whether they are logged in using the login form or through the registration form.

I used the following code first,

function yourmodule_user_login($account) {
  // We want to redirect user on login.
  $response = new RedirectResponse("yourpath");
  $response->send();
  return;
}

This is not working because it's called before submit handlers so this would prevent them from being called.

Then I added a custom submit handler to the login form and redirect the users in that submit handler.

$form_state->setRedirect('mymodule.mypage');

This works fine only when the user logged in using the login form but not working for the registration form. When I use a custom submit handler for the registration and redirect the user there, I think at that time the user is not logged when the redirection occure.

Is there any other method to redirect the users on login through code?


texts: How do I get back JSON value using entityform?

texts:
I am using drupal 7 entityform in this case, as i want CRUD functionality with the form. Can anyone tell me how should i configure my services.

As of now i have configured it manually, selected the REST server, session authentication, Response formatters-json,   Request parsing-application/json, Resources- entity_entityform and user.

But whenever i select

Example:-'http://localhost/drupal7/test/node/2'

where 'test' is my endpoint it shows the json values for my custom article which i created for testing whereas it doesn't show up anything for my entityform

Example:-'http://localhost/drupal7/test/eform/submit/route'

where test is again my endpoint here.
Please help, do i need any special permission for entityform module like creating hook ???
Or should i query it in
 'function entityform_entityform_insert($entityform)'?


texts: How can we enable cache for a page in drupal5 for authenticated users?

texts:
I am using drupal5 for my website. Certain pages in my site are loading very slowly. I came across several posts suggesting to use the caching capabilities of Drupal. After enabling cache pages started loading at a faster rate from cache for anonymous users . How can I improve the performance for an authenticate user? or How can I enable cache for authenticated users, say for a single page?

The page which I am trying to load uses a view and has limited number of filters applied.


texts:
The module is a small custom widget for the entity reference field. It creates a list of nodes that allows for multiple selections.

Is it possible to paginate the results of the query even though this is a widget for a field?

function outfit_builder_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {

///...Additional Code Removed

$query = db_select('node', 'n');
$query->addTag('node_access');
$query->join('field_data_' . $instance['widget']['settings']['image_field_' . $type], 'fd', 'fd.entity_id = n.nid');
$query->fields('n', array('title', 'nid'));
$query->fields('fd', array($instance['widget']['settings']['image_field_' . $type] . '_fid'));
$query->condition('n.type', $type, '=');
$query->condition('fd.delta', 0, '=');
$query->condition('n.status', 1, '=');
$result = $query->extend('PagerDefault')->limit(21)->execute();
foreach ($result as $node) {
  $options[$node->nid] = theme('image_style', array(
      'style_name'  => $instance['widget']['settings']['image_style'],
      'path'        => file_load($node->{$instance['widget']['settings']['image_field_' . $type] . '_fid'})->uri,
      'title'       => check_plain($node->title),
    )
  );
}

$element += array(
'#type'             => 'checkboxes',
'#options'          => $options,
'#attributes'       => array(
  'class' => array('item'),
),

return $element;

}


texts: Drupal - block deleted - how to retrieve

texts:
I just posted this to StackOverflow, but then I noticed this group, so apologies if this is a duplicated question.

We're running version 6.14 of Drupal (old, I know). On of our users recently deleted a block by accident in a series of rotating images. (Administer > site building > block). So now the block shows up as a blank, or "n/a".

She did manage to add another block in its place, but apparently that doesn't help - the n/a still displays. What is the solution to this problem?


texts: Display date picker not inline in Drupal 7 Forms API

texts:
I have installed Date Picker Module and it works fine.

Below is the code:

$form['date'] = array(
    '#title' => t('Select your birthdate'),
    '#type' => 'datepicker',
    '#date_format' => 'd/m/Y',
    '#date_year_range' => '-100:+0',
    '#default_value' => date("Y-m-d H:i:s", time()),
);

I want to display not it inline. I want it to be a textfield and when the focus is on the textfield, the calendar will pop-up. What configuration should I tweak to make it possible? Thanks.


texts: Some custom themes showing twice in theme list

texts:
I have a site using the Domain access module to serve content to 18 different sites, all which have their own domain. I have five different custom themes installed in addition to the stock themes.

For some reason, in my theme list three of my custom themes are showing up twice; each have two screenshots. I have the correct ones enabled and assigned to the proper domains and it's all working fine, I just want to delete those double entries.

The sites/all/themes folder is clean with only one folder per theme and I've cleared caches, pushed live etc hundreds of times and it's not causing any issues, but I'd like to clean it up.

Any ideas? Drupal 6.28.


texts:
How to create a pager to display next article in particular taxonomy? I can not find any module.

I tried to do this with a view. I created a view that display all content from article and add a pager, but then i've got another problem (cant related this with another view from home page that display image and title from all articles and navigate to chosen article)

Sorry for my english.

I have view that displays fields (image and title) from articles with taxonomy term (e.g. Shapes) like this:

When i click on image i go to this article:

but I dont know how to do pager like on this picture that could navigate me to next article:


texts: How to sort taxonomy terms on a term reference field?

texts: I have a taxonomy term reference field on a node. On the "node/add" page I would like to sort the terms by "due date" (a field added to that vocabulary).


texts: D7: How to loop an array as form elements?

texts:
I have the following hook_form (below) which colect data from $_POST and then send them via email. The problem is $jcartItemName and $jcartItemPrice are arrays so I need to loop through them and display the form items accordingly. I expect this could be done via a

foreach($jcartItemName as $value) {
    $form['jcartItemName'] = array(
    '#type' => 'textfield',
    '#value' => isset($value) ? $value : '',
    );
}

but how do I do that effectively. Thanks!

function checkout_form($form, &$form_state) {
     $jcartItemName = $_POST['jcartItemName'];//array
     $jcartItemPrice = $_POST['jcartItemPrice'];//array
     $jcartTotalPrice = array_sum($jcartItemPrice);//integer
     $form = array();
     $form['#action'] = "";

    $form['jcartItemName'] = array(
    '#type' => 'textfield',
    '#value' => isset($jcartItemName) ? $jcartItemName : '',
    );

    $form['jcartTotalPrice'] = array(
    '#title' => t('TotalPrice'),
    '#type' => 'textfield',
    '#value' => isset($jcartTotalPrice) ? $jcartTotalPrice : '',

    );

        $form['email'] = array(
        '#type' => 'textfield',
        '#title' => t('E-mail'),
        '#default_value' => "",

        '#description' => "Please enter your e-mail for order to be sent.",

    );

    $form['send-order'] = array(
        '#type' => 'submit',
        '#name' => 'send-order',
        '#value' => t('Send Order'),
        '#class' => 'button',
    );

    return $form;
  }


texts: How to call limited data items per page?

texts:
I am using one custom module, which is getting data from the database, with the following code.

function rs_get_doors() {
  $doors = array();
  $doors_nids =  db_select('node', 'n')
  $doors_nids = $door_nids->extend('PagerDefault')->limit(10);
    ->condition('n.type', 'vivarium_door')
    ->fields('n', array('nid'))
    ->orderBy('n.title', 'ASC')
    ->execute()
    ->fetchCol();

  foreach ($doors_nids as $nid) {
    $wrapper = entity_metadata_wrapper('node', $nid);
    $doors[$nid] = array(
      'name' => $wrapper->title->value(),
      'fee_nid' => $wrapper->field_fee_category->value()->nid,
    );
  }

  uasort($doors, 'rs_doors_natural_sort');

  return $doors;
}

it is getting thousands of nodes at time in a single page and it takes too much time to load.

So I think I need to paginate the query. How can I achieve this?


texts: Can the same entity type (bundle) have different fields in different instances?

texts:
I have a question about adding fields to an entity I've defined in a drupal 7 module upgrading from d6 which has 4 types.  The modules get a list of fields from a 3rd party server and if the user enables them through the admin interface they are added to the node object as cck fields before the node gets saved.  Can I add fields to a bundle in a similar fashion using field_create_instance?  Is it okay if the same type entity has different fields in different cases, or does the field get added to every entity of that type once it's added?

There are different resources (think data coming from different servers with potentially different fields) each with the same 4 entity types, and different fields could be enabled for each resource.  I'm considering adding the fields which are enabled to the entity before it is saved.  Entity type 1 could have different fields selected for resource 1 and resource 2.  This is the first time I have used d7 entities which is why I'm asking how they work.


texts: Views: how to add rel attribute to multivalue image thumbnail

texts:
I know about lightbox module, but I need a universal solution working with more than one jQuery plugin.

There is a view with image field displayed as a thumbnail and I'd like to link it to the normal image, and the link should have "rel" attribute.

How to implement it in the simplest way?

In the View->Fields->myfield properties, the first option (Link image to File) won't work because there is no option to insert "rel" attribute.

The second option is to REWRITE RESULTS and "Output this field as a link" and insert "lightbox" as a rel text. But what to write in the "Link path" textbox??

The path to image is: /sites/example.com/files/gallery/img1.jpg

How to obtain the "/sites/example.com/files/" path other than just
hardcode typing it? (it's a public:// stream)
How to obtain the "img1.jpg" image name? I tried [field-image]
replacement token but didn't work and there seem to be no fields that look like the file name.


texts: How do I block google analytics from my development sites?

texts: Is there a way (in code or configuration) that I could prevent google analytics from collecting visits on any of my development websites?


texts: How to fetch User from Entity Reference in Rules? (to obtain email from a user field)

texts:
I'm using an Entity Reference field with select list, target type User

(so a user can be selected and saved as event organizer)

How can I fetch the actual email (instead of name) so i can use it in send mail as recipient?

I tried using [event-node:field-eventorganizer:uid] as the token but doesn't work.
Also tried to add a Fetch by entity User in hope that could make the mail token available from that user field.

FYI-I checked the nodes fields and the user ID is definitely in the field

field_eventorganizer (Array, 1 element)
und (Array, 1 element)
0 (Array, 1 element)
target_id (String, 2 characters ) 43

I read tons of posts and tried many options but just couldn't figure it out, please help.


texts:
This is my custom form with working add more and dummy delete button.

function mymodule_mycustom_form($form, $form_state){
   $form['checkboxes_fieldset'] = array(
    '#prefix' => '
',
    '#suffix' => '
',
    '#type' => 'fieldset',
    '#description' => t('This is where we get automatically generated textfield'),
    '#tree' => TRUE,
  );
  $form['checkboxes_fieldset']['number'] = array(
      '#type' => 'textfield',
      '#title' => 'number',
    );
  // dummy delete button
  $form['checkboxes_fieldset']['delete'] = array(
      '#type' => 'submit',
      '#value' => 'delete',
  );
  $form['add'] = array(
    '#value' => t('add more?'),
    '#type' => 'submit',
    '#ajax' => array(
      'callback' => 'mymodule_add_callback',
      'wrapper' => 'checkboxes-div',
      'method' => 'append',
    ),
  );

  return $form;
}

This is ajax callback for add more button

function mymodule_add_callback($form, $form_state) {
  return $form['checkboxes_fieldset'];
}

Now i want a working delete. But dont know how?


texts: Check effect of hook_schema_alter() hook

texts:
I want to alter the comment subject field title width.

Core comment module sets it to 64 characters, and I want to change it up to 100 characters.

Now I tried to alter the schema using hook_schema_alter() function. Below is my code snippet, which I tried,

/**
 * Implements hook_schema_alter().
 */
function comment_alter_schema_alter(&$schema) {
    if (isset($schema['comment'])) {
        $schema['comment']['fields']['subject'] = array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The comment title.',
        );
    }
}

I am confused whether do I have to write some stuff in .install file or not?

Now after installing module how can i check whether the width of subject field is increased or not. If I see the comment table then it is as it is to 64 characters. I could find this in your table structure using PHPMyAdmin.


texts: Ubercart email notification to store owner when order submitted

texts:
I am new to Ubercart (we are installing and configuring on a Drupal 6 site) and have all of the store built out. I am attempting to set up a notification email to the store owner when an order is placed. I would think this is a built in configuration for ubercart... however for the life of me I can't find it.

Is there an Ubercart extension module which does this? Or should I configure this through Rules? I know there must be an existing and proven method for this in Ubercart somewhere.


texts: How to redirect a node to an external URL?

texts:
Is there a way to "alias" a Drupal site node to an external URL?

I'd like that a click on a link in my Drupal site like 'http://mysite/node/64' redirects to an address like 'http://anothersite/whateverurl'.

I use Fullcalendar View module.
I added a Date range field to a custom content of mine (my modified Basic page).
If I set a date in a node of that type, I can see an item linked to it in the Calendar:

If I click on the item, I am redirected to the corresponding node and I see its content.
For some nodes, I'd like the link to point to an external url instead...

[Edit]
I tried something else: I created a new View with no fields at all except the Daterange.
When I use Format: Unformatted list, I get this result:

which is OK as I have only one node of the type filtered.
When I use Format: Full Calendar Display, I get this result:

which is strange as I have no fields in the View description pointing to the node itself...
Does it mean that Fullcalendar View] module generates its magic elsewhere?
I'm a bit confused :-(
Any help?


texts: How to fix incorrect forum post count when using internalization and locale?

texts:
Using (among several other contrib modules)

Forum
Locale
Advanced Forum
Internationalization

My forum topic nodes are set to be localized and I've set translations for the Forum Vocabulary and all the terms. The forums work well with Internationalization after I modified some of the views and added a 'Content: Language (= Current user's language)' filter.

However the Topics count in the main forum page is incorrect, it doesn't take into account the language, so we  see a higher count than we should.

For example:
https://freshwaterwatch.thewaterhub.org/forum

The 'Meet & Greet' forum has five topics but when you enter you only see two topics: https://freshwaterwatch.thewaterhub.org/forums/meet-and-greet

What happens is that if you click on the French language you see one and two more in the Spanish language, that's why the count for the forum is 5 but you should instead see a count of 2 when browsing the site in the default english language.

Does anyone know how to solve this or a workaround?


texts: How to use Context with Views' Contextual Filters

texts:
I have content type City. I have a view page with contextual filters to show the cities at the URL pattern locations/<city id>. I want to use Context to add blocks to these cities pages but I dont seem to be able to figure out how to get it done.

In D7 I used the Context Request Path to be able to do this. In D8, I dont see how this is possible.

The Request Path condition only checks internal URLs which I think is useless for me since there is no pattern that can isolate the city pages. The Node Bundle doesnt work because the page is technically a View and not a Node.

How can I use Context to place blocks on a view page that uses contextual filters?


texts: How to make the User Profile Picture persist after the validation error?

texts:
Users update their profile pictures, and click on Save. If there is any validation errors, the picture is removed.

Is there any way to make the picture persist after the validation error?