texts: How to display external data using custom form in a Drupal page?

texts:
I have created a form custom module for get data from an external url.

$requestType = drupal_http_request('http://www.example.in/php/example/getSampleType.php',$options);
$loomType =drupal_json_decode($requestType->data);

This is my Form

Using this result I have created checkboxes and select a value from checkbox then submit the data.

function myForm_form_submit($form, &$form_state) {

$form_state['rebuild'] = TRUE;
$url='http://www.example.in/php/example/exampleSort.php';
//$data1 = http_build_query($form_state['values']['check'], '', '&');

$checked = array();
foreach($form_state['values']['check'] as $key => $val) {
array_push($checked, $val);
  }
$mychecked=checking($checked);

$checkedType = array();
foreach($form_state['values']['checktype'] as $key => $val) {
array_push($checkedType, $val);
  }
$loomType=checking($checkedType);

$datas=array("sampleMachine"=>$mychecked, "sampleType"=> $loomType);
$data =json_encode($datas);
$option = array(
            'method' => 'POST',
            'data' => $data,
            'headers' => array('Content-Type' => 'application/json'),
    );
//$headers = array('Content-Type' => 'application/json');

$response =drupal_http_request($url,$option);

echo "<pre>";
print_r($response);
echo "</pre>";

}

I got some result. Now I want to display those results in my drupal page. How can I do that..I am using Drupal 7.

I want to display this in Drupal page in specific format


texts:
When a user registers an account I would like to create an invoice (this is a content type) and send it as a pdf to the user. But I have no clue how I can send the invoice to the user... .

I know you can send a mail, but how to include the invoice I have no idea.

I've searched on the internet but no luck ... .


texts: Made a local copy of live-site: all paths generate error 404

texts:
Drupal version: 6

I've made a local copy of a site that is live, has loads of content and is configured to run in the Kurdish language.

Steps I did to accomplish this:
- Made a tarball of the Drupal installation and extracted it on my localhost
- Dumped the live-database and imported it locally
- Modified settings.php to reflect local database settings

When browsing to the local installation, the front-page seems to work fine (except for a few pictures not showing up, as well as the facebook like box generating a 404 error). Except: when clicking on any url, of any node-type, a 404 error is generated.

I tried to fix it with this proposed solution: http://www.paulmarc.org/learn/drupal/rebuilding-site-urls, but to no avail. It seems to me I have to rebuild the site, however: even invoking that path does not work and generates a 404 and is thus inaccessible.


texts: form error Fatal error: Cannot use string offset as an array

texts:
It's pretty stright forward, im trying to display the results of my form, Im having trouble finding something that explains how to display the results outside of the  drupal_set_message() code, I think I am close with my current code.However I am getting this error Fatal error: Cannot use string offset as an array

/**
 * Block info
 */

function zillow_block_info(){
    $blocks['zillow_block'] = array(
        'info' => t('Zillow Block'),
    );
    return $blocks;
}

function zillow_block_view($delta = ''){
    $block = array();
        switch ($delta){
    case 'zillow_block';
        $block['subject'] = t('Zillow Block');
        $block['content'] = drupal_get_form('zillow_form');
    break;
    }
    return $block;
}

/**
 * Api info
*/

function zillow_api_info($form, &$zinfo){
    set_time_limit(3600);
    $state = $zinfo['values']['state'];
    $zillow_id = 'XXXXXXXXXXX';
    $xml = file_get_contents('http://www.zillow.com/webservice/GetRateSummary.htm?zws-id='.$zillow_id.'&state='.$state.'');
    $zinfo = simplexml_load_string($xml);

    foreach($zinfo->response as $rates){
        $zinfo .= $rates->today->rate[0];
        $zinfo .= $rates->today->rate[1];
        $zinfo .= $rates->today->rate[2];
        $zinfo .= $rates->lastWeek->rate[0];
        $zinfo .= $rates->lastWeek->rate[1];
        $zinfo .= $rates->lastWeek->rate[2];
    }

    return $zinfo;
}

/**
 * Form
 */

function zillow_form($form, &$zinfo){

    $form['description'] = array(
        '#type' => 'item',
        '#title' => t('Get your mortgage rates'),
    );
    $form['rates'] = array(
        '#type' => 'fieldset',
        '#title' => t('Mortgage Rates'),
        '#collapsiable' => TRUE,
        '#collapsed' => FALSE,
    );

    $form['rates']['state'] = array(
        '#type' => ('select'),
        '#title' => t('Choose One'),
        '#options' => array(
            'AK' => t('Alaska'),
            'AZ' => t('Arizona'),
        ),
        '#required' => TRUE
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Submit'),
    );
    if(isset($zinfo['values'])){
        $form['page_output'] = array(
        'markup' => 'Submitted value:'. $zinfo['values']['state']);
    }
    return $form;
}

/**
 * Submission Output
*/

function zillow_form_submit($form, &$zinfo){
  drupal_set_message(t('this is the info the form has submitted. states=@states, todaysrates=@todaysrates', array('@states' => $zinfo['values']['state'], '@todaysrates' => zillow_api_info($form, $zinfo))));
  $zinfo['processed']['states'] =  serialize($zinfo['values']['state']);
  $zinfo['processed']['todaysrates'] =  serialize(zillow_api_info($form, $zinfo));
}

Edit** My code has been modified I am now only getting this error


texts: url redirections not working for anonymous users - redirecting to homepage

texts:
I have set a redirect rule in EventSubscriber. So according to rule, when I hit [example.com/my-page][1] in browser, it should redirect to [example.com/success][1] or some external url also.

But issue is(for anonymous user):

On hitting first time this url "[example.com/my-page][1]", REDIRECT SUCCESS!!
But on second time it does not redirect. It remains "[example.com/my-page][1]" only.

Now If I logged in, flush all cache, then again log out and check "example.com/my-page", it again works -- REDIRECT SUCCESS!!
But again after redirecting first time when accessed the same, it stops redirecting.


texts:
Within a view display, I am trying to display only the first name of a customer.  The information is collected via a standard addressfield form.  Within the available "Replacement Patterns" none of the tokens created in addressfield.tokens.inc are available.

This is the thread in which the functionality was added: https://www.drupal.org/node/1188778

The name of the field is commerce_customer_shipping - am I missing something by trying to use [commerce_customer_shipping:first-name]?

Thanks!


texts: Pass variable from custom module to twig template

texts:
How can I pass a variable from my custom module to a twig field template?

my field template is the "field--node--field-webform--parliament-visit.html.twig"

and my module is named as "custommodule"

I tried this function according to documentation but apparently I didnt understand smth correctly:

  function custommodule_preprocess_field_node_field_webform_parliament_visit(array &$variables) {
    $VARIABLE_NAME = 'my_variable';
    $variables['varname'] = $VARIABLE_NAME ;
  }


texts: DraggableViews not displaying drag-handles

texts:
I installed the DraggableViews module on Drupal 8.
On one of my views, I replicated the page that I currently use to display the content that I want.
I renamed the new page adding "Admin" to the title
Then I follow the instructions I found on various places:

Change the Admin block Format section and choose Table.
Add the field "Draggableviews: Weight" at the Fields section, place it after the "Content: Title" field.Make sure not to check "Exclude from display". Please note that the instructions mention the "Draggableviews: Content" field but I don't have this option (Is there something wrong here?)
Add "DraggableViews: Weight" at the Sort criteria section and place it as the first Sort criteria.
Save the view.

then I get a page the list all my items, show the weight of each of the items (0 by default) but I can't change the weight and no drag-handles are shown.

Any help?


texts: How do I create a custom search and filter?

texts:
I have created a custom module to render forms on the front end (modules\custom_mod\src\Form\Contact\ContactUserForm.php) and stored the form values to a custom table.

I have also created a listing (admin end) of the stored data from table which I acheived with the help of controller (modules\custom_mod\src\Controller\Contact\ContactController.php).

In that listing, I have the Edit and Delete actions based on the ID from the table.

The file structure is below.

modules/custom_mod/
├── js
├── css
├── custom_mod.routing.yml
├── custom_mod.info.yml
├── custom_mod.module
├── custom_mod.libraries.yml
└── src
    ├── Form
        └── Contact
            └── ContactUserForm.php
            └── ContactUserStorage.php
            └── ContactAdminForm.php
            └── ContactAdminEdit.php
    ├── Controller
        └── Contact
            └── ContactController.php

Now I need a search box, a From date and To date filter, with an Export (CSV) button above the listing, so that the administrator user can filter or search accordingly.

How can I achieve this?


texts:
I need to send users to the user/me/edit page to change their password when they log in the first time and also in cases of password reset.  The rest of the time they need to go to an internal dashboard page.

What is the best combination or single module to accomplish this?  I've tried numerous combinations of login destination and login toboggan as well as each on it's own but can't get it right.

Both my register and login forms are on my homepage.


texts: Webform 6x 3.11 - custom code to determine value of webform field

texts:
I intend to pass a predetermined NodeID into a webform through URL querystring like so:

www.mysite.com/forms/my-form?nid=43

On the webform, one of the field values must be calculated by getting the Node Title based on what the nid is. I want to use a textfield, so that it can be one of the values submitted in the email. Can this be achieved?...because from what I see, the "default value" box only allows for a few tokens and no custom code. Furthermore I don't want to pass in the NodeTitle directly in the querystring for 2 reasons:

It will contain spaces and therefore will not be  URL encoded, and
I want to avoid people tampering with the querysting

Here's hoping some drupal guru can come to my rescue!  thanks in advance!


texts:
Why should you use theme(), rather than calling the theme functions directly?

theme('box', $title, drupal_get_form('comment_form', $edit, $title));

Why doesn't the code call the theme function directly, as in the following code?

theme_box($title, drupal_get_form('comment_form', $edit, $title));


texts: Filter view by users without a matching record in the related userpoints table

texts:
I found out that I'm getting a much better query performance if I use an INNER JOIN of users and userpoints compared to a LEFT JOIN.

Currently, new users have 0 userpoints when they register, I'll change that to 1 point with a rule.

To add 1 point to all users with 0 points I was thinking of using a view and Views Bulk Operations.

To get to "the point":
I can't filter the view to show users with 0 points because they don't have a record in the userpoints table. This is the SQL that views tries to generate:

SELECT ..
FROM
{users} users
LEFT JOIN {userpoints_total} userpoints_total ON users.uid = userpoints_total.uid
WHERE  (userpoints_total.points = '0')

I don't think it's possible to generate a query with views to find users without a record in a related table? Or is there a trick?


texts:
I am writing a custom module to load the crossfilter.js library in Drupal 7. I have followed what I believe are the right steps to doing that when using the Libraries module API.
However when I run drush libraries-list all I get for my library is 'not detected'

Below is my sample code. I intend to load version 1.3.7 of the library and already I have a directory called crossfilter and I have the crossfilter.js and crossfilter.min.js files in that directory.

What could I possibly be doing wrong?

function crossfilter_libraries_info() {
$libraries['crossfilter'] = array(
  'name' => 'Crossfilter JS',
  'description' => 'Crossfilter JS integration for Drupal',
  'download url' => 'https://github.com/square/crossfilter/archive/master.zip',
  'vendor url' => 'http://square.github.io/crossfilter/',
  'version arguments' => array(
      'file' => 'crossfilter.min.js',
      'pattern' => '/version="(\d+\.\d+\.\d+)"/',
   ),
  'files' => array(
      'js' => array('crossfilter.min.js'),
    ),
  'variants' => array(
      'source' => array(
          'files' => array(
              'js' => array('crossfilter.js')
            ),
        ),
    ),

);
return $libraries;

}


texts: How do I add a link to a rendered entity?

texts:
I have a custom entity, sample. I’ve used the entity display settings interface to set how I want this entity to display on the screen. However, I would like to add a link to another route when it is rendered. To accomplish this, I created a controller to render the sample entity outside the admin space, and added the correct link to my other entity. The problem I am now having is, I have other entities (e.g, batch) that contain entity reference links to samples. When these entities are rendered, the samples are created with links to the sample.canonical route, which is still in the admin area.

I can think of a few ways my problem could be solved. Which of these should I do?

I can somehow modify sample.canonical to include the necessary link. (Don’t know how to do this)
I can create a custom field formatter to render the sample with a different link.
Alter the batch entity to use a different route when rendering Samples (don’t know how to do this)

The first option seems the most flexible. I assume I need to work with the entity twig template, which I’ve tried but have not seen any changes appear on-screen.

Any advice? Is there an easier way I don’t know about?


texts:
I have seen a lot drush setups in the past and every setup had a stage server configuration Is there a reason why thay have

a development server
a stage server and
a productive server

What are the advantages if you have a sage server and must there be such a server osr is this optional?


texts: How do I get a list of all CSS and JS that are attached to a page?

texts:
In Drupal 8, how do I get all CSS and JS that is attached to a page? In Drupal 7, I could use drupal_add_css() or drupal_add_js() without arguments, to get an array containing a list of all the files/inline added to a page.

I'm developing a module that will display a "preview" of the block on block configuration page. The method I chose is displaying the block code in a <iframe>, but to be properly styled, I need to output all styles with it. This is why I want to read all possible CSS/JS in this "preview" page controller.


texts: How can I Make my module templates available to a theme

texts:
In my module I use hook_theme to specify some custom templates that I use.

they are stored here.

sites
 - all
  - modules
   - mymodule
    - mytemplatefile.tpl.php

Is there a way I can put mytemplatefile.tpl.php in the template directory and have my module use it.  I would like to be able to create the template file here so the designers can easily update it.

sites
 - all
  - theme
   - mytheme
    - mytemplatefile.tpl.php

I tried just copying it in there but my module still uses the template file in my module directory.

This is my Theme function

function bcscourses_theme(){
 //global $theme_path;

$themes = array(
 'bcscourses' => array(
   'arguments' => array('Course' => array()),
  // 'path' => path_to_theme(),
   'template' => 'coursetheme'
 ),
 'bcscourses2' => array(
   'arguments' => array('Course' => array()),
   'path' => drupal_get_path('theme', 'aqua'),
   'template' => 'coursetheme2'
 ),
 'bcscourses_title'=> array(
   'arguments' => array('CourseTitle' => NULL),
   //'path' =>
   'template' => 'coursetitle'
 ),

 'bcscourses_detailsblock' => array(
   'arguments' => array('Course' => array()),
  // 'path' => path_to_theme(),
   'template' => 'coursedetails_block'
 ),
 );
// print_R($themes);
 return $themes;

}

I could only get it to work by setting

 'path' => drupal_get_path('theme', 'aqua'),

When I don't set the path explicitly, it simply doesn't pick up the theme file, it will only pick up the module file.  I cleared caches every time.

Can this be done?


texts: Using Features with an existing content type?

texts:
I'm trying to use features to deploy some changes from a local development site to a staging site on a seperate server, the problem is that I've got an existing content type on my dev and staging environment, let's call it hero_feature.

Here is an example breakdown of the fields that exist in this content type on both dev and staging:

Dev

Hero Type (Machine Name: field_hero_type)
Main Image
Main Title
Sub Title

Staging

Main Image
Main Title
Sub Title

So there's a field on my dev environment (Hero Type) that I want to transfer from Dev to Staging using features. I'm not sure if it's significant but it's a text select widget.

I've tried creating the feature in a number of ways (selecting the content type itself in one instance, and only the fields that need transferring in another) but every time I get the same error message, which is something like:

  DatabaseSchemaObjectExistsException: Table
  field_data_field_hero_type already exists. in
  DatabaseSchema->createTable() (line 657 of
  /sites/drupal/includes/database/schema.inc).

Which I understand is because the code is trying to create the content type for the field when it already exists.

This is really starting to drive me crazy.

Is it possible to do something like this with Drupal features? Or should I have featurised this before initially deploying to staging in the first place?

(I realise that in my example I could rather easily replicate the changes manually on the staging site, but in reality I have a number of fields and other changes that need porting over to the Staging site, and I'm not happy with manually making these changes everytime something like this needs deploying.)


texts:
Requirements for user submissions are:

anonymous user is able to submit form data
admin can delete any submission
admin can edit any field of any submission
form can contains fields which are not displayed to user, but admin can edit them
admin can sort and filter the submissions according to one field (date type)

There is webform module, but I do not know if it can solve all those requirements (the first one is OK, ofc ;)


texts: Can you add a new state to Drupal 8 Workflows module through custom module?

texts:
Is it possible to add a new state (and transitions) to an already existing Drupal 8 Workflows through a custom module?

And can we were to apply this to all workflows available?

Or is it possible to add new state to existing workflows through code?

Update:-

I use module described as following link:- https://www.drupal.org/docs/8/core/modules/workflows/overview

I was able to add workflow element with below code, but is that correct way?

\Drupal::configFactory()->getEditable('workflows.workflow.standard')->set('type_settings.states.perform_check',array("published"=>false,"default_revision"=> false, "label"=>"Perform Check","weight"=> -3))->save();

It added "perform_check" state with below settings:-

published: false
default_revision: false
label: 'In Performance Check'
weight: -3


texts: How to Collapse "Locale settings" (TimeZone) in User Profile with hook_form_FORM_ID_alter();

texts:
I cannot seem to get "Locale settings" fieldset to collapse using hook_form_FORM_ID_alter().

Here is what I've tried so far.

function fsrsys_form_user_profile_form_alter(&$form, &$form_state, $form_id) {
    $form['timezone']['#type'] = 'fieldset';
    $form['timezone']['#collapsible'] = TRUE;
    $form['timezone']['#collapsed'] = TRUE;

    $form['#after_build'][] = 'user_profile_form_afterbuild';
}

function user_profile_form_afterbuild($form, $form_state) {
    $form['timezone']['#collapsed'] = TRUE;
    //dd($form['timezone']['#collapsed']);  // <-- shows '1'
    return $form;
}

The fieldset is still 'open.'

For good measure, I've cleared both the Drupal cache and the browser cache twice.

What am I doing wrong?


texts: How to get entity Translation's title in Twig

texts:
i am trying to get row title -node title- in my custom module
with  template_preprocess_modulename_view($variables) and views-modulename-view.html.twig with using

row.content['#row']._entity.title.value

but it always return node title of translation source.

how can i get correct node translation title in twig?

--

update:

i am going to clarify my problem:

i have a view which returns nodes without any condition-
example of returned output is like:

- 'title of node 1 in english'
- 'title of node 1 in french'

i want to  manipulate title in twig but
row.content['#row']._entity.title.value returns always node 1 in translation source language. -in this case english-

is it possible to get exact title of row -considering translation and language of returned row- in twig?

update 2

in template_preprocess_modulename_view($variables) i tried:

  $rows = $variables['rows'];

  foreach($rows as $index=>$value){
    if (isset($value['#row'])){
      $row=$value['#row'];
      var_dump($row->_entity->get('langcode')->value);
    }
  }

but $row->_entity->get('langcode')->value returns language of translation source of row, not language of row itself.


texts: Drush 9 - Destination Argument Does Not Exist

texts:
I've been struggling a lot with Drush 9 sql:sync the past few months. I've gotten it to work a few times, but I've been stumped by this most recent problem:

$ drush sql:sync @prodv2 @local --debug
Using the Drush script found at /Applications/MAMP/htdocs/ianmoffitt/vendor/drush/drush/drush using proc_open
 [preflight] Config paths: /Applications/MAMP/htdocs/ianmoffitt/vendor/drush/drush/drush.yml,/Applications/MAMP/htdocs/ianmoffitt/drush/drush.yml
 [preflight] Alias paths: /Applications/MAMP/htdocs/ianmoffitt/web/drush/sites,/Applications/MAMP/htdocs/ianmoffitt/drush/sites
 [preflight] Commandfile search paths: /Applications/MAMP/htdocs/ianmoffitt/vendor/drush/drush/src,/Applications/MAMP/htdocs/ianmoffitt/drush
 [bootstrap] Bootstrap to none [0.13 sec, 8.14 MB]
 [bootstrap] Drush bootstrap phase 0 [0.13 sec, 8.14 MB]
 [bootstrap] Try to validate bootstrap phase 0 [0.13 sec, 8.14 MB]
 [error]  The "destination" argument does not exist. [0.13 sec, 8.19 MB]

Can't find anything online towards this specific error message. Not sure what I'm missing or what to even check.

Again, this command worked about a week or so ago. All I've done since then is run composer update. Did something change recently?

Using Drush 9.3.0.


texts: How to create a search block for other nodes that points to an existing search view node?

texts:
I have a node that has a view with a search form in it.  There is another view under it that displays the results.  This is our "search page."

Now, we'd like to add a block with a search field with a submit button on to our sidebar for the rest of the site.  This way you can search anytime while browsing the website's other pages.  When you search in the block and hit submit, you should be taken to the search page with the results displaying.

How do I do this?
It sounds easy enough but I can't seem to find the answer googling.


texts: Modules or install profile for scholarly peer review

texts:
Are there any modules or installation profiles available to create a peer-review system, such as used by academic journals and conferences? I've found lots of discussions on Drupal.org but no actively maintained modules.

Update: here is an example of a commercial system showing the kinds of features I'm looking for.


texts:
I have a website coming up soon and the editors for this website dosen't know how to use Drupal. I have made a content guideline for users to follow(guideline for like uploading content and such), now I want this guideline to appear on the website for only certain roles to view. In my example the role editor has the only permission to view this content and no one else.

Do you guys got any clue of how to fix this and also where I should place it? On their account page or just in the navbar?

Thanks for any tips and advice


texts: Adding values to referential entity using REST API POST

texts:
I have 2 custom content type. One is movies and the other is actors. I am using REST API POST to add values into movies. Actor is a referential entity within movies. How do I add values into actors which are corresponding to a particular movie when I use POST?

An option that I am currently trying out is add multiple values into actors first and that POST will return a node id, use that node id value along POST values to movies. Is this the right approach?


texts: Change text on "Create new Account" button makes administration created user registration fail

texts:
In the form provided by user_registration_form(), I modified the text for the "Create New Account" button to "Sign me up!" via the following code:

$form['actions']['submit']['#value'] = t('Sign me up!');

Creating a new account as anonymous user from the main site works fine: new button text, customized validation and submission included. Now, if I want to create a new user as administrator via "People -> 'Add User'," the form and button are correctly displayed, but NOTHING happens once I hit the button! Somehow, all validation and submission routines seem to be deactivated by renaming this button. Do you have any idea why this is happening?


texts:
I am trying to use a simple Leaflet Map, which gets its markers from a AJAX feed and I have got it working on a basic HTML page outside Drupal.
But when I try to use it from Drupal, only an empty (gray) map window presents itself.
I have tried to use it in a paragraph currently with the following simple contents:
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>

Map

That is basically/exactly what Leaflet site suggests but it seems not to work in this context and I just don't understand why.
I need only this map on the site, so almost anything working would do... Only I don't seem to get anything working.
I know embedding the css and js-scripts to the paragraph itself is far from the perfect solution, but I just don't grasp, how to get anything using library tp work, I keep getting L is not defined, if addingthe js in the end of the body and if forcing it to the header, there comes another error about Drupal-function.
I could use IFrame with my already working implementation, but as it is in the bottom of my favorites I would prefer any other solution over it.
Could anybody help me?
With best regards
Hank


texts: User profile view - 2 x variants or view panes with args?

texts:
I've overridden the User profile template to display custom fields for the user view in Panels, I need to have a View listing with a filter of user comments by 'date' or 'conversation' this I am comfortable with only problem is the filter results list very different info. My approach in resolving this is to have two separate views and create two dynamic links to filter by 'date' or 'conversation'.

I know I can create two variants within the one panel or alternatively two separate panel panes which can accept arguments; only problem is Im not sure what to pass to have one panel pane or panel variant override the other. So when user clicks on 'date' variant x loads when user clicks on 'conversation' variant y loads, or something like that..

Do I achieve this using 'selection rule', 'contexts' or what? Please help...


texts: Use Google Analytics to Track Home Page Links Differently

texts:
We use Google Analytics on our Drupal website. We are re-doing our current homepage and we would like to track the links on our homepage separately from the rest of the tracking. For instance, if you navigate to the "Contact Us" section from anywhere on the website except the homepage, it logs it as such. However, if you navigate there directly from the homepage, it notes that the person arrived there from the homepage and there is pretty much a separate statistic for this.

We would like to see where people are drawn to when they land on the homepage, so this is why we would like to implement this.

Alternatively, if Google Analytics can't do this, is there another potential solution?


texts:
I installed in my PC drush 8 for develop on Drupal 8, but I need drush 7 for connect with my sites on remote servers.
I download manually drush 7 but when I try to open said me:

  Unable to load autoload.php. Drush now requires Composer in order to
  install its dependencies and autoload classes. Please see README.md

Then, How I install two versions of Drush in my PC?


texts: How do I disable the "Group activity" tab on the organic groups page

texts:
I've got organic groups setup in Drupal 6 and have been asked to remove the "Group activity" tab from the groups page (example.com/og). I suspect that this is being driven by one of the views, but I can't seem to find one that is powering it. Is it possible to disable this tab or control its output at least?

This tab appears to have been removed from the Drupal Groups site: http://groups.drupal.org/og


texts: entityform view filtered by current user field (term reference)

texts:
I have an entityform type that uses a term reference (department).
This term reference was also added to user accounts.

I'd like to make a view that displays the form submission for the same department as the currently logged in user.

I can't seem to make it work because if I go with a user view, I'm not able to retrieve all the entityform fields that I need.
If I go with an entityform view, I'm not able to retrieve the current user's department. I can make a relationship only with the form submitter and that field is never empty so I don't think I can default to the 'current logged in user'

Any ideas?


texts: How do I programmatically close webform by node date field?

texts:
Background:
I'm adding an events (custom content type) & registrations feature to an existing drupal 8 website. My experience in drupal is pretty minimal. But I can find my ways around code.

These events can be conferences, seminars, training spanning 1-N days with N number of seats.

What I have got so far is creating content type & referencing webform.

What I want
Ways to disable/close form before event starts or as per a date field (ie, registration will be disabled).

What I have found which looks pretty close to what I want

Disable (Close) webform form dynamically

Close a webform when total seats reach a maximum


texts: How to prevent a node from listing programmatically?

texts:
How can I prevent a node from listing, programmatically? I want to select node by nid. Beacause of some reasons, I don't want to use hook_node_grants() and hook_node_access_records()

I tried to change the _node_access_where_sql() function in the core which creates where clause for use in fetching node listings but $node or $nid is not passed to the function so I can't select node by nid


texts: How to alter the $item value in taxonomy_field_is_empty without altering core taxonomy module?

texts:
How to alter the $items value found in hook_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) and pass it to hook_field_is_empty($item,$field)?

In a custom module,

function hook_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element){
$item = $items[$delta];
}

In taxonomy.module,

/**
 * Implements hook_field_is_empty().
 */
function taxonomy_field_is_empty($item, $field) {
  print_r($item);print_r($field);die('edd');
  if (!is_array($item) || empty($item['tid']) && (string) $item['tid'] !== '0') {
    return TRUE;
  }
  return FALSE;
}

The  $item array structure in hook_field_is_empty($item,$field) is $item[0]['tid']
whereas taxonomy_field_is_empty($item,$field) expects to have structure as $item['tid'] .

Since its $item[0]['tid'], it gives undefined 'tid' which leads to returned value to be TRUE and hence field is said to be empty ,which is not the case usually.
I tried adding a custom hook in my module for hook_field_is_empty but it did not execute the hook at all ,even I tried adding -1 weight so it executes before taxonomy_field_is_empty (taxonomy module has weight 0) but still it did not help
So I need to alter $items value in hook_field_widget_form in a way that taxonomy_field_is_empty($item,$field) gets $item value such that $item['tid'] is defined(which was not case due to $item['0']['tid'] )

Is there any way I can alter $item value in hook_field_is_empty ?


texts: Use Regex to insert jQuery querystring before a url anchor

texts:
On my page I have some content links that start with '/example/'.  I'm using jquery to add a querystring to these links, which is the parent of the currently viewed node.  So, the code looks like this:

//add parent querystring to subpages
$('a[href^="/example/"]').each(function(index, element) {
  var parentAttr = $(this).attr('href') + '?parent=' + Drupal.settings.nodeinfo.nid;
  $(this).attr('href', parentAttr);
});

This works great with one big exception.  Some of the links look like this (note the anchor at the end):

http://mysite.com/example/subpage#anchor-name

So, with my jquery, the resulting link looks like this:

http://mysite.com/example/subpage#anchor-name?parent=123

When the url is structured this way, the anchor part doesn't actually work (it doesn't jump the user to that section of the page).  The querystring actually needs to inject itself between the full url and the anchor.  This format is what's needed:

http://mysite.com/example/subpage?parent=123#anchor-name

How can I modify my code to inject the querystring before the anchor in the url if there is one?  I'm assuming it has to be regexed somehow?


texts:
In a view I would like to output just the path to the piece of content where the file is referenced like the below:

http://www.example.org/file/1

I DO NOT want to link directly to the file itself.

I thought it would be a simple task but most of the fields are adding html (like View).

I am filtering by a file type of "Video".  I have tried adding the below with no success:

File: Download Link
File: Edit link
File: Link
File: Path

And have also tried using a relationship:

Content: Link
Content: Path

I have been able to get it working by rewriting the File: File ID field and hard-coding the url with the [fid] as a token, but that's a horrible solution.


texts: Git push to drupal.org always returns "Everything up-to-date"

texts:
This same question was asked many times, but for now I didn't find any help in the responses.

I have a project in a sandbox which I frequently pushed to the DrupalGit repository without any issue during review process.

Then after successfully getting permission, I first wanted to simply promote my sandbox to a full project according to these instructions, but for some reason editing my sandbox page never showed me the "Promote" tab.

So I decided to create a full project from scratch, then I followed its "Version control" tab documentation to create and populate the corresponding repository: compared to the sandbox's one, you can see that it only contains the myModule.info file.
(this file is not the "true" myModule's info file: it was created in the earlier steps prescribed by the above doc).

Once successfully pushed this and added a "7.x-1.0" tag as also prescribed, I locally copied all my real files from sandbox to full-project directory, git-added them and git-committed them.

Then from now on, any git push origin 7.x-1.0 simply returns "Everything up-to-date", and obviously nothing is updated in the DrupalGit repository.

I looked at many posts and docs, in the Drupal community and elsewhere, tried a lot of more or less serious methods.
I even dropped all files but myModule.info from my local repository: pushing this committed situation also returns "Everything up-to-date", and indeed the same after bringing them again.

I could observed something weird when clicking the myModule.info file to display its contents:

in the sandbox repository it appears formatted with line numbers, as expected, and clicking "plain" displays its raw content
but in the full project repository it displays in hexdump mode, And clicking "plain" causes its download to be proposed!

This clearly means that the file in a somewhat strange state, and midht be significative... but not for me at the moment :-)


texts: Ordering/ Sorting product displays on the product category page

texts:
I have created product displays which are now showing on the relevant category pages (product-category/%). The product category page is created in views which is great but I want to have full control over the order of which the products are displayed (top to bottom).

At the moment in 'Sort Criteria' of views I only have options to sort by Title, ID, Date posted and Category which is not useful. I want to sort by something like SKU or some other field of the product.

Any ideas?


texts: What does Contextual Filters (in Views) serve for?

texts:
I was playing with filtering content using views but seems I can't make them work the way I want : to display the articles of an edition based on the latest issue no. (or latest issue date) on the frontpage. I figure out this can be done using contextual filter but don't know how.

My content types are:

editions: edition_no, edition_date, edition_title
article: title, body, edition_no.

Many thanks for help.


texts:
I want clean URLs like webpage.com/page instead of webpage.com/?q=page, specifically in my menus.

I have gone here http://v6.dev/admin/config/search/clean-urls (which is a clean URL and works) and ticked the 'enable clean URLs' option and saved. But nothing happens, the page reloads without the tickbox checked.

Clean URLs are working, I can navigate to webpage.com/page fine, but the menus aren't being generated as clean URLs.

I have gone through this page: https://www.drupal.org/getting-started/clean-urls but can't solve the problem. I think the servers set up okay, because I can succesfully navigate to clean URLs, it's just that links aren't rendered as clean URLs.
I've also tried cleaning the cache, and restarting server.

If it helps, I'm generating menus with this code:

<?php
    $menu = menu_navigation_links('menu-top-menu');
    print theme('links__menu_main_page', array('links' => $menu));
?>


texts: What does menu blocks "Block title as link" option do?

texts:
The Menu block module has an option on each block titled "Block title as link". My interpretation of the description combined with some testing, is that if I leave the "Block title" setting out, the name of the menu will be used as the block title, and it should also be a link to the currently viewed menu item.

However, when I check the option and try it, I never get any links. I've been trying to follow the code, but I couldn't make any sense of it, so I believe my expectation on the functionality is wrong.


texts: Add to cart button enabled if subscriber seller

texts:
I want to create a marketplace. Each seller will be able to create a shop and products that will be displayed to all visitors.

A non-subscriber (free) will have on his product a button "Add to cart" not clickable. The products can not be ordered.
A subscriber (paid) will have on his product a button "Add to cart" clickable. The products can be ordered.

How to do this ?

How do I create subscriptions with an end date with drupal ?


texts:
I am using  Varnish + Default Page cache with a expiring time (1 day) in a site.

When I am browsing the site, everything seems loading fine; once I come back to the site after a day or so, the the pages start loading slow and they become okay after a while.

It seems like the cache is being cleared after a while and generated again once someone visit the site again. I do not want that user to suffer.

I read about Drupal Cache Warmer; is there something which can keep the cache alive and no user suffers?


texts: I can't get my module to show up in the Navigation

texts:
I'm trying to create a custom module that has a block with a form in it.  I'm able to install my module, and even add the block to the content area of the site, showing my form on every page of the site.  But for some reason the page I set as the form's page won't show up in the navigation, and when I try to type in the pages address to get to it, it says the page is not found.

<?php
require_once('/includes/functions.php');
/**
 * @file
 *
 */

 /**
 * Implements hook_block_menu()
  */

 function search_engine_menu() {
    $items = array();
    $items['results_page'] = array(
        'title'         => 'Search Results',
        'page callback'     => 'search_engine_results_page',
        'access callback'   => TRUE,
        'type'          => MENU_NORMAL_ITEM,
    );

 }

 /**
 * Implements hook_block_info().
 */

 function search_engine_block_info() {
     $blocks = array();
     $blocks['search_engine'] = array(
        'info' => t('Search Engine'),
        'cache'=> DRUPAL_CACHE_GLOBAL,
        );

    return $blocks;
 }

 /**
 * Implements hook_block_view().
 */

 function search_engine_block_view($delta = ''){
     $block = array();
     switch ($delta) {
     case 'search_engine':
         $block['subject'] = t('Search Engine');
         $block['content'] = drupal_get_form('search_engine_form');
     }

     return $block;
 }

 /**
 * Implements hook_form.
 */

 function search_engine_form ($form, &$form_state){
        $form['searchOptions'] = array(
            '#type'     => 'select',
            '#title'    => t('You can search by GWF Number, name, email address or phone number.'),
            '#options'  => array(
                'gwf'           => t('GWF Number'),
                'applicant_email'   => t('Email Address'),
                'name'          => t('Name'),
                'phone_number'      => t('Phone Number'),
                ),
            '#value'    => 'gwf',
            );
        $form['searchInput'] = array(
            '#type'     => 'textfield',
            '#title'    => t(''),
            );
        $form['submit'] = array(
            '#type' => 'submit',
            '#value'=> t('Submit'),
            );
        $form['results'] = array(
            '#type' => 'markup',
            '#value'=> 'Test',
        );

    return $form;
 }
 /**
 * Implements hook_form_submit.
 */

 function search_engine_form_submit($form, &$form_state){
    drupal_set_message('Submitted');
 }


texts: Is there a way to make a unique view template for a specific type of view?

texts: I needed to edit the views-view-unformatted.tpl.php for a specific view, however I'd rather it not apply to every view. Is there a possible way to make a unique view template to select from? Rather than rewriting every view that uses views-view-unformatted?


texts:
[Note, this question is almost identical to this one for Drupal 7, but since I never used it I cannot understand how the proposed solution can be ported to Drupal 8]

I have a parent node type, let's call it Parent, which holds a list of references to a child type, let's call it Child. A child also has a reference to its parent node. For business reasons beyond the parent-child model, a parent has to be created from the edit form of the child; from the edit form of the parent I can link more children.

So I set up a link from the edit form of the child which points to a Controller with a code like the following:

$parent = Node::create([
  'type' => 'parent_nodetype',
  'langcode' => 'en',
  'created' => REQUEST_TIME,
  'changed' => REQUEST_TIME,
  'uid' => $this->currentUser()->id(),
  'title' => 'Parent of ' . $child->get('title')->getString(),
  'field_children' => [$child_id],
]) ;
$parent->save() ;
// ...maybe more code here...
return $this->redirect('entity.node.edit_form', ['node' => $parent->id()]) ;

If I do just this, the parent node is created and I am redirected to its edit form. But I also want to insert the reference of the child to the parent, so at the location of the comment in the above code I add

$parent_id = $parent->id() ;
$child->set('field_parent', $parent_id) ;
$child->save() ;

In this second situation, the redirect is not executed, so I remain in edit form of the child. I tried to save the parent again after

Searching for similar problems, I got the idea of moving the association from child to parent in a hook, so I wrote something like the following:

function mymodule_node_insert(Drupal\Core\Entity\EntityInterface $node) {
  if ($node->getType() === 'parent_nodetype') {
    foreach ($node->get('field_children') as $item) {
      $child_id = $item->getValue()['target_id'] ;
      $child = Node::load($child_id) ;
      $child->set('field_parent', $node->id()) ;
      $child->save() ;
    }
  }
}

but even in this case the redirection does not take place; it is as if the $child->save() statement prevents the redirection, wherever it is called.

Is it really so? How can I achieve the desired result?

EDIT: I tried to have a $parent->save() as a final instruction, which is not difficult:

$parent = Node::create([
//    ... same code as before, only the last line is commented
//    so the next save is guaranteed to be executed ...
//      'field_children' => [$child_id],
]) ;
$parent->save() ;

$parent_id = $parent->id() ;
$child->set('field_parent', $parent_id) ;
$child->save() ;

$parent = Node::load($parent_id) ;
$parent->set('field_children', [ $child_id ] ) ;
$parent->save() ;
return $this->redirect('entity.node.edit_form', ['node' => $parent->id()]) ;

but redirection still doesn't work, so my guess that it was the save on the child to prevent redirection is false: maybe any operation on other entities prevents it...


texts: Filter View on Partial Term Name Across All Vocabs

texts:
Hello im sure i used to be able to do this with D6 and Views 2. Struggling to achieve it now.

I was wanting to create a content view that is filtered on partial matches of a term name across ALL my vocabs. Say i filtered on 'science' then the view will show content tagged 'science videos' from my Video Vocab and also, for example 'science chat' from my 'tags' Vocab.

Using D7 and Views 3 i dont seem to have the option to filter on name only ID and ID is limited to one vocab.

Does anyone know if i am missing something here?

Thanks


texts: How can I display sql query from database?

texts:
I'm trying to display sql query on page in drupal 8.2, but I get an error:

  The controller must return a response (Object(Drupal\Core\Render\Markup) given).

How should I change the following code?

if ($result = $mysqli->query("SELECT id, discipline, teacher FROM canteach")) {
  $output .= "Select вернул " . $result->num_rows . " строк <br />";
}

$mysqli->close();

$header = array('id', 'Discipline', 'Teacher');
$rows = array();

while ($row = $result->fetch_array(MYSQLI_NUM)) {
  $rows[] = array($row->id, $row->discipline, $row->teacher);
}

$result->close();

$items_array = array(
  '#theme' => 'table',
  '#items' => array('header' => $header, 'rows' => $rows),
);

return render($items_array);


texts: I need to create a Tree View Menu with checkboxes, showing values taken from the database. I want to use the Collapsible Checkbox Tree. A demo of the jQuery plugin is available here.


texts: Change wording of history (member since)

texts: Is there a way to change the wording of "Member since" to something else?


texts: File upload ajax and Radio Buttons not cooperating in registration form

texts:
I have enabled Profile 2 and profile Profile2 Registration Path modules on my site and have a really long registration form with lots of fields. I have some radio boxes and file upload fields also. The problem is when I upload a file without having selected a valid option for my mandatory radio box. IF the radio box is empty when I hit upload, the file gets uploaded and I get the error "illegal option, contact admin". After that the error keeps repeating if I try to remove the file.

In my reports I see

  Location  http://localhost:6600/sitename/el/file/ajax/profile_customer/field_cv/und/0/form-Q8VxLye65S3tYFkcHSwO9Z58dG7Mhv6jRWRBnIst46s

  Referrer  http://localhost:6600/sitename/el/customer/register

  Message   Illegal choice in Specialty element.

The Specialty element is my radio box. If I enter an option in the radio box before uploading the document everything works as it should! Removing the file is troublefree also. I am completely baffled with this. I’ve searched and found many issues with file upload and radio boxes values connected to ajax. Seems weird that this thing isn't working. Can't be the only one with files and radio boxes in his registration form! Any ideas/pointers on how to solve this irritating issue?


texts: How to implement some type of private messaging to arbitrary groups of users?

texts:
I'd like to send private messages (with email notification) to groups of users. These groups can be either pre-defined or ad-hoc selected. Is there any way to implement this feature in a Drupal site?

I found Privatemsg which seemed quite promising since it has Views- and Rules-integration. But after all it has not meet the requirements: I couldn't find a way to populate the recipients field with multiple users (I thought using a view with exposed filters and VBO would be a handy tool for selecting users).

Is there any solution for this?


texts: How to implement search autocomplete for specific content types?

texts:
How to implement search autocomplete it should show suggestions for specific content type only suppose recipe and collection .

I have used search exclude(node) module for searching nodes of specific content types.

But i am not able to figure out how to add search autocomplete programatically  or by using some module.


texts:
I'm new to Drupal 7. Right now I'm trying to use D7 to build an interface that allows me to directly manipulate the tables in the database.
I have installed a couple modules such as Data, Migrate, Feeds, and etc. I managed to create a view to display the table that I created using Data Module, but I need to add and update the rows from the interface.
Furthermore, is it possible to set up relational tables so that I can update or delete related rows at the same time using Drupal?

Thanks in advance

Yea, I just started learning Drupal, even new to the whole CMS thing. I decided to take the chance to learn Drupal for my project. But thanks all for the help I really appreciate the helps. I will come back and vote up the answers when I have enough rep.


texts: How to display drupal 7 Ubercart product attribute options in views filter?

texts: I want to display drupal 7 Ubercart product attributes(for eg: size - Medium, Small, Large) as views filter in the products listing page. I have searched on google but did not find any solution for that.


texts: I am building a migration and it is important that each new node has the same creation time stamp as the cosponsoring data in the old system.   How do I set the creation time of a node during a migration using the Migrate module?  I am assuming that it is set by a specific call to addFieldMapping()


texts:
I have these following 4 Taxonomies
1. New Taxonomy
2. Content Category
3. Technology Taxonomy

Applications
Gamification
Architecture
etc. Totally 170 terms

4. Vertical Taxonomy

Automotive
Banking

Have used Taxonomy term views to create listing pages for these. I want to know is it possible for me to dynamically combine multiple taxonomies ( Technology & Vertical) to display content. Eg : example.com/applications/automotive . If yes how can this be done?


texts: How can I pass display exposed filter in views-view-unformatted.html.twig?

texts: I would like to display an exposed filter inside views-view-unformatted.html.twig rather than views-view.html.twig due to specific UI design?


texts: Taxonomy List in node/add Capitalize all letters in the parent only

texts:
I have a strange customer request for a taxonomy list users select from while adding content.

The request from the customer is have the parent vid show up in ALL CAPS and the children to be left alone.

What's the best approach to this?
Thanks


texts: How do I reliably expose aggregated CSS/JS to a third party app?

texts:
(TL;DR at the bottom)

For the purposes of "theming" some other internal apps based on ASP etc., I need to make a D7 site's CSS/JS available at a permanent, reliable URL; one which will also self-update. That is, when CSS/JS changes, the file will be updated to reflect that.

To this end, my intention was to generate these files myself using a module. I only really need to replicate the header/footer of a particular content type. I figured I'd accept an argument of "content type" and generate the files based on a random node's css/js, or maybe there's a way to use a "blank" node, I don't know. I just need to provide back a stable aggregated file for each of css and js. It could live in either the theme or files directory I guess.

I'll probably need to write a "rebuild" hook to update the files too but that could just be a cron task or maybe run on cache clear.

TL;DR - how do I programmatically create an aggregated css/js file given a content type, and store this?


texts: Editing images on CKeditor brings up the Drupal image uploader not IMCE in Drupal 8

texts:
I'm using IMCE to upload images on the CKeditor. The insertions of images works fine but when I double click an existing image to edit it, it only opens on the normal image uploader.

Any idea what I'm missing ?


texts: How to add some javascript in a form using form API?

texts:
I need to output some javascript codes as well as form fields.

I am using Drupal 6 and form API to build the form. How can I output those javascript codes? Is there a 'javascript' type like textfield/checkboxes ?

I have tried the code below but string 'Array' is printed on the page instead of js code:

$form['target'] = array(
'#prefix' => '
' ,
'#value' => drupal_add_js('alert("hello)','inline'),
'#suffix' => '
'

);


texts:
I have a pretty particular issue that I'm running into with setting up an Administration View using Contextual Filters.

I've set up a view to handle /admin/content.

Basically, what I would like is for users in a particular role to see the content that they are authors of, and one specific other content type, for which nodes are submitted by anonymous users through a webform.

So, to recap, users in this role need to see:

Nodes that they are the author of
Nodes submitted by anonymous users, of a specific content type

Any thoughts?


texts: How do I migrate the basic page content to another site?

texts: I have nearly 250  basic pages content and I want to migrate the same content to another Drupal website. I tried using the Backup and Migrate  module, but it doesn't work well. How can I do this?


texts: How to give anonymous user access in a menu hook?

texts:
I have a module with a menu hook that I want to give access to everyone. At first I had simply

function hook_menu() {
  $items['site_search'] = array(
    'page callback' => 'my_callback',
  );
  return $items;
}

But when I navigated to /search, I got a warning that I didn't have permission. I thought I had remembered somewhere along the line that I could do 'access callback' => TRUE, in the menu hook to allow anonymous access, but that doesn't seem to work either.

Do I really have to add another function that just returns true to use as the access callback to give anonymous users access to this path?


texts: How to populate a node reference field that has multiple values?

texts: I'm using the rules to create a new node upon changing the current node publishing status to published. And populate some field based on the updated node field. Im trying to populate a node reference field in the new created node based on the node reference field multiple values from updated node. I wasn't able to use the tokens since it returns single value. How do I get all the values using tokens and return the values in an array (using the php code)?


texts: How to apply a theme function/template to my form

texts:
I think theme_form() is responsible for rendering forms! I want to change the look of a form, a lot. I think just instead of theme_form I can use my custom theme function/template file.

I can use hook_form_alter to change any form's structure using my module. Now my question is, how do tell the form to use a theme function/template I've created?

Is there a #theme property (or something like that) available for forms, which I can set to my theme function/template file?

P.S. I checked out this but I need more explanation, when the case is: I'm trying to theme a form defined by another module/core modules.


texts: How to display tabbed menu, created via hook_menu?

texts:
I am fairly new to Drupal and still figuring out its inner workings.
Currently, I am playing around with creating own modules. I want to create a tabbed menu via hook_menu and display it. Unfortunately, I seem to fail here. I lack the understanding how to activate the coded menu in the hook on one of my pages. Since I do not define a block (and with such have no hook block_info or block_view in my module), I am not able to place my module via the structure menu anywhere. And by itself, the tabbed menu does not show up anywhere. My module is available in the modules' list and I can activate and deactivate it. I also cleared all caches, but I can't seem to find it anywhere.
Hence, my question is: how do I activate and place the menu on my site?

My module has the two files dummy_module.module and dummy_module.info.

dummy_module.module:

/**
 * Implements hook_menu().
 */
function dummy_module_menu() {
  $items = array();
  $items['dummy'] = array(
    'title' => 'dummy_module',
    'page callback' => 'temp_output',
    'access callback' => TRUE,
    'weight' => 1
  );
  $items['dummy/new_tab1'] = array(
    'title' => 'Current 1',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'page callback' => 'temp_output1',
    'weight' => 2
  );
  $items['dummy/new_tab2'] = array(
    'title' => 'Current 2',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'temp_output2',
    'weight' => 3
  );

  return $items;
}

function temp_output() {
  return 'Hello world!';
}

function temp_output1() {
  return 'Hello world 1!';
}

function temp_output2() {
  return 'Hello world 2!';
}

dummy_module.info:

name = Dummy Module
description = This is a dummy module and hence the basis for all further module development.
core = 7.x
files[] = dummy_module.module


texts:
I am using quicktabs module for grouping three view blocks as a single block.
Everthing is working fine with quicktabs . But according to my design , i Have to render tabs created by quicktabs in my views template file .

How can i achieve that.

Please Help !


texts: jQuery not Loading for "Anonymous" Users

texts:
For Drupal 7, a jQuery will not load for "anonymous" users on any template pages. But when I log in as an administrator it loads. It's similar to this issue: http://drupal.org/node/802432, but nothing I tried has worked. The only way I could get the jQuery to load was by giving the user access to the administration menu, which I do not want to do.

I have the following code in the preprocess_node function of the template.php file.

if ($variables['view_mode'] == 'full') {
$node =& $variables['node'];
if ($node->type == 'page') {
  $path = drupal_get_path('theme', 'responsive');
   drupal_add_js($path . '/js/jquery.snap.js', array('type' => 'file', 'scope'
   => 'header'));
   drupal_add_js($path . '/js/jquery.snap2.js', array('type' => 'file', 'scope'
   =>'header'));
  }
}

Here is the original JS code

<script type="text/javascript">
document.write(unescape("%3Cscript src='"
+((document.location.protocol=="https:")?"https://snapabug.appspot.com":
"http: //www.snapengage.com") + "/snapabug.js' type='text/javascript
'%3E%3C /script%3E"));
</script>
<script type="text/javascript">
SnapABug.addButton("77777-7777","0","50%", true);
</script>

I put the code in two separate JS files (couldn't get it to work in a single file)

jquery.snap.js

(function($) {
document.write(unescape("%3Cscript src='"
+  ((document.location.protocol=="https:")?"https://snapabug.appspot.com":
"http: //www.snapengage.com") + "/snapabug.js' type='text/javascript
'%3E%3C /script%3E"));
})(jQuery);

jquery.snap2.js

(function($) {
SnapABug.addButton("77777-7777","0","50%", true);
})(jQuery);

When I look at the HTML source I see an error for jquery.snap2.js: "Uncaught Reference Error: SnapBug is not defined." The result is the snapabug.js is not loading. This error does not occur on the administrative side and the snapabug.js does load.


texts: Does a guide for installation of drupal Cartaro distribution exist?

texts:
I have been trying to install the Cartaro distribution of drupal on windows that makes drupal

a complete geo-stack. I have been unable to find complete documentation for the same and the

installation fails to detect postgis installed on the computer as well as there is some confusion about the terminology for geoserver.


texts: My module depends on a PHP library (sites/all/libraries/xyz/xyz-library.php). It doesn't install unless the external library libraries/xyz/xyz-library.php is in place. Is there a way to install the library using Drush first and then install the module?


texts: How to change programmatically the link of a field in a View

texts:
I have a View, with a hidden field with a URL, and an image field which has the following property:

Output this field as a link and linked to the URL field: [field_url_slider] and _blank as Target.

I want to change dynamically the behaviour, so when the image is a given one, to rewrite programatically the URL and also the Target.

In hoo_views_pre_render don't see how to do it, because the complete link, i.e. a href="", etc. is not any data of view->result and I don't know if this can be achieved via $view->display (I only want to change a result). So, in a few words, I want to change the HTML output of the Views display for just a result.


texts: Custom form which on submit click inserts into the database

texts:
I have created a custom form in my module so that when the user clicks submit, some changes are performed in the databases and other actions follow. The form is an empty form with only the submit button nothing else. When the user clicks the Submit button, a function is called to perform some tasks. However, I am getting some errors. Here's the code:

My module folder is formtest and is placed in sites/all/modules/

formtest.info

name = Test Form
description = Accept Challenge Form Submit
core = 7.x

formtest.module

function formtest_menu() {
$items['formtest'] = array(
'title' => 'Accept Challenge',
'page callback' => 'drupal_get_form',
'page arguments' => array('formtest_form'),
'access callback' => TRUE,
);
return $items;
}

function formtest_form($form,&$form_state) {
  $form['button'] = array(
  '#type' => 'submit',
  '#value' => 'Accept Challenge',
  '#submit' => array('formtest_action'),
   );
  return $form;
}

function formtest_action($form,&$form_state) {
  $query = db_insert('challenges')
    ->fields(array(
    'cid' => '$node->nid',
    'uid' => '$user->uid'
    ))
   ->execute();
}

/**
    * To display the form on a particular content type
    */

function formtest_node_view($node, $view_mode = 'full', $langcode = NULL) {
      if($view_mode == 'full') {
        if($node->type == 'challenge') {
          $node->content['my_form'] = array(
            '#markup' => drupal_get_form('formtest'),
            '#weight' => 1,
         );
     }
   }
  }

Well that's all. There's no form showing up..no error messages..nothing...I tried a var_dump() but nothing...That custom content page is displaying as it was but there seems to be no effect of this code. Would appreciate your help in any manner. Thanks


texts: how to override views field template for all themes?

texts: I am aware you can add you a custom template for a views field such as views-view-field--title.html.twig to your theme. But this has a limitation that it only work for the active theme. Sometimes the admin theme is used out of the box and not as a sub theme. I am trying to figure out if I can force views to use a template of my choosing anywhere it appears regardless of the active theme.


texts: What's The Security Implications for "Send arbitrary files" in Permissions

texts:
For my webforms, I want to receive attachments, when I receive an email. I had issues receiving them until I set the permissions for Anonymous User to allow them to use "Send arbitrary files".
Underneath, there's a warning:

Give to trusted roles only; this permission has security implications.

Does anyone know what are the security implications?
Thanks!


texts: "drush sql-sync" failing with Illegal string offset 'site' backend.inc:1030

texts:
I'm using Drupal 8.
I have an installation on my local dev machine as well as one on my remote demo machine.
I'm attempting to use drush sql-sync so that I can make sure my local dev has the same data as my remote demo.

The command I'm running is:

drush sql-sync @remote.demo @local

The error is:

  Illegal string offset 'site' backend.inc:1030

  The command could not be executed successfully (returned: env: drush: No such file or directory, code: 127)
  Error: no database record could be found for source @remote.demo

My aliases file is ~/.drush/aliases.drushrc.php.

<?php

$local = '/var/www/drupal/';
$aliases['local'] = [
    'root' => $local,
    'path-aliases' => [
        '%dump-dir' => "{$local}drush.dbdumps",
    ]
];

$remote = '/var/www/drupal/';
$aliases['remote'] = [
    'remote-host' => 'x.x.x.x',
    'remote-user' => 'myUsername'
];

$aliases['remote.demo'] = [
    'parent' => '@remote',
    'root' => $remote,
    'path-aliases' => [
        '%dump-dir' => "{$remote}drush.dbdumps"
    ]
];

?>

I know it's being picked up because it shows up in drush status.

This is a snippet of backend.inc (the file referred to in the error):

1028        if ($proc['output']) {
1029            $values = drush_backend_parse_output($proc['output'], $proc['backend-options'], $proc['outputted']);
1030            $values['site'] = $site;
1031            if (is_array($values)) {

It seems to me that drush_backend_parse_output() is parsing something incorrectly but I'm unable to figure this one out. Any idea what I'm doing wrong?

UPDATE
I ran the drush command with the verbose flag:

drush -v sql-sync @remote.demo @local

The output is long but the relevant output is:

ssh -o PasswordAuthentication=no myUsername@x.x.x.x 'env COLUMNS=112 drush --backend=2 --verbose --root=/var/www/drupal/  sql-conf   --all 2>&1' 2>&1                       [notice]
Illegal string offset 'site' backend.inc:1030

It seems like the drush command run on the remote machine is generating output that my local drupal is tripping on. Not sure how to resolve this though.

Note: drush --version gives me Drush Version : 8.0-dev on both machines.


texts: Groups audience list shows NONE in Organic Group module

texts:
In my drupal site i have implemented the Organic Group module for user group management

Here I have created a number of groups like grp1, grp2 ... .
I have a custom content type as Opinion that has a field Groups audience with FIELD TYPE Entity Reference so that user can able to post the content type and choose group from GROUPS AUDIENCE to which group the post should belong

The issue is when i am adding Opinion by admin dashboard  the groups are showing in the list GROUPS AUDIENCE as  grp1, grp2 ... and posted to that required group

But when the authenticated user want to post that the GROUPS AUDIENCE shows NONE , by which after posting the content it is visible in  Home page but not showing the corresponding group page

I have gone through  this link

Also given the full permission to the Role that assigned to the user . Any guidance will help me a lot.

Thanks


texts: How to prohibit some words and letters to use as a Drupal password?

texts: I need to prohibit a user from using a few words as a password. E.g I don't want to use these words as a password. Drupal, 123456, Microsoft. When a user submits the registration form with the above terms in the password field then they get a message about the prohibited password.


texts:
I have these modules

addressfield
geofield
geocoder

Is there any function to which I can pass an address like Stree, zipcode city, Country and it returns a lat/lon from that address?

I have searched in the code of geofield and geocoder but unable to find any helper function.


texts: How to notify Group manager when user subscribe a group

texts:
I am using Organic groups and Privatemsg, and I'd like to notify (send private message) the group manager when someone is asking for membership of the group (subscribe).

I think maybe I can use Rules, but I am new to Rules and do not know how to set arguments and parameters.

Is there any modules or code snippets can do this?


texts: How to create a rule to send an email to a list of selected email addresses?

texts:
I have a Content Type Named XYZ. This content Type has a field named Email Addresses, which contains the List of Email address of the users in the Portal.

Now when the user adds the Content of XYZ and selects the desired Email Address from the Email Addresses List, the email should be sent to all the selected Email Addresses.

I know the Rules module should be used to perform this, but guide me the steps, how to make such rule?


texts:
When selecting an image to a user profile, the original is saved in files/pictures, however no thumbnail is created. (also other app like Node-Gallery fail to create thumbnails).

Directories where the thumbnails should be stored were not created by default, so I created the missing folders myself (files/styles/thumbnail/public/pictures).

Turning off clean URL didn't work (as suggested by someone).

GD libraries are installed.

Any idea how to resolve this problem?

Thanks in advance,

Marcel


texts:
How do I get (in PHP) the gid of a node that is a group?

The group_audience field is present but empty, and I can't seem to populate it; presumably it is because that node is the only group, and it cannot itself be a member of the group it defines. (Why not is another issue that won't matter if I can just get the gid.)


texts: How can I use pathauto to generate URLs for deeply nested vocabularies?

texts:
I am generating breadcrumbs from URL arguments as described here.

I have a vocabulary that looks like this:

Arts-> Performing-> Dancing-> Ballet

I want my url to look like this:
arts/performing/dancing/ballet

Using the pathauto module, I can do this for taxonomy terms:

[term:parent]/[term:name]

Which, on the Ballet page, gives me the following; not what I want:

dancing/ballet

If I use parents instead of parent,
([term:parents]/[term:name]); this is close but not quite:

arts-performing-dancing/ballet

How can I get from arts-performing-dancing to arts/performing/dancing?


texts: Giving a user the choice to appear offline in a view showing online users

texts:
I created a views block which displays users which are online. I would like to give a user a choice to be able to appear offline (i.e not be listed in the block) when he/she is online.

Thank you in anticipation.


texts: How to get node url/address from entity reference (content type)?

texts:
Is there a way to fetch or print the node url/address from a entity reference to my twig template.

I have already tried {{ related_links.entity.uri }}, {{ related_links.entity.url }} or {{ related_links.entity.path }} but nothing seems to work

{% for related_links in node.field_pbn_additional_items %}

{{ related_links.entity.label }}

{% endfor %}


texts: Cannot bind delegate onClick event on .use-ajax elements

texts:
I have a view, that is refreshed with ajax. I'm using Jquery 1.7.2

You click a button, that call a javascript function :

$(view_identifier).trigger('RefreshView');

Before this refresh, I've attached on click handler to an ajax link.
The link call a modal popup and must trigger a javascript function.
The link contains a picture, but I have tested with just text and I get the same result.
So I'm trying to attach an handler to an ajax link.

Here is the html :

 //lot of things ....

 //lot of things

And here is the javascript :

$('a.use-ajax > img').on('click',function(){
  console.log('test');
  foo();
});

That work fine, until the view is refreshed. After the refresh, the function foo isn't being called anymore. Thats because the handler is not being attached to dynamic elements.

So I change the part above to this :

$(document).on('click','img',function(){
  console.log('test');
  foo();
});

So that I can use the event delegation provide by Jquery.

And it isn't working.
When I click on the link, nothing is happening.
The strange part is when I remove the use-ajax on the link  (become a normal link without the Drupal ajax part), it works.

I've tested a lot of variation and nothing seems to work.

I've used an old jquery code :

$(document).click(function(event){
   //check if its a click on the link with event
   console.log('test');
})

and It doesn't trigger either. If I click anywhere on the page, the 'test' show up in console, but not when I click an ajax link. I don't understand this because, it would mean that the link isn't in the dom.

Does anyone have an idea ?


texts: How to use hook_field_preprocess to add a prefix/suffix to an entity reference field for different view modes?

texts:
I'm trying to move some markup from twig templates to hook_preprocess_field().
I have an entity reference field (media image) that I want to add a prefix and suffix to.
I added a prefix and suffix like this:
function MYMODULE_preprocess_field__MYFIELD(&$variables) {
  $prefix = 'Hi... ';
  $view_mode = $variables['element']['#view_mode'];
  if ($view_mode == 'second_view_mode') {
    $prefix = 'Hello... ';
  }
  $suffix = '... there.';
  $variables['items'][0]['content']['#prefix'] = $prefix;
  $variables['items'][0]['content']['#suffix'] = $suffix;
}

With this code, my prefix and suffix get added, but they are cached, and the same for all view modes.
If I rebuild the cache and visit a node in second_view_mode, then I see Hello...  as the prefix for all instances of the field.  But if I rebuild the cache and visit a node not in second_view_mode, then I see Hi...  for all instances of the field, even those on a node in second_view_mode.
I use this same approach/code for formatted text fields and I don't experience this caching problem.  So I think I need to do something different for this entity reference field, but I don't know what to do.
How do I add a prefix/suffix to an entity reference field in a preprocess function for different view modes?


texts:
I'm setting up a migration from an URL with JSON on it.

Got the first level values without any issues. Currently I'm stuck at nested arrays which resemble something like this:

{   "content": [
    {
      "id": 148,
      "hardwares": [
        {
          "hwId": 16,
          "products": [
            {
              "pid": 2097,
              "productName": "ProductName1",
            },
            {
              "pid": 2100,
              "productName": "ProductName2",
            },
            {
              "pid": 2103,
              "productName": "ProductName3",
            },
            {
              "pid": 2094,
              "productName": "ProductName4",
            }
          ]
        }
      ]
    },
   ],
}

I have a custom content entity with a text field called Product Names, the field is a multi-value field. I've been trying to get the productName values and populate the field. Basically this JSON here would create one entity, and then get the value by this hierarchy:

hardwares->products->productName

I can't seem to grasp the usage of the sub_process plugin and I would really appreciate any hints or any working examples.


texts: How can I allow users to specify one main taxonomy term from a set of terms?

texts: In my node edit form, I have a field that allows users to select multiple terms from a fixed list to designate "categories" that the node is part of. I would like the user to be able to specify that a single one of these terms is the "main" category for the node, so that the node has one single "main" category, together with an arbitrary number of implicitly "secondary" categories from the same vocabulary. I am using Drupal 7.x.


texts: hook_field_formatter_view not being called

texts:
I cannot for the life of my figure out why cc_byline_author_field_formatter_view is not being called here. hook_field_formatter_info works as I can select the formatter for my field. Cache clear, module name change, module disable and re-enable have not helped.

Thanks for having a look.

/**
 * Implements hook_field_formatter_info().
 */
function cc_byline_author_field_formatter_info() {
  return array(
    'cc_byline_author_author_replace' => array(
      'label' => t('Byline Author Replacement'),
      'field types' => array('text'),
    ),
  );
}

/**
 * Implements hook_field_formatter_view().
 */
function cc_byline_author_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  die;
  return '';
}


texts: Pulling #hashtags and displaying them on site

texts:
I see that you can you the Activity Stream module to pull feeds from twitter and other social media sites. Well how could I pull a predefined #hashtag from ANY social meida site and present it in a feed on my drupal site.

Example:

Hashtag is #NCAABasketball

From bjones on Twitter:
Saw KU beat UNC's butt. Love #NCAABasketball

From jbean on Google+:
Love #NCAABasketball !

From ktghram on Instagram:

I'm at the game! "picture:" #NCAABasketball

It doesn't have to be like this, but would this be possible with out the user posting or tweeting to my account?

Any suggestions?


texts:
Suddenly my drush has switched language and displays error messages in my native language, which is unfortunately not convenient if one tries to search for solutions on these errors.

Do you know how to switch the language of drush errors back to English?


texts: Drupal Superfish Mega Menu stacking down

texts:
I have superfish menu working but the megamenu part is stacking the last 2 below each other instead of beside, so there is 2 columns and the last column is positioned below the second column instead of making a 3rd column.

i have looked over my link tree many times and that is correct with the hierarchy and the contains clicked on the container links.

and the problem still occurs if i remove one column it only makes 1 column and the second below that, so it seems as the last column always goes below the column before that instead of making a new last column.

So how can i make the Design column to align right beside the Webb column instead of beneath it?


texts: Migrate import with authentication onto external site

texts: What configuration is needed in to use the MigratePlus authentication plugin. I need to authenticate the migrate import requests so that I can successfully import files behind a login.


texts:
I can't seem to get the colorbox plugin (colorbox-6.x-1.0) working with my Drupal 6.22 site. I'm currently working on Ubuntu Natty, and this is the folder structure for how I have the plugin and module setup:

 - sites
    - all
       - libraries
          - colorbox
             - colorbox
                - jquery.colorbox-min.js
                - jquery.colorbox.js
             - [other folders: content, examp1, examp2, examp3, examp4, examp5]
    - default
       - modules
          - colorbox
             - colorbox.module
             - etc, etc

Other stuff I already have done:

jQuery Update plugin installed
set permissions on sites/all/libraries folder using chmod a+w ~/public_html/drup_test/sites/all/libraries
flushed all caches

I'm still after all of this getting the "You need to download the Colorbox plugin and extract the entire contents of the archive into the sites/all/libraries/colorbox folder of your server" error. Please could someone help me as I don't know what else could be the problem.

Thanks!

EDIT: SOLVED!!

With iStryker's help, I realised that there was some weird permission setting on the /sites/all folder. Whilst I haven't sorted out the permission issue on that folder, this alternative worked (if this has also happened to you)...under /sites/default/ create a folder called libraries and put your jQuery plugins there. Then in Drupal Admin > Administer by Module > Colorbox > Colorbox Plugin Settings, change the plugin path to /sites/default/libraries/colorbox. Not the grandest solution, but it works!  Note that this also worked for the ShadowBox module and plugin.


texts: What is the syntax for setting 404 fast paths on all Drupal pages in D7 > 7.9

texts:
D7.9 introduced 404 fast paths which don't fully bootstrap drupal on 404's for certain file types if it's enabled, thus saving some bandwidth / computation. More info is available here: http://drupal.org/node/1296384

By default this excludes only certain file types such as .jpg, .txt., etc., looks like this:

$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpeg|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';

I want to use this for all paths. Are there any repercussions to that?

I tried changing it to

$conf['404_fast_paths'] = '/*$/i';

However, this returns a warning:

  Warning: preg_match() Compilation failed: nothing to repeat at offset 0 in drupal_fast_404() (line 2484 of /cms/main/includes/bootstrap.inc).

So what should the syntax look like up there to both work and not generate a warning?

Alternatively, if there isn't a solution to this specific question, is there a way I can speed up 404's for all Drupal pages, would it better to use the Fast 404 contributed module for instance?


texts:
In my Drupal 7 commerce website, I have my checkout page which will add my billing and shipping profiles. I need to just display my shipping address and billing address, instead of input fields. (Data fed from an ERP backend.)

So I've hidden al the input fields. Now I want to render the addresfield value and add it to my form just for display. But I seem to be unable to do so.

I  have the following code in my form alter:

  $handlers = array('address' => 'address');
  $context = array('mode' => 'render');
  $address_render_array = addressfield_generate($form['customer_profile_shipping']['customer_profile']['#value']->commerce_customer_address,
                            $handlers, $context);
  dpm($address_render_array, 'render arr');
  dpm(drupal_render($address_render_array), 'rendered');

However drupal_render() returns an empty string and I do not understand why. I've tried to X-debug, and I saw strangely enough that #access vars where FALSE, but I'm not finding out why.

After which I want to display it in my form

Something like

$form['my-address'] = array('#markup' => $renderedaddress);


texts: Is it possible to synchronize publish status between translations?

texts: Having 'Enable Translation' checked for a content type, is it possible to synchronize the publish status between all the translations in Drupal 8?


texts: Sync Alt and Title values from CCK imagefields with media module file fields

texts:
I have a situation where I really need to access the alt and title values of an image on a node.  I can retrieve these values in a node View, but in a file View these values are not accessible as they are not related the file.

I would like to, after adding an 'alt' and 'title' field to the 'image' file type in the media module, be able to sync the values from a node image field to the file fields.

Anyone know of way to currently do this?  Any suggestions?


texts: Views block that shows all references to current node (cross references)

texts:
I'm confused with views filters and relations...
In my articles I have a field (field_article_reference_nodes) that references other nodes and shows these as a link.
Now I want to attach a view to other nodes that lists all articles referencing them.
So this is kind of a cross reference.
How do I have to set the filters/relations for this view to list all articles that are referencing the current node?
Thanks for your support!
Mathias


texts:
I'm building my first drupal commerce with commerce-kickstart 2 on drupal7.
My client asked my to add a feature that associate products and blog posts.

At first I thought the best way was to add "product-reference" to the blog-post content type, this way the non-technical user could easily select 0 to n products to the post as "suggested" or "correlated" products, but when I added the product-reference field the whole blog-post content-type became a "product display" and the template file for the view was the wrong one.

Then I though of creating a block with a query for the products but I don't want the client to have to deal with this level of complexity.

I thought about writing the logic inside the product display template file but it doesn't feel like a good practice.

I searched for modules but I didn't find what I was looking for (maybe because I'm noobie to drupal I don't know yet how the search efficiently)

Are there any modules that can help with this?

thx


texts:
I'm building a form that contains a select but it's not rendering as a dropdown. It's rendering with a scrollbar and a dropdown down arrow

$form['my_select'] = [
  '#type' => 'select',
  '#empty_option' => '- None -',
  '#title' => $this->t('My Select'),
  '#options' => ['Option1', 'Option2'],
  '#size' => 6,
  '#weight' => '0',
];

What am I doing wrong?


texts: Create a new order using rules and update the user profile of the order

texts:
At a certain point when some conditions are met I need to create a new order using rules.
I manage to create the order, add the items but fail up get a user profile connected to the order.
When I try to use the Set a data value action to update the profile of the order (commerceorder:commerce-customer-billing:profile-id) the message is displayed "The selected data property doesn't support writing."
I have also tried to create a new user profile, set the values and then Set a Data Value action and pass on the new entity (commerceorder:commerce-customer-billing) but without success.

{ "rules_create_order_and_profile" : {
"LABEL" : "Create order and profile",
"PLUGIN" : "rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "commerce_cart", "commerce_checkout" ],
"IF" : [
  { "entity_has_field" : {
      "entity" : [ "site:current-cart-order" ],
      "field" : "commerce_customer_billing"
    }
  }
],
"DO" : [
  { "commerce_cart_product_add_by_sku" : {
      "USING" : { "user" : "4", "sku" : "10001", "quantity" : "1", "combine" : "1" },
      "PROVIDE" : { "product_add_line_item" : { "product_add_line_item" : "Added product line item" } }
    }
  },
  { "entity_create" : {
      "USING" : {
        "type" : "commerce_customer_profile",
        "param_type" : "billing",
        "param_user" : "4"
      },
      "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
    }
  },
  { "data_set" : {
      "data" : [ "site:current-cart-order:commerce-customer-billing" ],
      "value" : [ "entity-created" ]
    }
  },
  { "data_set" : { "data" : [ "entity-created:uid" ], "value" : "4" } },
  { "data_set" : {
      "data" : [ "entity-created:commerce-customer-address:name-line" ],
      "value" : "Donald Duck"
    }
  },
  { "entity_save" : { "data" : [ "entity-created" ] } },
  { "commerce_checkout_complete" : { "commerce_order" : [ "site:current-cart-order" ] } }
]

}
}

Is this a problem related to saving the entities in the correct order, and what would be the correct sequence?


texts: Is it possible to done search indexing locally, then upload it?

texts:
I want to perform search items indexing on the local system .
Due to high number of items and And slowing down the server

Can I do something like this ,  then I upload the result to the DB?
Without completely erasing the previous database.just replacing drupal's index.


texts: How to theme a Quiz in Drupal 7? - part 2

texts:
Trying to customize the look and feel of my quizzes in D7 - and getting overwhelmed. I have the Skeleton base theme installed.

Calling this Part 2 because - this is an extension of How to theme a quiz in D7?.

Help sought: Which CSS files specifically to target to change the Quiz Take page?

I have added the quiz-single-question-node.tpl.php file - and rendered the $question_node->content['body']. And now the quiz works fine... (but without my desired changes yet).

My problem is that the 'body' from above is a fully formed HTML Form of the quiz question. SO, where exactly should I look to:
a. change this body to perhaps add a CSS class?
b. where should I add the CSS class itself?

Would really appreciate some detailed hand-holding.

Thanks in advance.


texts:
We are using Drupal 8.5.X. As of today, we dump the complete DB to move from one environment to another. My concern is doing this, there are few sensitive information like user info or audit logs will be migrated to each environment. So I want to see whether we can migrate only contents and not the entire DB.

We use config_split for migrating the contents. We tried https://www.drupal.org/project/content_sync.. but looks like it is broken in the new Drupal. Any other modules or suggestions?


texts:
I've been asked to create a member's area in the site I am currently constructing.

This area should be accessible via a menu section that should only appear to logged in users.

Furthermore, if the user's role is a specific one, the menu should have one extra entry in which the user (let's say he is a baker, and the site is about a pastry shop), can see his earnings in a calendar like mode, assuming each of the cakes sold give's him a percentage.

So all in all, we have very conditional menu items.

Furthermore, the /user page, if the user is logged in (if it's not it's just a themed version of the original Drupal /user page), should be a view, or Panel, or collection of View blocks, that should depict a summary of the 4 links that follow.

At the moment my /user page shows the default "History" and some other stuff some modules have added. How can this page be styled?

The other menu items are: Your Account, Your Cart, Wish List, Order History, pretty much self explanatory, and more or less accessible using Menu Tokens.

The menu's structure is something like this

  -You (if user is logged in should change to his first name)
  |-Your Account (should lead to a form just like user/register (already themed) where the user can edit his information)
  |-Your Cart (commerce cart - kinda easy)
  |-Wish List (commerce wishlist - easy too)
  |-Order History (commerce orders - easy too)
  |-Earnings (for 'Baker' role only)

So the /user page should show (in a different fashion of course) all this information condensed.

So, to recap, the difficulties I am facing are:

Conditional name of the "You" item
Conditional appearing of the 4 sub-items
Conditional appearing ofthe 5th sub-item according to role
Theming of the /user page (when logged-in) (fixed using panel with UID as argument)

Any help for any of those would be highly appreciated.


texts: Why is Views Nivo Slideshow block only displaying to logged in users?

texts: I'm using the Views Nivo Slider module to create a slideshow for a couple of different sites I'm creating. The slideshow works perfectly if a user is logged in, but the block doesn't display at all when not logged in (the HTML for the block isn't even there). I thought it might be a permissions issue, so I tried giving anonymous users every permission possible, and still no luck. Any idea what might be causing this? Could it be something in my view?


texts: Use a CURL to work with sites without api?

texts:
I have this problem.
I need to programmatically submit forms on multiple sites and receive data
The sites do not use API
This task perfectly solves the CURL.
Is there a solution to this issue Drupal way?
Maybe https://www.drupal.org/project/services?


texts: Using paragraphs to show a few products on the same page with select dropdown

texts:
I have a few products under the same node.
I am using paragraphs to implement them.
The problem is that on the front end they appear one after the other instead of being able to choose them from a select dropdown. How could I achieve that?
The feature I need is similar to product attribute the only problem is that every product has a different title so i can't set the value in advance.
Thank you


texts: How to modify the page at admin/structure/types?

texts:
Using Drupal 8, I'm trying to modify the page at "/admin/structure/types" .This page is not a form (instead it is an entity list), so it cannot be modified with hook_form_alter.

_entity_list: The value is entity_type. Provides a list of entities using the EntityListController of the respective entity. E.g. _entity_list: view_mode returns the render array of a list of view modes.

Which hook can I use to modify an entity list ?

I have tried

mymodule_structure_types_prepare_form
mymodule_structure_prepare_form

and none of those is triggered.


texts: how to add a "add user" tab to admin/people

texts:
Currently on the user administration page admin/people there is a link below the tab row that lets admins add users (links to admin/people/create). Instead I would like to place that link in an additional tab next to the tabs "list" and "permissions". Has anybody experience in this? Or is there even a module for this?

I currently have difficulties finding anything because "add user tab" are quite generic search terms and there is a lot to find – but not meeting my problem.

thank you!


texts: Content type Text field as Geolocation source field in View

texts:
I have a text field(named as address) in my content type and I will store the address in that text field. Here I don't want to store the address in geolocation field so I have to use text field to store address.

I just created the View with page and have set Format as "Geolocation Google Maps API - CommonMap". In that Format settings I have to set Geolocation source field to display the Map. But I can't able to set Content type Text field as Geolocation source field.

Is there any way to set Content type Text field as Geolocation source field?


texts: How do I use "drush make" modules with a local module code?

texts:
I got to love the workflow "drush make" gives us. I am sure there are others who would want their development code to be put into a make file with it not being ready for drupal.org, for example, deploying a new development testing instance of the site quickly with a bash script or from what I have seen in Aegir.

It seems the current workflow that may suit this would be to utilize a git repository of your development code. However, my development machine is Windows 7, and I would like to use "drush make" in a virtual box with an Ubuntu server instance.


texts:
I have an existing content type that I would like to add a field to. However, after I've added the field in my development version of the site the field is not present when editing old content. On new content the field is available for editing.

I have entries in the field_data_field_content_field table from following the steps in  Bulk field update? (using EntityFieldQuery, entity_load, and entity_save). The values are usable by the node object, whether it was by viewing the node manually or loading it with entity_load. When viewing the node the field also appears in the $content array, but is not rendered even though I have not called hide() on it. It still does not show up as an option when I attempt to edit the node through Drupal.

Is there a proper way to nudge existing instances of a content type to use this new field in its edit form, or should I be manually re-making the old instances of the affected content types?


texts: D7: Resetting ALL user fields (Boolean) at once

texts:
In a nutshell, I'm trying to stop my users from getting e-mailed more than once per day.

I have some rules set up that will e-mail users when content particular to them is updated.
I have added a Boolean field to user profiles that starts off 'checked' (1) - indicating they have not (yet) been emailed today.

Any rules that e-mail users will first check this user profile value and proceed only if they haven't been e-mailed (field value is 1), but then set this Boolean value to 0 using set a data value in Actions - thus they won't get e-mailed again until the value is changed.

What's the best/easiest way to 'reset' that field in ALL user profiles periodically? (probably once a day)

i.e. at 10:00PM set the boolean field "field_user_not_emailed_today" for ALL users to 1. (checked)

I've seen VBO recommendations for this sort of thing, but seems unnecesary given the ALL users thing.  Is there perhaps a PHP snippet I could call in Rules that would do the trick?

Thanks!


texts: Pathauto, flags and contextual filter not working

texts:
I have a content type called ev and a flag for this content type.

I want a view that displays the users that flagged content.

When I build the user view with a relatioship  Flags: User's flaggings (bookmarks) and (user flagged content) Flags: Entity ID it works but only when the path is node/%/at

If the path is content/%/at it does not work nor it adds the menu item. Why is that happening?