texts: Hooking into the user login block to modify prefill default text in username and password

texts:
I am having problems getting a custom module to recognize the user login block.

Ultimately I need my user login block to only show the username and password fields, without any labels. Instead of labels I need to prefill the form fields with the words 'username' and 'password' and have this text disappear onfocus. This drupal answers question demonstrates how to do this with the search block and a custom module. I have been able get this to work without any problems.

I have tried to do a similar thing with the user login block.

First of all i used this to get the form id:

function custom_prefill_login_form_alter(&$form, $form_state, $form_id) {

 // uncomment to get form id
 drupal_set_message("Form ID is : " . $form_id);
 }

This returns Form ID is : user_login_block for the login block page
and
it returns Form ID is : search_block_form for the search block

When on a page with the search block enabled I can use this:

if ($form['#id'] == 'search-block-form') {
    dpm('search-block-form showing');
}

but when on the user login block page this doesn't work. Neither of these show anything in the message area:

 if ($form['#id'] !== 'user-login-block') {
     dpm('user-login-block showing');
 }

 if ($form['#id'] !== 'user_login_block') {
    dpm('user_login_block showing');
}

I am very confused as to why this isn't working. I would appreciate being shown how to write an if statement that targets the user login block.

My entire function is:

function custom_prefill_login_form_alter(&$form, $form_state, $form_id) {

    // uncomment to get form id
    drupal_set_message("Form ID is : " . $form_id);

    if ($form['#id'] !== 'user-login-block') {
          dpm('user-login-block showing');
      }

    if ($form['#id'] !== 'user_login_block') {
          dpm('user_login_block showing');
      }

    if ($form['#id'] == 'search-block-form') {
          dpm('search-block-form showing');
          $search_text = 'Your search text here';
          $form['search_block_form']['#default_value'] = $search_text;
           $form['search_block_form']['#attributes'] = array(
          'onfocus' => "if (this.value == '$search_text') {this.value = '';}",
          'onblur' => "if (this.value == '') {this.value = '$search_text';}");
      }

  }


texts:
I am using a key to connect with it's node nid but when I click on Next it gives path /node/node/256 instead of node/256. Here is my code:

$key = array_search($nid , $nids);
print $key;
$next = ($key + '1');
$previous = ($key - 1);
$total=count($nids);
$next_link =    "Next";
$previous_link = "Previous";

$nids is an array. How to handle this situation?


texts: How to remove results returned from Views UI

texts:
I am getting results as expected using Views UI. But I don't want to display a particular record from the output of Views UI. How to achieve this and will I require any hooks for this?

For example; My Views return result as 1,2,3,4. Now I don't want to show 1 in the result. I cannot change the query using hook_views_query_alter as 1 is being used in "where" clause.


texts: Can I have a GROUP BY as an expression? Without an alias

texts:
I want to be able to achieve the following query.

SELECT FROM_UNIXTIME(ROUND(UNIX_TIMESTAMP(datetime)/60)*(60)) AS datetime,
ROUND(MAX(value), 2) AS value
FROM  my_values v
WHERE (datetime > '2012-12-15 00:00:00') AND (datetime < '2013-01-01 00:00:00')
GROUP BY ROUND(UNIX_TIMESTAMP(datetime)/60)
ORDER BY datetime;

You'll notice that my groupby clause is dynamic, so far in Drupal I have:

$select = db_select('my_values', 'v')
  ->condition('datetime', '2012-12-15 00:00:00', '>')
  ->condition('datetime', '2013-01-01 00:00:00', '<')
  ->groupBy('gbdatetime')
  ->orderBy('datetime', 'DESC');
$select->addExpression('FROM_UNIXTIME(ROUND(UNIX_TIMESTAMP(datetime)/60)*60)', 'datetime');
$select->addExpression('ROUND(UNIX_TIMESTAMP(datetime)/60)', 'gbdatetime');
$select->addExpression('ROUND(MAX(value), 2)', 'value');

This achieves the desired results, however It'd be great if I could do a GROUP BY ROUND(UNIX_TIMESTAMP(datetime)/60) without requiring the alias gbdatetime.

So, my question is can I have a GROUP BY as an expression?


texts:
When I loop through my .views-row divs in jQuery, I need to 'grab' the one that is clicked on, needing to uniquely identify it and put only the selected fields from that particular div in my modal frame. Now I have the selected fields of all the divs within that loop in my modal frame.

I don't think I'm too far off with the following here below. I think the only thing that's missing is that I haven't been able to properly 'say' to drupal which div is being clicked and see to which views-row-number it corresponds to in order to display only that one in the modal frame.

obviously jQuery(".views-row .views-row-" + index).click() isn't the way but I'm sortof out of ideas which one that would be then.

jQuery(document).ready(function(jQuery) {

    row = jQuery(".views-row");

    row.each(function(index){
        forModal = jQuery('.forModal');
        forModal.hide();
        jQuery(".views-row").click(function(){

                if (jQuery(".views-row .views-row-" + index) ==
                                jQuery(".views-row .views-row-" + index).click()){
                                 forModal.modal();
                }

        });
    });

});


texts: How do I create anonymous emails sent by users and allow other users to reply back to the anonymous email?

texts:
Would like to create something like Craigslist in terms of its anonymous emails so that Logged-in users can send email from the site. Once they do, their email will be changed to randomtext@domain.com instead of their original email. This is to prevent other users from knowing the real email of the authenticated users.

Other users should still be able to send them email with the randomtext@domain.com as To and that reply would be saved on the Users's profile.

How would you go about implementing this? The module I found that's close, but not sure how it works is Mailhandler with Singlebox . But there's rarely any documentation for it. Do you recommend other solutions?


texts: Is a content type or profile a better choice?

texts:
I am working on a new site where I want to show information for art galleries, artists, museums, public art installations and art education.

I understand both the content type and profile differences but can't decide which is better in the long run. I know the artists will need a profile and I would like to give the rest of the "types" the ability to edit their own content if they desire.

I have done a lot of research and can't seem to find an answer on how to link a content type entry with a user profile and am leaning toward profiles for everybody. However, this has drawbacks because of need for authentication info (which I don't know) as I create the profile.

Am I missing a magic module or some other clue?


texts: How to show the actual node on a group-content page when using the Group module?

texts:
Creating a new group-content in Group module on Drupal 8 generates a normal node without any "live" context to the group. So viewing this node does not allow the group-actions block to work.

If you view the group-content reference page you can not see the actual content of the node, but the context is intact and you can use group-actions block.

How to show the actual node on this page?

I was thinking maybe using a view for full rendered content filtered by group-content-id. this is working fine as long as I use no aliases at all.
So using group/3/content/8 as url and filtering for group-content-id of 8 is working.

But how to filter for an alias like www.example.com/mynewgroup/mynewgroupcontent?


texts: Dynamically prepend or append a path element to content urls?

texts:
Is there a way I can easily prepend a dynamic element to the beginning of content urls?

For example, I have a /photos-galleries Panel/Page which includes a View showing a bunch of photo galleries. I also have /videos which similarly shows Videos. Both of these items exist in my main nav menu.

If I let the user browse to /cats/photo-galleries then my View uses a contextual filter so it will only show photo galleries tagged with cats. That's fine and I have that working.

Let's say one of those photo galleries has the content url /photo-gallery/kittens-1

If the user clicks on that link and goes to /photo-gallery/kittens-1... then my problem is that the main menu with the /videos link no longer has the cats "filter" on it. I want that filter type to follow the user along.

So, I'd like to rewrite the links to the content generated by the View so that I can change /photo-gallery/kittens-1 to /cats/photo-gallery/kittens-1 that way when the user clicks on that piece of content, I'll still be able to know that I'm filtering my site content according to cats.

Does that make sense? Any suggestions on how I can rewrite those urls, based on the current page url, being generated by the view?

Or if it is easier, I can append the cats filter tag to the end of the urls and make it /photo-gallery/kittens-1/cats. That would be fine also.

I'm not asking about how to filter the content in the view, I'm asking about rewriting the url of content items generated by that view so that it maintains the same /cats filter.


texts: Webform confirmation message on same reloaded page

texts:
Webform has option to reload the page when submitting the form, but it just refresh the page and doesn't show any confirmation message that the message was sent etc. This might look misleading for simple home user when submitting the form.

Anyway to adding a confirm message on page refresh?

E.g. when submitting it as admin for more than once it actually reload the page and gives message that you already submitted this form. So basically I need the same when visitor submits the form and it would reload the page and show message like 'Thank you, your message was submitted'.

Cheers


texts: Node Access permission for anonymous users

texts:
The website is set Only login users can access. but There are times a node maybe allow an anonymous user to access by sending the user the URL for the node.

I try to use the Content_Access module to make it but it failed to make it.

How can achieve it??


texts: Get only one value from a multivalue field in template node

texts:
I have a content type which has a multivalue image field. I need to create a template that displays a list of nodes of that type but displays only one value of that multi field, not all of them together.
I know we can do if we use views under 'multiple field settings' which is explained here
views 3: select only one value from a multivalue field but I am not using views, Can we do using only template nodes?

node title1

first image

node title2

second image
etc

Please help.


texts:
Is it possible to create a custom field widget or use hook_form_alter() to show multiple form elements that, used together, can set the value of a single field?
For example, I added a textfield Personalization.
But on the entity edit form, I do not want users to edit the Personalization field directly; instead, I want them to check some boxes and fill in some text fields, and then I want to process that data and set the value of the Personalization field as a result of that processing.  How do I set up the extra form elements and use them to set the value of the field?
I tried to do this by override the textarea FieldWidget:
/MYMODULE/src/Plugin/Field/FieldWidget/TextareaPersonalizationWidget.php
<?php

namespace Drupal\MYMODULE\Plugin\Field\FieldWidget;

use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextareaWidget;
use Drupal\Core\Form\FormStateInterface;

/**
 * Plugin implementation of the 'text_textarea_personalization' widget.
 *
 * @FieldWidget(
 *   id = "text_textarea_personalization",
 *   module = "MYMODULE",
 *   label = @Translation("Personalization widget"),
 *   field_types = {
 *     "text_long",
 *     "string_long"
 *   }
 * )
 */
class TextareaPersonalizationWidget extends StringTextareaWidget {

  /**
   * {@inheritdoc}
   */
  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {

    $element['a']['#type'] = 'textfield';
    $element['a']['#title'] = 'Your fav animal';
    $element['a']['#maxlength'] = '255';
    $element['b']['#type'] = 'textfield';
    $element['b']['#title'] = 'Your fav fruit';
    $element['b']['#maxlength'] = '255';
    return $element;
  }

}

This causes two textfields to be shown instead of the textarea.  Great!  Except the value never gets saved, and I can't process the input text in hook_entity_presave().  So how can I process the input in the custom form elements and save the result in the original field?
I also tried the same thing in MYMODULE_field_widget_string_textarea_form_alter() but I had the same problem.
More details about how my site is set up
Here's my setup: I have a flag called Collection.  This flag contains a textfield, Personalization.  This textfield will contain pairs of strings for replacing text with JavaScript in order to customize the text on terms that have been flagged by the user.
Of course, I don't want users to type in arbitrary strings into a textfield; this would be a terrible UI.  So, when a user flags a taxonomy term, I want to show some form elements that allow the user to input some options for personalization.  These form elements will be different depending on which term is being flagged.  For example, if flagging the Fruits term, I want to add a text field "What is your favorite fruit?"  And on the Cakes term, I want to add a list of checkboxes "Choose all the types of frosting you like."
In other words, I want to define a custom form per taxonomy term that sets the value of the Personalization field, and I want to somehow embed this custom form on the flag add form.


texts: Should I make a SOAP or a REST service to receive files from a .Net WCF Service?

texts:
I need to implement a web service client in drupal 7 using the Web Service Client module,  which receives files from a .Net WCF Service.

Should I make a SOAP Service or REST service using WCF such that the web service client can easily implement the file receiving logic in Drupal/PHP?


texts: Getting rid of strongarm in features export

texts:
I exported a feature and it came wiht a bunch of strongarm configureation that I didn't want. I was able to delete most of it, but I wasn't sure about this part:

/**
 * Implements hook_ctools_plugin_api().
 */
function mymodule_ctools_plugin_api() {
  list($module, $api) = func_get_args();
  if ($module == "strongarm" && $api == "strongarm") {
    return array("version" => "1");
  }
}

Can I get rid of it altogether, or should I just have it return the version, for ctools?


texts:
I want to show the contact form in popup. How should I actually do it?
I tried to create a module and call the function in it.
But I am confused on how to implement *hook_block_view()*

Is there any other way to this?

This is my first drupal project.
And later do I realize that I am not having template.php in my theme folder.

This is what I have done.
 1. I had made a block in my page, named 'popup_this'.
 2. I made a module named 'popup' and made to display in this block.
 3. I had activate the module named 'contact' in the site.
    It is called in the link '?q=contact'.
 4. I am trying to call this form in my custom module.

I don't know how to implement the function popup_block_view().

Thanking you in advance


texts: Getting "Additional uncaught exception thrown while handling exception"

texts:
I tried to install module Commerce Event Ticket, added all the requirements, then enabled Commerce Event Ticket and got an error message:

Additional uncaught exception thrown while handling exception.

Original

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column &#039;base.owner&#039; in &#039;field list&#039;: SELECT base.id AS id, base.name AS name, base.label AS label, base.plugin AS plugin, base.active AS active, base.weight AS weight, base.status AS status, base.dirty AS dirty, base.module AS module, base.owner AS owner, base.access_exposed AS access_exposed, base.data AS data FROM {rules_config} base WHERE (base.plugin = :db_condition_placeholder_0) AND (base.active = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] =&gt; reaction rule [:db_condition_placeholder_1] =&gt; 1 ) in EntityAPIController->query() (line 187 of /home/content/q/u/a/quaa7882/html/sites/all/modules/entity/includes/entity.controller.inc).

Additional

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column &#039;base.owner&#039; in &#039;field list&#039;: SELECT base.id AS id, base.name AS name, base.label AS label, base.plugin AS plugin, base.active AS active, base.weight AS weight, base.status AS status, base.dirty AS dirty, base.module AS module, base.owner AS owner, base.access_exposed AS access_exposed, base.data AS data FROM {rules_config} base WHERE (base.plugin = :db_condition_placeholder_0) AND (base.active = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] =&gt; reaction rule [:db_condition_placeholder_1] =&gt; 1 ) in EntityAPIController->query() (line 187 of /home/content/q/u/a/quaa7882/html/sites/all/modules/entity/includes/entity.controller.inc).

Now, this message also appears on the page without admin rights i.e. my page is  Offline now! How can I fix this?
Thank you!


texts: How to export and import from View in Drupal7?

texts: i have a view in my project. And i want to import and export the views in Excel format. How to achieve this?


texts: How to Create a Table of PDFs with Views?

texts:
I've been tasked to develop my company's intranet with Drupal. One of the key items is to allow our HR department to upload job openings (PDF's) to display on site. I'm envisioning having this table output using Views but I'm not sure how to set up the front end for the Department to publish the files.

They need to be able to upload a file, give it a name (Job title) & date of upload. Table will then populate with them.

Any guidance would be greatly appreciated, I'm new to Drupal.

Regards
Tony


texts: Setting managed file default value from ajax request

texts:
I'm trying to create a form using the Form API with the following behavior:

For a custom slider module, users can choose to upload an image which is saved as a managed file. This works fine.
They also have the option to populate the slide content (slide title,link and image) from an existing node of a custom type. The node is selected from an auto-populated select field which on change calls an ajax function to auto-populate the title and subtitle fields. If the selected node has an image attached to it, a checkbox is displayed allowing the user to use the already uploaded image associated with node as the slider image as well.
The problem I have is that I can't get the manged_file field to accept the nodes file id (fid) and re-render as managed_file with a default_value before returning it from the callback.

Here's my callback:

function load_image_callback($form,&$form_state) {
    // Load node from the selected value
    $node = node_load($form_state['values']['slide_nid'];

    // Set the managed_file default value to the nodes main image file
    $form_state['complete form']['slide']['slide_image']['slide_fid']['#default_value'] = $node->field_main_image[$node->language][0]['fid'];

    // Return the updated slide image wrapper to replace the existing one
    return $form_state['complete form']['slide']['slide_image'];
}


texts: How do I calculate the average for multi-axis voting for a specific node?

texts:
I need to calculate average for multi-axis voting for different nods or content types.

For example, I have three different voting axes in node "A" and below them must appear the fourth field with the average.

It will be better if this field has a tag as voting axes have.

I saw solutions using tag "vote" but they used it to average all other multi-axes. So I can not use different multi-axes for each node or each content type.


texts: How to create a basic message - notifications system displaying a real time message counter badge?

texts:
I'm looking for a way to create a basic current user notifications system for my site, e.g.:

"some user" has created a new "group"
"some user" has joined your "group"
"some user" has posted a node in your "group"
"some user" has written a "review" for your "article"
"some user" has commented your "review"
etc...

I imagine this system as a simple menu link with a counter badge attached to it showing the number of new unread notifications just like this site or linkedin.com site.

When clicking upon this link current user will be directed to a page showing the user's new notifications and the counter will be then set to 0.

I believe what I need is the Heartbeat or Message module, combined maybe with Menu badges. But I'm not sure what to choose and how to start. Any advice?


texts:
I have developed website using drupal 7. I created block using Views Slideshow Cycle. I uploaded the site to server. The slideshow not displayed in live site. But after clearing cache(using configuration->Development->Performance) the slideshow is visible.The problem is that i need to clear the cache frequently to display the slideshow. The below image is the site without slideshow.

This is the site with slideshow after clearing cache.

I am also having hidden fields using field permission. That are also visible to anonymous users. But I gave the field view permission only to authenticated users. Those fields are hidden for anonymous user after clearing cache.
I didn't enabled cache pages and cache blocks. But the site in my local system does not have this issue.
These issue only with my live site. My hosting server is apache.
I have this problem for a month. Please suggest me a solution


texts: How do I change the SPARQL query using the sparql_views module

texts: I'm using the SPARQL Views module to pull in data from the DBLP endpoint, it's pulling data and displaying it in views based on the field mappings, the SPARQL query however is generated dynamically and I'm not able to modify it, any suggestions on how to directly enter a query would be great.


texts: Drupal 7 - How add posfix '.html' to all paths?

texts:
is it possible to add to all path system or node path postfix '.html'
for example

site.com/index -> site.com/index.html
site.com/user/login -> site.com/user/login.html
site.com/node/add/page -> site.com/node/add/page.html

pathauto

site.com/term-alias/hello-world -> site.com/term-alias/hello-world.html

and so on

Is it?


texts:
I am trying to Create Services to Create Node Type Discussion in a Group using Services Module, but getting the error : 401 Unauthorized : Missing required argument node
In the Header I have given:

Content-type:application/json
x-csrf-token:token value
session-name:session name value

In the Body I have given :
{
"og_group_ref": {"und": [{"target_id": "3897"}]},

"title": "Title of discussion",

"field_description": {"und": [{"value": "test description"}]},

"type": "discussion",

}

Can anyone please tell me why I am getting this error ?


texts:
Is it possible to split the rendering of the blocks in a region ? I have see this question Drupal 8 - How to split display the blocks separately in region.html.twig attempting to solve this by using    {{ elements.search}} and I have tried it, but no success yet.

I also tried {{ elements.children[0] }} but this failed as well.

Is there a possible way of getting the array element out individually.

Many thanks


texts: How to changing Bartik's "Show - Main navigaton" mobile menu message?

texts:
When you install Bartik and minimize your browser to mobile display you can see the caption "Show - Main navigaton":

I want to translate it to Hebrew so I went to admin/config/regional/translate and typed the stream to change it but found nothing so I guess it's hardcoded somewhere.

Yet, I searched in page.html.twig and menu-block twig but didn't find this stream. I also didn't find CSS language-construct (as in content:x;).

You might know where this stream is located or at least answer with a good way to search it?


texts:
Is it possible to associate a path with a specific drush alias?

Use case:

I'm on my local dev machine and I'm in /var/www/site1 when I run drush I want it to run as drush @site1 without me having to append @site1 every time.

My alias files are all stored in the my local home directory.


texts: Hierarchy taxonomy terms for node path in drupal 7

texts:
I have a vocabulary with 3 levels and a node type with a term reference to that vocabulary.
When I create a node of that type I choose a term in the deepest level of the vocabulary and now the question comes.
I have pathauto module installed and I'd like to build a pattern like this:

[node:field_category:level-1]/[node:field_category:level-2]/[node:field_category:level-3(deepest)]/[node:title]

The problem is that can't find the right token to achieve this behaviour. This afternoon I have been searching the web and I can't find a solution.

Any ideas? ( I'm using Drupal 7)


texts: print all the titles of a content type by php

texts:
I created a content type: "period".

Then, I created instances of this content type.

Now I would like, on a page tpl.php put the instructions, to print all the titles of the instances that I put on this content type. is it possible?


texts: What would cause a Drupal site to display a 500 error or a blank page depending on browsers?

texts:
After moving a site to the final server, I cannot anymore access the site. When I go to the home page, I get a WSD on Firefox, and a 500 error on Google Chrome.

As it is a shared hosting, I cannot access the Apache error log, and I am wondering if anyone experienced that before. How did you find your way out of it?


texts: What does this Omega theme warning / notice mean?

texts:
I’m getting this Notice repeatedly on my Drupal Commerce site, in various places. Not sure though exactly what is triggering the notice. This Notice is:

Notice: Undefined property: stdClass::$dir in omega_css_alter() (line 276 of /home/lovetrib/public_html/sites/all/themes/omega/omega/template.php).

And the line #276 in the Omega template file is

$pattern = $GLOBALS['language']->dir == 'rtl' ? '/\.no-query(-rtl)?\.css$/' : '/\.no-query\.css$/';

I believe it’s looking for a no-query.css file….?

To remedy I put a file named omega.no-query.css in the css folder. Since Omega is a base theme there is also a mytheme.no-query.css file in my theme’s css folder.

Can someone explain precisely what that line is doing and how to fix?


texts: Using Drush without local copy of Drupal, only calling site aliases - No site aliases found

texts:
We have a project which does not contain a Drupal codebase. It's Cypress.io test with Drush 9 added using Composer. I would like to execute Drush with site alias to work with the remote site while running tests.

I'm able to call Drush from Cypress test just fine. The Cypress part actually does not matter at all as the behaviour is the same when I run Drush command directly.

The setup:

composer init fresh project
composer require drush/drush

✔ rk:/tmp/drushtest> vendor/bin/drush version
 Drush version : 9.7.1
✔ rk:/tmp/drushtest> vendor/bin/drush sa --debug
 [preflight] Config paths: /tmp/drushtest/vendor/drush/drush/drush.yml
 [preflight] Alias paths:
 [preflight] Commandfile search paths: /tmp/drushtest/vendor/drush/drush/src
 [bootstrap] Starting bootstrap to none [0.09 sec, 7.33 MB]
 [bootstrap] Drush bootstrap phase 0 [0.09 sec, 7.34 MB]
 [bootstrap] Try to validate bootstrap phase 0 [0.09 sec, 7.34 MB]
 [success] No site aliases found. [0.09 sec, 7.36 MB]

Already there is nothing in Alias paths.
Added some drush aliases to drush/sites/remoteproject.site.yml (valid yml file that is working in the Drupal project)
While debugging this I tried to add a drush.yml config file to point drush to the alias.

✔ rk:/tmp/drushtest> tree
.
├── composer.json
├── composer.lock
├── drush
│   └── sites
│       └── remoteproject.site.yml
├── drush.yml
└── vendor
    ├── ...

✔ rk:/tmp/drushtest> cat drush.yml
drush:
  paths:
    alias-path:
      - drush/sites/remoteproject.site.yml

✔ rk:/tmp/drushtest> vendor/bin/drush sa --debug --config=drush.yml
 [preflight] Config paths: /tmp/drushtest/drush.yml,/tmp/drushtest/vendor/drush/drush/drush.yml
 [preflight] Alias paths: drush/sites/remoteproject.site.yml
 [preflight] Commandfile search paths: /tmp/drushtest/vendor/drush/drush/src
 [bootstrap] Starting bootstrap to none [0.08 sec, 7.34 MB]
 [bootstrap] Drush bootstrap phase 0 [0.08 sec, 7.34 MB]
 [bootstrap] Try to validate bootstrap phase 0 [0.08 sec, 7.34 MB]
 [success] No site aliases found. [0.08 sec, 7.37 MB]

So I convinced Drush to see the site alias file, but the alias itself is not loading.

When I try to use the alias:

✔ rk:/tmp/drushtest> vendor/bin/drush @remoteproject.remotesite.dev status -debug --config=drush.yml
 [preflight] The alias @remoteproject.remotesite.dev could not be found.

Is this conceptually wrong? (Having only Drush and calling remote site using site alias.) Am I just missing some option? Or is this ready to be "promoted" to Github bug report / feature request?

Thanks!


texts:
I'm new to views and was wondering how I can accomplish this:

I have two views one that takes receivable invoices and displays them and then totals them at the end of the table using View Aggregate Plus. Another view that grabs invoices that are payable and once again totals these together.

What I'm looking for is a way to take the total of these two views and then display it in a third view called balance which will take the total of receivable invoices and subtract the total of payable invoices.

Is there a way to do this?


texts: How could I create multiple private sites within one Drupal site?

texts:
Can I create a Drupal site, where a user, let's call her Jane, can create an account and publish some content, like a few articles. Then create accounts for her friends who can login and view all the nodes she has created, and which they create. At the same time, Paul creates an account, creates some nodes, and invites his friends etc. However, Paul and his friends cannot see Jane's nodes or users - and vice versa. It feels to Jane and Paul that they have there own separate website.

What are the key Drupal concepts or methods for creating a site like this? Thanks.


texts: Token filter does not show image field with FlexSlider formatter

texts:
I want to display a gallery with the FlexSlider formatter in a Body field.

I installed the Token and Token filter modules and enabled "token filter" in text formats (admin/config/content/formats).

On my content type (admin/structure/types/manage/[content_type]/display) I enabled the "Token" display mode in "Extended display parameters".

For the Token display mode (admin/structure/types/manage/[content_type]/display/token) I set the FlexSlider formatter for my image field (field_gallery).

I added a node with the [node:field_gallery] token in the Body field but the token is being replaced with nothing.

How can I make an image field using the flex slider field formatter work with the token filter module?


texts: Is there a way to get multiple image sizes from a single image?

texts:
In Drupal 8 Manage display for the image field, I can assign only one image style.

I have two image styles: thumbnail and medium.

when I upload an image through image uploader, I need to view my uploaded image in those two image styles.

Is there a way to show the image in those two sizes from the single image I have uploaded?

If I selected thumbnail in the manage display on the image field it will save the image as thumbnail, but not as medium size as well. I need to save the image
 in both the sizes, or I need to get both the styled images from the single image I upload. The following code can get the image for the given style in manage display.

$imageStyle = ImageStyle::load('medium');
$galleryImage = $imageStyle->buildUri($image->entity->getFileUri());


texts: How to sort node resource in index call in ascending order the in service module

texts: Hi I am using service module 7.x-3.12. I am able to fetch the node resource in index call on several different parameters and its working fine but I am stuck in a situation where I need to fetch the data in ascending order. But by default I am getting the data in DESC. Is there any way I can fetch the data in ascending order by providing a custom parameter say, sort_by.


texts: Select list of node titles for a view exposed filter

texts:
I want to create an exposed filter based on the title of a node. How do I do this? I would prefer this filter be a select list - that is, all of the node names are listed based on the criteria I list.

So let's say you have three titles for events:

A Trip to the Woods

Go to the Beach

Off to the Farm

I would like the exposed filter to be a select list of these three nodes.


texts: Multiple copies of Views filter form (exposed filters)

texts:
I know in views you have the option to expose the filters form as a block, but doing so removes the exposed form from the view page.  Is there any way to expose the filters form as a block and keep the exposed form in the view as well?

For example, is there a way to see

at the top of my view, but on every other page have an exposed form block like

in the side bar?

This would be helpful as when a user is on  a view page, he/she will be primarily concentrating on the main content and would look for a search there (instead of in a block on the side of the page).  However, users should be able to search the view from any page on the site (enter block).

Currently I have a custom module creating a block to act as the exposed form block while in Views I have Expose form in block set to "No".  Is there an easier way to handle this?


texts: mysql_query doesn't work but db_query does on a simple SELECT query

texts:
I'm receiving the following warnings when I use mysql_query() in my modules:

mysql_query(): A link to the server could not be established in ...... on line 6

If I use db_query() instead, it works fine.

The code is a simple SELECT query with no special characters or variables.
The actual query is mysql_query("SELECT * FROM custom_nodify WHERE nid = 345");

I should mention that this happens with ANY mysql_query(), not just the one above.

Any suggestions as to why this doesn't work?


texts:
Should I install Drush 8 or Drush 9 for Drupal 8?

What does the code status failing mean? Is Drush 8 not compatible with Drupal 8?


texts: How can I save parts of the URL to the database when a certain page is viewed?

texts:
Can a page be created the normal way (not by module) in Drupal 7, using Content Type an so forth, yet still trigger a module and pass a variable from the URL.
The idea is to let the web team create their page as normal, but require the last part of the path to be a variable. Then a module is called to take that variable and do magic with it.
We want the module to work with the variable in the background, NOT render a page.


texts: How to prepopulate fields in Reference Dialog box?

texts:
There is a similar thread Prepopulate a field in a Reference Dialog Box
I would like to grab from the node its author name, values of several fields and to prepopulate fields in the references dialog box with them. Is it possible to do?

Reference Dialog is displayed via iframe so getting the nid from the URL won't work.


texts:
I downloaded drupal 8 and performed an install without any noticable incident, after completing the install I attempted to use drush to install 4 additional sites, I added the sites to the sites .php file.

However I am having various problems with the sites. Two of the sites load ok, another one loads with this screen “The website encountered an unexpected error. Please try again later.” and a plain white screen. Another of them loads with what is mostly just text and plain text links, but no theme/colors etc.

The only thing that I have noticed that is abnormal is that in my sites/default/files dir I have 3 config_*** dirs. I am not adverse to beginning the entire process over gain, I simply would like to know the exact steps I must take to get all of the sites installed and working correctly.

I really don't understand d8 all that well but I feel like there is some config issues) going on. Any and all help would be very welcomed. I would really like to get these sites up and runing. Also can anyone please advise the correct owner and permissions for the sites/files dir?

I did notice that there is a default.services.yml only in the default dir not the other sub sites.


texts:
I have a field collection with name as 'TELEPHONE NUMBERS AND DETAILS' and the machine key as 'field_telephone_numbers'.

When I use node_load getting the output as

[field_orgs_number_details] => Array

(

[und] => Array

(
    [0] => Array

    (
        [value] => Number 2
        [format] =>
        [safe_value] => Number 2
    )

)

)

[field_orgs_telephone_number] => Array

(

[und] => Array

(
    [0] => Array
    (
        [value] => 123456
        [format] =>
        [safe_value] => 123456
    )

)

)

How to read the data 'Number 2' and '123456' into a array.

Updated:

 [1] => Array

   (

   [entity] => Array

      (

        [field_collection_item] => Array

            (
            [15994] => Array
                (
                [field_orgs_number_details] => Array
                    (
                    [#object] => FieldCollectionItemEntity Object
                       (
                         [field_orgs_number_details] => Array
                             (
                                [und] => Array
                                    (
                                        [0] => Array
                                            (
                                            [value] => Number 3
                                            [format] =>
                                            [safe_value] => Number 3
                                            )
                                    )
                            )

                        [field_orgs_telephone_number] => Array
                            (
                            [und] => Array
                                (
                                [0] => Array
                                  (
                                [value] => 333333333333
                                [format] =>
                                [safe_value] => 333333333333
                                )
                            )
                        )

                    [rdf_mapping] => Array
                        (
                        )

                [entity_view_prepared] => 1
                    )
                )
            )
        )
    )
)

 When i use

 $data = render($content['field_telephone_numbers']);

 Getting output as

  Telephone
  123456  - Number 2


texts: embedding a block inside a views template file

texts:
This question could be asked in numerous ways, so I'm just going to explain my situation.

I currently have a block that works fine listing any child nodes (node reference is used between the nodes). This works as it uses an Argument for the Node ID so it can list all the children in a nice list.

However, I wish to have this very list of child nodes - displayed in a sort of "Teaser List" from a seperate view. The reason this "new" view wont work - is because there is currently no Node ID to reference the children - as the block doesn't sit on the parent page anymore.

So my initial solution was to embed a view using views_embed_view with something like:

print views_embed_view('show_units_display', 'block_1', $node->nid);

And I would have this in my views template file for each result row. But seeing as the view itself sits on an entirely seperate page - no Node ID is passed here and there no results are displayed!

My overall outcome would look like this:

Node 1 - title
Node 1 - body

-- display list of children of node 1 here --

Node 2 - title
Node 2 - body

-- display list of children of node 2 here --

And so on...

Any help would be brilliant!
Cheers,
Garry.


texts: drupal 6 node server.js populate error on running?

texts:
I have followed drupal.org instruction to install node.js and NPM, and when I install all packages I get this error:

while running node server.js

  server = express.createServer();
                   ^
TypeError: Object function createApplication() {
  var app = function(req, res, next) {
    app.handle(req, res, next);
  };

  mixin(app, EventEmitter.prototype, false);
  mixin(app, proto, false);

  app.request = { __proto__: req, app: app };
  app.response = { __proto__: res, app: app };
  app.init();
  return app;
} has no method 'createServer'
    at Object.<anonymous> (/var/www/html/sites/all/modules/nodejs/server.js:943:20)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3


texts:
I have a tableselect and I have been looking all over the internet for a tutorial on how to make a tableselect have sorting/drag-and-drop functionality. I have found tutorials for making normal lists have click and drag, but not a single mention of tableselect.

I would like to know if making a tableselect draggable is possible. I'm not asking for a tutorial. At this time I just want to know if it is possible.

This the form element I am using.

$form['mod_setttings']['settings'] = array(
  '#type' => 'tableselect',
  '#header' => $header,
  '#options' => $options,
  '#empty' => t('No settings available')
);

This tableselect is inside a vertical_tabs element.


texts: How to delete true orphaned taxonomy terms

texts:
I have a taxonomy vocabulary that contains a large number (5000+) of orphaned taxonomy terms. By orphaned I mean that they refer to parent terms that no longer exist, or refer to parents who are themselves orphans (grand-orphans ?). I am not talking about unused terms.

I do not see these terms in the Drupal interface as they are no longer connected to the main hierarchy. I can however still see them in the database, and I can open them directly using the tid in the Drupal interface.

I can't bulk delete them using any module because modules get the entire tree of the vocab to delete - and they are no longer part of the tree. I think I will have to delete them manually in the database.
I can delete the terms from the taxonomy_term_data and taxonomy_term_hierarchy tables:

DELETE FROM taxonomy_term_hierarchy WHERE parent NOT IN (SELECT tid FROM taxonomy_term_hierarchy) // or something like it

Are there any other tables I need to think of though, in order to not end up with a database that's messed up worse than it already is?


texts:
i'm trying to create a timetable using Drupal 7. I need this timetable for an event.

At the moment I created it throught views but I think it is too much "heavy".

I did it in this way.

I created 3 content types: Speaker, Company and Agenda.
In the Agenda content type I've got the node reference fields pointing to Speaker and Company.
The event has got 3 streams.
Now I'm managing the display throught the views, I've created a basic page with a table and per each row (time) I've put one view (content) which shows 3 nodes (one per each stream).
this is a normal view wich shows title and body of the node.
To show the speaker and the company I've created another view (fields) with agenda nid such as contextual filter. I've put it inside agenda--node.tpl.php.
Then I've put another view inside agenda--node.tpl.php which create a js dialog with the topic, speaker and company info.
Basically we have in one page about 70 views...

Is it heavy?

I need to create something like this http://cph2010.drupal.org/sessions/timetable.html and the way I would like to create it is this http://groups.drupal.org/node/2567 with this dript style.

Does anyone know the right way to create a timetable with drupal?

Thanks in advance.


texts: Can't login: user/login redirects to live site

texts:
I copied a live site built by a previous developer to my local MAMP environment, and discovered that trying to use /user/login redirected me to the live site. I discovered that .htaccess had numerous dreaded 301 redirects. So, I changed the .htaccess to a clean one, cleared cache, cleared history, rebooted MAMP, tried a clean browser. I think I've now cleared the 301 redirects to regular pages, but user/login still goes to the live site.

Created fresh local install with a clean .htaccess; clear cache, reboot MAMP, etc, still can't login to local.

Is there a backend way to login to drupal? Through drush?

Could that demon-spawn developer have set something else that prevents local login?


texts:
When using nodes, I use the rather good Feeds Import module and all is well with the world. I now need to use an entity as don't need URLS, comments etc so have created one called 'Cars' and have various fields attached to this.

I now need to import 1000 cars but have no clue how to do it? Using nodes this is very simple from csv, xml etc but entity seems to have no such module.

Does anyone know what I need to use to do this? Would I need to create a custom script that connects directly to the mysql and that writes to the fields I created?


texts: Show only comments from users with the same role

texts:
I am currently analyzing a project and am encountering the following situation, where I'd like to know your point of view.

For a specific content type we would like to allow users to place comments, but they should only see the comments made by users with the same role. Only administrators should be allowed to view them all.

Anyone encountered a similar situation?


texts: What's the best module to serve mp3 or audio files securely? Problem with jPlayer, etc

texts:
I'm trying to protect (in this example) audio files from being downloaded.  I'm currently using jPlayer because it is supposed to provide download protection (which it supposedly does, but it breaks when I enable it).
Surely there is a way to prevent leeching and downloading of files.
The Drupal private file system, as I understand it, only restricts access per user role.  Creating a path system/files/file.mp3.  Which tells Drupal to check if the user has permission to download the file.
So if I set that up - with the file storage outside my public root - when i type     http://site.com/system/files/file.mp3, Drupal just serves up the file and it starts downloading.
Its a public file system by default, the audio file is a private file field.
If I turn on protection in the jPlayer module then it wont play.

In the reports, immediately when viewing the node that the audio is on I get
that the file cannot be accessed - twice in a row. Clicking on play gets me this:

  PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062
  Duplicate entry '1-30-1318255859' for key 'PRIMARY': INSERT INTO
  {jplayer_denied} (uid, fid, hostname, timestamp) VALUES
  (:db_insert_placeholder_0, :db_insert_placeholder_1,
  :db_insert_placeholder_2, :db_insert_placeholder_3); Array (
  [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 30
  [:db_insert_placeholder_2] => {my ip address here} [:db_insert_placeholder_3]
  => 1318255859 ) in drupal_write_record() (line 6868 of /var/www/html/drupal/includes/common.inc).

Can anyone steer me in the right direction here?

EDIT:

Well I finally got the private serving working actually - kind of.  It will serve up the file once when the page is first loaded and will only serve it again if I almost immediately try and hit the URL again.  Then after a couple seconds it will block it like it's supposed to.  This works good enough for now I suppose.


texts: Add language switcher in section where i need

texts:
I want to add the language switcher block along with menus as show in the example. Please see this website http://rafedh.sa . I want to do something like this. Drupal by default does this. But i am not able to move it to top to shown in menu. By default its shown at end of the node.

I am using this theme http://drupal.org/project/danland


texts:
I'm going to use React with D8 and perform so-called Progressive decoupling, i.e. use React Components on existing Drupal pages.

There are several articles on this topic but the information is not complete. It would be great to summarize it and define the best method of implementing React.

I've chosen this guide to start with and created a React App inside my custom module folder. I've also decided to use JSON API instead of RESTful Services, according to the recommendations.

After that author recommends to use Paragraph module to implement separate paragraphs which will be replaced by React components.

It is not clear to me what structure should my custom module have? Do I need a router, controller, .module file or maybe a plugin? Where should I put hook_preprocess_paragraph__HOOK function?

My idea is simple - to use different paragraphs for different React components and insert them into an existing layout.

Any best practices?


texts:
We're looking to create a drupal commerce site with multiple languages for Drupal translated manually stored different translations in a seperate fields. Different fields would be displayed upon changing the language type.
i.e.

field_title (english) -> field_title_fr (french) -> field_title_gr (german)
field_description (english) -> field_title_fr (french) -> field_title_gr (german)
field_price (english) -> field_price (french)
-> etc...

Is it possible to click a link to have the website trigger a language change?
Also, how could you have drupal display a different field?
Would this method be the drupal way of doing it ? Or is there a module for this already?


texts: Generate an ID, Serial or Auto Increment number for child entities of a parse XML

texts:
I am importing several xml files with feeds tamper. Each file depic a "Contact", and using Xpath parser I am able to get child entities from each file/contact like his/her addresses.

Using entityreference autocreate it's possible to create nodes for each of these addresses, on the fly, at the same time that you import Contacts.

Problem is that xml file doesn't define an ID for these address entities so I need to generate one which will be the node title (I don't want to use the address as node title because It's too long).

I have tried with "Calculate Hash" Feeds Tamper plugin, but only generate the first address for each contact.

Also, I have tried with plugin "Setting a default value" to 0 and after this set "Mathematical operation" adding +1, but for the next iteration, value is set again to 0, not store till file end parsing, and I don't figure how to do it, maybe with Feeds Tamper PHP?


texts: How to output a custom field in my template?

texts:
In my content type I have created a custom field field_image_style which is a list (text).

How can I print its value in node.tpl.php?

print render($content['field_image_style']);

This doesn't work?

(What I actually want to achieve later is to use the selection the user made in field_image_style to apply a specific image style to the images of the content element.)

EDIT: Somehow the Zen theme was the reason. With my own Stark based theme it works like it's supposed to.


texts:
How can I change the label for a view to be a div instead? Here is my HTML, its the "Sort by" label I need to change.

<form class="ctools-auto-submit-full-form views-exposed-form-author-content-panel-pane-1 ctools-auto-submit-processed" action="/" method="get" id="views-exposed-form-author-content-panel-pane-1" accept-charset="UTF-8">

  Sort by

Date

Popular

<input type="hidden" name="sort_bef_combine" value="created DESC">

      <button class="ctools-use-ajax ctools-auto-submit-click js-hide btn form-submit" id="edit-submit-author-content" name="" value="Apply">Apply</button>

</form>

The template responsible is views-exposed-form.tpl.php. Within the template the code below prints the form:

      <?php print $widget->widget; ?>

I've done a dsm on the $widget but the array just contains the full HTML.

Ive looked at hook_form_alter and done a dsm on this but in the full form array I still cant see a way to change the form label to a different element.


texts: How to output a large amount of html markup

texts:
I need to output an entire region of a page from within my custom module.

I know I can output markup to be rendered with this code:

$page['region'] = array(
    '#type' => 'markup',
    '#markup' => t('markup here'),
);

This is good for small amount of markup but is there a better way to output a large amount of html from within my module?


texts: I would like to be able to remove the option to show the "Edit Summary" option. All I need is that users fill up the field and save. I believe this is called "Teaser" but I might be wrong.


texts: How can I upload multiple images all at once?

texts: Is there a way to upload multiple images all at the same time in Drupal 7?


texts:
I've done a drupal migration from drupal 6 to drupal 8.
While all files are migrated well, image styles are not applying on migrated images.

Image styles are applied to the newly added images.

I think I should have force drupal to generate image styles for migrated images, but I don't know how.

any help one that is appreciated.

PS. I read some information about Flushing image styles in drupal 7 but I couldn't find a proper way to use it in drupal 8 as a custom module.


texts: Default to 'this display' when editing views

texts:
I am working on a display of a view I have. I want to make changes that apply only to the display that I'm working on; however the various editing widgets (relationships, filters, fields, etc) keep defaulting to apply to all displays. For the most part I remember to change it to "this display", but sometimes I don't, and I end up changing all displays.

Is there a way to change the default application to "this display"? Or have views remember which I chose?


texts: Youtube video does not play after clearing the cache

texts:
I have added a Youtube video inside the CKEditor to load the video in Colorbox, in a content type from CKEditor plugin (plugin is extact data from view). It works fine after creating content.

After clearing cache the URL does not work. It show only http:// in Colorbox. Please give me some suggestions.

The sample URL is /?q=vef/load/fe380247ab1fef057fca83a1df37326c&width=640px&height=363, inside CKEditor.


texts:
I have a Drupal 7 with the IMCE module installed.
It works good but it shows me every files in my media directory.
I need to limit the listing to only image files, for example to only jpg, png and svg file.

Anybody know a way to do it?
Thanks a lot.


texts: performant way to load many complete node-objects

texts:
I need to load a bunch of node-objects and apply some algorithm to them.
Usually I'd use an iteration and node_load() within, but I was wondering if there's a better (speaking of performance) way to load node objects.

I think that being able to cache the algorithm's result on a per-page basis would be sufficient.


texts:
I am using views to get results which can be filtered (exposed) by the user. So far so good. Now I have to (heavily) modify the end result and while I have figured out which template I need to use, I can not find a way to fetch the actual (raw) data from the view in my template so to theme it as the client likes.

What do I have to do to get the raw data in my template? If I will have to create a module for it which steps do I have to follow to do so?

Side question, is there any other way to expose filters in a page?


texts: How do I get the file URI from an EntityMetadataWrapper object?

texts:
Getting hold of file objects related to nodes through a field is easy using an EntityMetadataWrapper:

$wrapper = entity_metadata_wrapper('node', $node);
$images = $wrapper->field_images;

So that's great. However, I want to use some of the properties of the standard file object, and they're not available. When I look at the properties available on $images[0]->file using the above code, I see these:

fid
name
mime
size
url
timestamp
owner

Most notably, uri is missing, and in its place there's a url property, which is the full external URL to the image file. I want to manipulate these images via their URI (create thumbs, etc), so I'm left doing this:

$fid = $images[0]->file->fid->value();
$uri = file_load($fid)->uri;

Which seems to negate the whole point of using an EntityMetadataWrapper in the first place.

What am I missing? Where is the URI on the wrapped file object? If it's not available, for the love of all things good and pure, why not?!

I'm aware I could deconstruct the URL back to a URI, but that also feels very unnecessary.


texts: Prevent anonymous to input a registered email during commerce checkout through Rules?

texts:
In Drupal Commerce, how to prompt a warning message and keep it in checkout process if an anonymous inputs a registered email? I know there is a Commerce Checkout Login, but it is just an AJAX addon.

I believe I can do it through Rules and that's what I did.

Event: Process checkout pane
Conditions:

Data comparison: [commerce-order:uid] == 0
NOT Data value is empty: [commerce-order:mail]
Entity exists by property: User/Email, [commerce-order:mail]

Actions:

Show a message on the site: Warning, ...
Update checkout status: checkout

In first trial, it seems work well. But the weird thing is, when I change the email field to an unregistered one, I can still spot the warning message generated by Show a message on the site. Is there something wrong in my rule setup?

Refer to this Anonymous can use registered email address: intended behavior?.


texts:
As the maintainers of panels are not really reacting, my questions here:

I am creating panel-nodes which should be filled with existing content.  I need to have a preview functionality, so the user can add the panel-node and the unpublished content, review it, and finally publish everything.

as admin (user/1) I can do so without any problems, but other authed user with the permission to add all content-types etc. cannot.
they can open the dialog add content to pane > exisiting node. they can choose the unpublished node in the autocomplete field.  but after submitting the form (Finish) they get the message "Invalid node". this happens only with the unpublished nodes.

Is that a bug or am I missing something?

update: http://drupal.org/node/1294792


texts: How can I make a fieldgroup visible only to admin users?

texts:
I'm using the Field Group module to group fields on my user profile page.  I have a number of fields that are only visible to admin users, so I would like to group them together to keep everything organized.  I use the Field Permissions module to limit access to the fields to admin users only; however, this module does not restrict permissions for the field groups.

As a result, authenticated non-admin users see an empty fieldgroup.  How I deny non-admin users access to a field group that should be shown only to admins?


texts: Change download directory when installing new modules using "Install from a URL"

texts: I like using the "Install from a URL" method of installing modules as it's really easy. The problem is that it, by default, downloads the module to "/sites/all/modules", but I like to have my directory structure like "/sites/all/modules/contrib" and "/sites/all/modules/custom", therefore I would like automatically downloaded contrib modules to be downloaded into the "/sites/all/modules/contrib" folder. Is there a way to tweak this setting somewhere or do I need to hack core?


texts: User 1 becomes anonymous on node/add, access denied messages

texts:
I had been developing a Drupal site locally and put it up online recently without much problems. Our server runs in PHP Safe Mode, but I've already got most of the website working nicely. The only weird thing that is happening now is that I, as the User 1/Admin with all permissions configured correctly and accordingly, have been unable to add any new nodes. I can manipulate views, add content types, change the appearance, use deltas and contexts, administer users, and do pretty much everything except add new content. I have been working around this by using Devel to generate some nodes, but this is clearly a flawed work flow. Oddly enough, I can view the list of current content and edit any node I please. I just get "Access Denied" when I got to http://www.example.com/node/add. For all content types. And they do show up in the administer menu, so I don't think it has anything to do with the content suddenly being unavailable.

Looking at the action/error log, I find that those "Access Denied" errors are happening to "Anonymous," even though I have clearly logged in. I have tried flushing all the caches, rebuilding permissions, and still no luck. I also tried making another admin account, and that user runs into the same problem. Does anyone know what this might be and how I can fix it? It's kind of important to be able to add content.

EDIT:  This is on Drupal 7.14


texts: A nice way to build a related content algorithm

texts:
I am making a custom D7 module which has a block that lists related nodes of the current node you're viewing. The relation is determined by Taxonomy terms (from 1 vocab). The complication is that the related nodes need to be ordered by how many tags are matched in descending order.
How can you order nodes by matching tags? I have an idea of how to select nodes with matching tags, but have no clue as to how to order these by the number of matching tags. Any suggestions? Do it in SQL or in PHP?
Are there any modules that implement such functionality?
Simple case study for clarity
I have 2 content types: basic_page, article
Both of these content types have a same term reference field: field_tags
When someone opens a basic_page node that has been tagged with Tag A, Tag B and Tag C, I want to show article nodes that have been tagged with Tag A, Tag B and Tag C. But these article nodes need to be ordered by 'relevancy'. For example: the article nodes with all 3 tags matched must be at the top, and article nodes with 2 matching tags comes next, then the ones with 1 matching tag.


texts: What's the proper way to refer to all the code in `core/lib/Drupal`, or the code in `core/lib/Drupal/Core' or `core/lib/Drupal/Core/Foo`?

texts:
When we say 'core' we mean the whole of Drupal core that you get from the Drupal project page.

On D7, core code that wasn't in modules tended to be called 'the includes' IIRC.

But on D8 they're not include files any more. They in core/lib/Drupal and we have:

core/lib/Drupal
core/lib/Drupal/Core
core/lib/Drupal/Components
core/lib/Drupal/Core/Foo
core/lib/Drupal/Components/Foo

What's the correct way to refer to these?


texts:
Hel', I don't understand how to use "access argument" with Services Module.

Drupal is used like a server. When I follow specific link some informations about client, user and projects are added. That's work, but everybody can do it. So I want "limit access" : if you are not admin, the access is denied. So I've activated the authentication "Session authentication" and add some code in my custom module :

'create' => [
    'help' => 'Add',
    'callback' => 'custom_api_create_user',
    'access arguments' => array('administer create'),
    'access arguments append' => FALSE,
    'args' => [
        [
            'name' => 'data',
            'type' => 'struct',
            'description' => 'Something',
            'optional' => FALSE,
            'source' => 'data'
        ]
    ],
]

And when I add hook_node_access I get this message : "Access denied for user Lambda", and only the first letter of "access argument" is added to the content.

Someone can explain to me how I can add content and limit access with Services module ?

Do you understand what I want to do ?

(Yes you can see the same post here)


texts: How do I use the database abstraction layer with multiple databases in 8.2.x if I am using only raw SQL?

texts:
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%21database.api.php/group/database/8.2.x

I'm not sure I'm understanding how to use Drupal with multiple database connections.  I know I can setup more than one connection.  It's not that.

I use SQL.  I do not want to not use SQL for this part of Drupal (it is not part of the core of Drupal).  It is a "report" almost, except it can link to other data in other databases.  I have to query three-plus databases and bring back the data and have it display in the CMS like any other set of data someone might want.

For example, I do not wish to do this or this (from Drupal's documentation):

$result = db_select('example', 'e')
  ->fields('e', array('id', 'title', 'created'))
  ->condition('e.uid', $uid)
  ->orderBy('e.created', 'DESC')
  ->range(0, 10)
  ->execute();

The queries are large and complicated.  Am I fighting against the CMS/Framework, if I use [db_query][3]() everywhere for these outside databases that are unrelated to Drupal's core?

I can't find examples of anyone doing this, but I am still searching.


texts: How to find machine module name for `drush dl`?

texts:
Long time Drupal front-end dev but doing more site building lately and have been using Drush much more. One of the biggest limitations I've found with downloading (dl) command is that you have to know the machine name of the module, which is not a big issue for say Views or Context. But who knows the machine name of stuff like node reference or simple google maps?

I guess and get it right sometimes, or I have to hit d.o to figure it out. Is there a list function I havent uncovered? The other answers to this on Stack Overflow and Drupal Answers are pretty bad.

drush dl module-name-here


texts:
The example given in Access checking on routes for using _custom_access is the following.

example.routing.yml

example:
  path: '/example'
  defaults:
    _controller: '\Drupal\example\Controller\ExampleController::content'
  requirements:
    _custom_access:  '\Drupal\example\Controller\ExampleController::access'

ExampleController.php

/**
 * @file
 * Contains \Drupal\example\Controller\ExamleController.
 */

namespace Drupal\example\Controller;

use Drupal\Core\Session\AccountInterface;
use Symfony\Component\HttpFoundation\Request;

    /**
     * Builds an example page.
     */
    class ExampleController {

      /**
       * Checks access for a specific request.
       *
       * @param \Drupal\Core\Session\AccountInterface $account
       *   Run access checks for this account.
       */
      public function access(AccountInterface $account) {
        // Check permissions and combine that with any custom access checking needed. Pass forward
        // parameters from the route and/or request as needed.
        return $account->hasPermission('do example things') && $this->someOtherCustomCondition();
      }
    }

From this example, I get the first parameter of such callbacks is $account as I would expect, since the access is normally checked against an account.

Looking at code used from Drupal core modules, I find the following.

toolbar.routing.yml

toolbar.subtrees:
  path: '/toolbar/subtrees/{hash}'
  defaults:
    _controller: '\Drupal\toolbar\Controller\ToolbarController::subtreesAjax'
  options:
    _theme: ajax_base_page
  requirements:
    _custom_access: '\Drupal\toolbar\Controller\ToolbarController::checkSubTreeAccess'

ToolbarController.php

public function checkSubTreeAccess($hash) {
  $expected_hash = _toolbar_get_subtrees_hash() [0];
  return AccessResult::allowedIf($this->currentUser()->hasPermission('access toolbar') && Crypt::hashEquals($expected_hash, $hash))->cachePerPermissions();
}

In this case, $account is not passed as parameter, but the controller gets it from the dependency injection container, which leaves me puzzled.

I also checked at the class implementing the access service used for _custom_access, but I just see the following code, which doesn't make things clearer.

public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account) {
  $callable = $this->controllerResolver->getControllerFromDefinition($route->getRequirement('_custom_access'));
  $arguments_resolver = $this->argumentsResolverFactory->getArgumentsResolver($route_match, $account);
  $arguments = $arguments_resolver->getArguments($callable);

  return call_user_func_array($callable, $arguments);
}

(See CustomAccessCheck::access().)

If then I watch at ArgumentsResolver::getArguments() (the method called with $arguments_resolver->getArguments($callable) in the previous method), I see the following code.

public function getArguments(callable $callable) {
  $arguments = array();
  foreach ($this->getReflector($callable)->getParameters() as $parameter) {
    $arguments[] = $this->getArgument($parameter);
  }
  return $arguments;
}

$account seems ignored.

What arguments does a _custom_access callback exactly receive?


texts:
I'm using below codes in Bartik theme.

I need to make: Value cannot be 4 in integer field_total

But dont know why not working.

function bartik_form_alter(&$form, &$form_state, $form_id) {
  $form['#validate'][] = 'bartik_form_validate';
}
function bartik_form_validate($form, &$form_state) {
  if ($form_state['values']['field_total'] == '4') {
    form_set_error('title', 'Total cannot be "4"');
  }
}

New added: clearing cache giving error:

Notice: Undefined index: field_total in bartik_form_validate() (line 161 of /var/www/dru7/themes/bartik/template.php).


texts:
In a profile2 profile, I want to change the maxDate of a date field depending on the selected value of gender field.

I am using a custom module implementing the hook_form_profile2_edit_PROFILE_TYPE_form_alter() and loading JavaScript. The date field uses the datepicker widget and the gender field is set as radios.

When the gender is selected as female, the maxDate should be set to "-18y". When selected as male, the maxDate should be set to "-21y".

Using the JavaScript, when a gender is selected the first time, the maxDate is set correctly. But, when the gender is changed, the maxDate does not change. It remains set at the first value. When the gender is changed, the maxDate should change too.

Here is my JavaScript:

(function($){
Drupal.behaviors.meh_profile = {
    attach: function (context, settings) {
        $('input:radio[name="profile_main[field_profile_gender][und]"]', context).change(function(){
            var genderVal = $('input:radio[name="profile_main[field_profile_gender][und]"]:checked').val();

            if (genderVal == Drupal.settings.gender_options.gender_female) {
                for (var id in Drupal.settings.datePopup) {
                    Drupal.settings.datePopup[id].settings.maxDate = '-18y';
                }
            } // if female

            if (genderVal == Drupal.settings.gender_options.gender_male) {
                for (var id in Drupal.settings.datePopup) {
                    Drupal.settings.datePopup[id].settings.maxDate = '-21y';
                }
            } // if male

        }); // gender change handler
    }
};
})(jQuery);

What am I missing?


texts: How do I download a dynamically-created file in a form submission?

texts:
I've got a form that builds an array of data. On submission, it updates a table displayed in the browser, using AJAX; that works fine.

I want a second submit button that downloads the same data as a CSV file. I've tried a number of variations, but I can't seem to both send the file response and satisfy the AJAX requirement for a returned array.

The button:

$form['download'] = [
  '#type' => 'submit',
  '#value' => $this->t('Download data'),
  '#weight' => '40',
  '#ajax' => [
    'callback' => '::downloadCallback',
    'event' => 'click',
  ],
];

...and the response section of the callback:

$file_content = $serializer->serialize($data, 'csv');
$response = new Response($file_content);
$disposition = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'data.csv');
$response->headers->set('Content-Disposition', $disposition);
$form_state->setResponse($response);

I've also tried using this instead of setResponse:

$response->send();

These all result in an error:

  TypeError: Argument 1 passed to Drupal\Core\Render\MainContent\AjaxRenderer::renderResponse() must be of the type array, null given, called in /mnt/www/html/mowebd8dev/docroot/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php on line 89 in /mnt/www/html/mowebd8dev/docroot/core/lib/Drupal/Core/Render/MainContent/AjaxRenderer.php on line 45 #0 /mnt/www/html/mowebd8dev/docroot/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(89): Drupal\Core\Render\MainContent\AjaxRenderer->renderResponse(NULL, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))

I've tried also returning a simple render array with some dummy markup, and that prevents the error, but still doesn't result in a file download. Is there a way to accomplish this? Or should I just not be using AJAX for this purpose?


texts: All links point to the old site after migration

texts:
I migrated a Drupal 7 site from 1 server to another. Let's call the old site URL http://oldsite.com and the new site url http://newsite.com. I have copied over the code base and the database. The site displays correctly on http://newsite.com, however all the links point to http://oldsite.com. The only way to access the links are to type the URL in the browser (e.g. http://newsite.com/admin).

I have read lot of forums and done the following:

Set the $base_url in settings.php
Cleared cache in Config > Development > Performance
Cleared the cache table in DB
Ran update.php
Disabled clean urls

Nothing has worked. Someone suggested changing an entry in system table. Don't know which entry they were talking about.

Can anyone suggest the correct steps and perhaps an explanation of why I keep getting the redirects?
I have also referred to Moving a site, links/admin do not work.


texts: Display number of nodes in taxonomy view filter

texts:
I have a view, with an exposed filter based on a taxonomy. It works like it should.

Now, i need to display the number of nodes who are under each terms of the taxonomy, like so :

Term Test (6)

Term OtherTest (5)

Term Test3 (7)

The number have to be displayed in the dropdown list.

Thank you


texts: Render alternative content if user is logged in instead of redirecting to user/uid

texts:
I have a menu router with type MENU_CALLBACK and it's 'page callback' property points to a function that implements render API, as follow:

 /** Implements hook_menu **/
function custom_render_menu() {
  $items['register-profile'] = array(
    'page callback' => 'custom_render_register_profile',
    'type' => MENU_CALLBACK,
  );
  return $items;
}

/** Implements callback page for register-profile **/
function custom_render_register_profile() {
  $user_register_form = drupal_get_form('user_registration_form');
  $markup = user_is_logged_in() ? t("Alternative Content") : drupal_render($user_register_form);
  $output = array( '#markup' => $markup);
  return $output;
}

If the user is not logged in, the registration form displays correctly, but if the user is logged in, the page was redirected to user/uid router, showing user's profile. How can I display an alternative content instead of redirecting the user to their user page?


texts: In my Drupal 7 site, when a user registers they are emailed a one time login link that they can use to set their password using this token: [user:one-time-login-url]. Is there any hook that I can use to update a field in my database so that I can differentiate users who have activated their accounts, versus those who have not clicked on the link?


texts: Display taxonomy field in view on content page

texts:
Using Drupal 8.8.1, I am trying to display taxonomy fields in views on content pages tagged with that taxonomy. Essentially the content page would have an image header from the taxonomy image field, as well text in the sidebar from the description and contact info fields. I have tried several different iterations of view configuration but still can't get it to work.

I have a taxonomy vocabulary called Tags that looks like:

Tags
- Programs
- - Medicaid (51)
- - Medicare (56)
- - Community Living (61)
- Topics
- - COVID19 (91)
- - Enrollment (121)
- - Eligibility (116)

On my Basic page content type, I have added a reference to the Tags taxonomy as follows. Each node that is created will have a taxonomy tag assigned to it to classify the content.

Machine name: field_tag
Field type: Entity reference
Reference method: Default
Vocabulary: Tags

So then I have a Basic page called Medicaid Overview (node/31) which has a reference to Medicaid taxonomy tag (51). There will then be multiple Medicaid related basic pages that will be flagged with the Medicaid taxonomy term.

I have tried creating several different Views to access the fields on the taxonomy term assigned to the content node that is being displayed. I have tried several different combinations on Contextual Filters and Relationships to no avail. And I have tried several different combinations of creating the view for Basic page and for Taxonomy.

I referenced the following articles (and many others) to try to get it sorted out:

How to print a taxonomy term's field value alongside a Views grouping header?
On a content page that references a taxonomy term, how can I display only content that references that taxonomy term's immediate children?
Display taxonomy field in node display
Views Contextual Filters + Taxonomy
How to display taxonomy term fields in Views?

At this point I'm a little confused and need to get reset.

When I create the view, do I set View Settings to Content or Taxonomy Terms? I have tried both and got closest with Taxonomy Terms. In addition, since I want to display fields from Taxonomy, it feels like I should be using Taxonomy Terms.
When I use Taxonomy Term as my View Setting and use Taxonomy term: Term ID as my Contextual Filter, I can get the preview to display only the taxonomy term and field that I want. But when I go to the Medicaid Overview page, it has multiple taxonomy terms displayed. Why won't it filter to just the page (and taxonomy term) that I am viewing?

Any help is appreciated. I have three views that are dependent on getting to the taxonomy ID that is assigned to the content node that is being displayed. Happy to provide more detail or screenshots.


texts: Complicated content/node access scenario, input wanted

texts:
the requirements are the following:

In the site we'll have groups of users, that can access content posted in their group, much like Organic Groups does.

Apart from that though, the author of each node, must have the ability to override that functionality and "invite" specific users to view the node, even if it's in a group bypassing the group's settings. So if the group contained the users U1, U2, and U2, but the author invited U2,U4 and U5, U1 and U3 wouldn't be able to access the node.

On top of that, the author must have the ability to add specific users as "facilitators" to that node which grants them "Edit" rights on the node and the ability to invite more people to view the node as described above.

By using organic groups AND node access user reference, I've been able to accomplish the grouping and either the "participants" feature OR the "facilitators" feature, since as it seems, node access user reference cannot support 2 grant types on the same node.

Now, the general advice is "you don't want to use more than one node access module on your site." (http://drupal.org/node/270000). So the idea of adding yet another one, to accomplish the missing feature sounds wrong. Also creating a custom module to encapsulate all of this functionality seems like a lot of work.

So, since I am facing a sort of a blocker in my project analysis I'd like some input on how you guys would go on about tackling such an issue. Thanks in advance.

EDIT: Seems that even the synergy of Organic Groups and node access user reference is not working as intended. Just works in public groups' content since there is no 'group_access_authenticated' record in the 'node_access' table and node access user reference handles all the grants. In private groups where for example one user (U10) can be a member of the group but NOT in the list of the node's "participants", since he has the 'group_access_authenticated' grant, he is able to view the node in question thus breaking the functionality.


texts: Display content in arguments array order

texts:
I render a view with contextual filters and pass an array of nids to it, which works great.
drupal_view ('some_articles', 'block_1', nidArguments )

My view doesn't render these nodes in the same order the node ID arguments have.
I can't sort via the sort criteria, since I get these node IDs from different sources: some come from the node's field, and I don't want any sorting whatsoever, while the rest come from the database and I already sort some of them with a query.
Even if I remove all sort criteria, the view still sorts them by "authored on (asc)" and doesn't display the nodes in the order of the arguments array.
Do you have any ideas? (I would prefer not to use extra modules.)


texts: Where can I save a CSV file that I construct dynamically to make it available for download?

texts:
I dynamically construct a CSV file following that method:

$fp = fopen('export.csv', 'w');
foreach ($export as $fields) {
  fputcsv($fp, $fields);
}
fclose($fp);

A file 'export.csv' appears in the very root of my Drupal directory.

I display a link to a page, allowing user to download that CSV file:

drupal_set_message(l('Export to CSV', 'export-csv'));

In the page callback function, I make the file downloadable like this:

function grap_contact_export_csv_page() {
  header("Cache-Control: public");
  header("Content-Type: application/octet-stream");
  header("Cache-Control: no-store, no-cache, must-revalidate");
  header("Cache-Control: post-check=0, pre-check=0");
  header("Content-Disposition: attachment; filename=\"grape-export.csv\";" );
  header("Content-Transfer-Encoding: binary");
  $fp = fopen('export.csv', 'r') or die('Cannot access the file');
  echo fread($fp, filesize('export.csv'));
  fclose($fp);
  drupal_exit();
}

That works well.

What disturbs me is the location of the file. Of course, I know that I should not save it there. My question is: Where is the optimal location to save that kind of files? In the custom module's directory? In sites/default/files? What is the best practice?


texts: Best method of changing content of one field based on whether another exists

texts:
I have one field, field_foo, that I want to be rendered one way if field_bar does not have a value. Should field_bar exist, I would like to render the values of both field_foo and field_bar together inside the same markup that all my other fields have.

I could do this in the template file for the content type, but that does not seem like the Drupal way (logic in the tpl file).

I am already using theme_field to adjust the way some of my fields are being rendered, and I have tried to put the logic in there, but I am not sure how to access other fields from within a field-specific theme_field function. Moreover, this does not really strike me as the proper place for this logic either.

What would be the best way of implementing the different rendering of one field based on whether or not another field has content?


texts: Multiple upload image using managed_file

texts:
I'm trying to do a very simple thing (seems not that simple at all) in my custom form, to add multiple files using the managed_file form api. Like in the admin, select a file, upload, then a new input file appears.

But I can't achieve that... do I need a callback ???

    'gallery' => array(
        '#type' => 'managed_file',
        '#name' => 'gallery[]',
        '#title' => t('Gallery'),
        '#upload_location' => 'public://',
        '#attributes' => array(
            'multiple' => 'multiple',
        ),
    ),

Thanks


texts: Address field module autofill city and state when zip code is entered

texts:
In the United States, cities are split up by a unique 5 digit zip codes (postal code). This postal code in turn tells what city and state it is from. Therefore it is redundant to type the city and state.

Is there a way, with the Address Field module, to autofill the city and state if a postal code is submited?

This then leads to the second question, how to force a correct postal code entry. By default a user can type any text and it will be accepted.


texts: How can I change a menu link dynamically? (D7)

texts:
I'm trying to change the link of a menu item dynamically based on the language that is selected in the language switcher.

Let's say I have the following links in my main-menu:
-Home
-About
-Products

If the language selected is English, I want the About item to link to node/73. If the language selected is Dutch, I want the About item to link to node/74.

Is this possible and how would I best go about this?

Any help is very much appreciated.

EDIT: Some extra information. I have the Internationalization, Content Translation and Entity Translation modules installed. Because of the hierarchy of the menu and a mix between content translated nodes and entity translated nodes, I don't want to add two seperate links to the menu but have one link and change the path dynamically in code.


texts: How to store all saved values of a field on User entity?

texts:
We plan to store a string as a field on a user account page. This is easy to do, but requirement is also to be able to track value changes of the field.

Based on my restricted knowledge in Drupal, this sounds like having revisions for a User entity, which is not supported in Drupal 8, is it?

How can I achieve my goal? Is it possible to create some kind of field that could show all the saved values on the user page (doesn't matter that much), but won't allow users to change them after saving, like a multi-value field that allows only to add new values, but not change or remove values.


texts: How to remove author name and date created from Simplenews emails?

texts:
When I create a newsletter using the Simplenews module and save it, I don't see the author name and date created in the node. However, when I send email, it contains author name as a link and date and time of creation + 'html' as shown.

rktaxali Thu, 05/19/2016 - 11:42 html

Unsubscribe from this newsletter

Any suggestion, how to remove the author name and date row from email?

On a similar note, the email also includes the node title twice in the body of the email, e.g.

Quarterly News Letter

Quarterly News Letter

This is sample newsletter sent by the simplenews module ...

Any suggestion, how to remove the two repeating lines at the top of the email?


texts: How to instantiate a service inside ServiceProvider?

texts:
I need to instantiate a service inside ServiceProvider.
At that point the container is not built.

Any ideas or useful links?

<?php

namespace Drupal\my_module;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;

class MyModuleServiceProvider extends ServiceProviderBase {

  public function register(ContainerBuilder $container) {
    parent::register($container);

    // How to get a service here?
    // Currently container is not built :)

  }

}


texts:
I have a content type named Account, and it has a field named account_number. Since I import the data from a csv file using feeds. The Node title for each account is always empty.

Is there a way to set the node title default to its account_number?

Thanks


texts: How do I insert site information data into another table?

texts:
I have developed website using Drupal. I have created an application without using Drupal, using another framework. In my application I also stored site logo,site name etc. I want to update  my site information table when updating
Drupal site information from admin/settings/site-information.

The fields are the following ones:

id: int(12), primary key
site_title: varchar(60)
site_logo: varchar(200)


texts:
I am looking for a way to use an authenticated user session to remotely create content on my Drupal site.

My challenge is a somewhat complex one so please bear with me.

Using the Poster Firefox addon I am able to simulate creating and logging a user onto a Drupal website. The issue now is how to enable a persistent connection. So, using Chrome I login and I detect the session cookie details. I then try to use those cookie details in the Firefox Poster addon interface to remotely create a new node(page) on my drupal site.
The objective is for Drupal to report the new remotely created node(page) as authored by my logged-in user on the Chrome browser.

Ultimately, I am trying to figure out the recipe to translate to a program that will serve as the remote client while Drupal is used as a server.

I hope someone can shed some light on this issue for me.
Thanks for your time.

PS: The following images show how I am setting the http post header containing the cookie information and the variables Drupal uses to create my remotely created node.


texts: PluginNotFoundException: "The "iframe" plugin does not exist." at core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php line 52"

texts:
how to solve such error:

Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "iframe" plugin does not exist." at /var/aegir/platforms/drupal8-dev/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php line 52" while reading response header from upstream, request: "GET /admin/config/content/formats/manage/basic_html HTTP/1.1"

The plugin 'iframe' have been existing since i found it in the enabled filter list

  http://drupal.stackexchange.com/questions/218781/create-a-new-text-format-filter

then i believe when i have clear the cache at some stage it came up with this exception  when trying to acces again to

        admin/config/content/formats/manage/basic_html

where i have initially add this plugin filter

The exception come up when i am trying to uninstall the module so it is problematic

it seems that this error is reccurent when i googleized it but i did not found where the problem lies


texts: Easiest & most efficient way to embed vimeo code into blog post

texts:
All of my videos are hosted on Vimeo and I would like to create a way to embed videos into my blog posts.

Ideally I'd like to create a field in my content type where all I have to do is input the Vimeo video ID and then the embed code is wrapped around it. This way I don't have to always paste the entire iframe. Or is there a better way?

For example if my Vimeo embed URL is the following, I'd like to only have to input the ID of "60771416"

<iframe src="http://player.vimeo.com/video/60771416?title=0&amp;byline=0&amp;portrait=0&amp;color=ff9933" width="896" height="504" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

I guess I could have a field and have the embed code be in there by default, but I'd like to have it be cleaner then that.

I'm using Drupal 7 and Panels.


texts: How to prevent data loss from custom field when using Views Bulk Operations?

texts:
I have developed a custom field type, widget etc all in its own module.

We also use Administration Views module with Views Bulk Operations.

Our content guys used the VBO action Publish from the Content Overview (Views) screen to mass publish few nodes which have this custom field. This caused data loss from all the nodes, but only the data from my custom field.

What causes this and how to prevent it?


texts:
When fields are rendered they have classes. For example here is the template for a taxonomy term reference field:

<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  <?php if (!$label_hidden) : ?>
    <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;

  <?php endif; ?>
  <div class="field-items"<?php print $content_attributes; ?>>
    <?php foreach ($items as $delta => $item) : ?>
      <div style="display:inline;" class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>>
        <?php
          print render($item);
          // Add comma if not last item
          if ($delta < (count($items) - 1)) {
            print ',';
          }
        ?>

    <?php endforeach; ?>

In the first line you'l see <?php print $classes ?>, in that $classes string there are some classes and I don't want. Obviously I can use php to str_replace in the tpl file to remove the classes I want, but that seems like a very wrong solution. What's the correct way to modify $classes?


texts:
I created a view with Search API.Could you please help how to validate exposed filter(Textbox)
with in a view.

I tried using contextual filter it never worked.


texts: Why is step 2 of file to media migrate giving me missing bundle error?

texts:
I am following the instruction on this page : https://www.drupal.org/project/migrate_file_to_media/issues/3118471 , but with media of bundle document, not image.  I have my step 1 yml on this issue How can i debug why files are not being created when using migrate files to media module?
My nodes of type grants and step 1 files are being created as media correctly, however when i do step 2, using the yml below, I get this error :
Missing bundle for entity type node (/var/www/html/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:108)
id: migd8_grants_media_step2
label: grants Media Mapping
migration_group: cncs
source:
  key: migrate
  plugin: d7_node
  node_type: grants

destination:
  plugin: entity:node

process:
  nid: nid
  changed: changed

  field_files:
    plugin: file_id_lookup
    source: field_files
    migration: migd8_grants_media_step1
    no_stub: true

migration_dependencies:
  optional:
  - migd8_node_grants
  - migd8_grants_media_step1

I made some changes as an experiment and started getting duplicate grants being created, one with the correct media files attached, and one without , these are the changes i made which caused the duplicates with one having the correct file attached:
id: migd8_grants_media_step2
label: grants Media Mapping
migration_group: cncs
source:
  key: migrate
  plugin: d7_node
  node_type: grants

destination:
  plugin: entity:node

process:
  nid: nid
  changed: changed
  title: title
  type:
    plugin: default_value
    default_value: grants
  field_files:
    plugin: file_id_lookup
    source: field_files
    migration: migd8_grants_media_step1
    no_stub: true

migration_dependencies:
  optional:
  - migd8_node_grants
  - migd8_grants_media_step1


texts: How to hide Regions and Themes in the block setting admin page?

texts:
When editing the setting of a block you can specify Themes and Regions where the block is going to be shown.

I need to hide some Region and a Theme for a given role?
Can I do this?

I tried with http://drupal.org/project/block_access but is not useful for this.


texts:
Possible Duplicate:
  Limit account applicants with certain email addresses

I'm looking for a way to restrict registering to a D7 site to a particular domain. This was handled with Access Control in D6 but that feature has been removed.

Modules that are currently available (User Restrictions, User Domain Email) are not working.  I've tried setting up the Rules module to manage this but can't get it to work (with and without trying to use in conjunction with Login Toboggan.)

Thanks for any advice!


texts: Would like to remove welcome message from frontpage

texts:
Possible Duplicate:
  Removing the “No front page content has been created yet.” message from the front page

I am using the Zen theme and don't wan't any "nodes" on my homepage. I've got menus and blocks, but not nodes as such. I don't want the "No front page content has been created yet" text to appear. What is the best way to get rid of it?

I've currently only got one template that I'm using. page.tpl.php

drupal_set_title(t('Welcome to @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), PASS_THROUGH);

$default_message = '<p>' . t('No front page content has been created yet.') . '</p>';


texts: How to use a token in "Behavior without results" of a view?

texts:
I want to retrieve the ID token of the group in "Behavior without result" of a view. How to do ?

It only offers me (site and view).

The token does not work.

The url does not take ID into account:

/group//join


texts: Remove link from title of custom content type in Drupal 7

texts:
I have created a custom content type that includes a title, body and an image. I am displaying this content type in a views slideshow which is working fine.

The problem is that the 'Title' on each slide is linked to a stand-alone page for that individual node. This is undesirable. Is it possible to remove this link, or at least change where it goes?

When viewing the content type, there is no 'edit' (or delete) link for the Title field on the 'manage fields' tab, and on the 'manage displays' tab, the title field does not appear at all, though it claims no fields are hidden. Why are we prevented from controlling the behavior of this field?


texts:
I'm working locally on my OSX and I have my drush alias files at ~/.drush/[hostname].aliases.drushrpc.php but no matter what project I'm in, only one of the alias files are being read, as confirmed through drush status. Also of note is that my main drushrpc.php file was never in that directory and I don't think it is anywhere.

I've tried clearing drush cache, and also adding a drushrpc.php and adding this php which I'm not entirely sure what it means:

<?php
// ~/.drush/drushrc.php
exec('git rev-parse --show-toplevel 2> /dev/null', $repo);
if (!empty($repo)) {
  $repo = array_shift($repo);
  $options['config'] = $repo . '/.drush/drushrc.php';
  $options['include'] = $repo . '/.drush/commands';
  $options['alias-path'] = $repo . '/.drush';
}

I found that configuration here: http://www.astonishdesign.com/blog/drush-aliases-what-why-and-how

Anyone know how I should proceed?


texts:
I'm using DrupalChat module.

I've set AJAX polling, but I can't delete any messages as moderator. Is there any solution to enable chat moderation?