texts: How to pipe output of "drush sql-dump" without warnings

texts:
When I do: drush sql-dump > somewhere/database.sql if there will be any warnings printed by Drush, they will be included at the beginning of the created database.sql file. Can we avoid it somehow?

I know there is the --result-file= option that ignores all warnings when creating the file, but is there any way to ignore warnings when piping the output? I would like to parse the output before actually saving it into a file if its possible.

drush 8


texts: how to correctly use curl command line with Services module?

texts:
I try to use following command to create an user:

$ curl -H 'Content-type: application/json'  -d '{"name":"u10", "pass": "123","mail": "user@a.om"}' http://localhost/test/api/user/register

return success:

{"uid":"11","uri":"http://drupal/daxuebao/api/user/11"}

But I try to login:

$ curl -H 'Content-type: application/json'  -d '{"username":"u10", "password": "123","mail": "user@a.om"}' http://localhost/test/api/user/login

It alert me :

["Wrong username or password."]

So, How to correctly use curl command line?


texts:
Hello i am working on theming for Drupal 8 using twig
My question is :
I want to assign css class to each input swicth the type of the input
exemple <input type='email' class='email_cls'>

<input type='submit' class='submit_cls'>

what code should i use ,knowing that i use the default template twig file input.html.twig  I did this

<input{{ attributes.addClass('submit_cls email_cls') }} />{{ children }}

The problem is on my form both of the inputs email & submit have the same display


texts:
I have two content types, the first is Homepage and the second is SLider.
The Slider content type has multiple fields like title, ink, and image.
In the homepage content type, I have an entity reference field referring to the slider content type with multiple selections. I've created a template in my custom theme as node--home-page.html and want to get the sliders fields values, All is okay with me except the image. I cannot get the image URL.
My code:-

{% for slide in node.field_hoeme_slideshows %}
        {{ kint(slide.entity.field_home_slide_cta.uri) }} {# This is working #}
        {{ kint(slide.entity.title.value) }} {# This is working #}
        {{ kint(slide.entity.field_home_slide_snippet.value) }} {# This is working #}
        {{ kint(slide.entity.field_home_slide_image) }} {# ****** This is not working *****#}
{% endfor %}


texts: How can I embed a view in an email sent by Rules without resorting to the PHP filter?

texts:
I want to embed a view in an email sent by the Rules module using the standard "Send mail" action.  I have the Mime Mail and Mail System modules installed, and I can send HTML email when it is included in the body of a rule.

Based on this question, I tried the Insert View module, but that only allows views to be inserted into node content, not rules (which are entities, but Insert View does not support generic entities).  I tried adding [view:view_name=display_name] to the message body of my rule, but the view did not appear.  To make sure it wasn't working, I added another rule with the "show a message" action and tried to embed the view there, which also didn't work.  However, I can place the exact same code inside a node body and the view DOES appear, so it appears that Insert View does not work with Rules.

Entity Views Attachment does support generic entities, but this "attaches" the view, whereas what I am trying to do is embed the view in a rule's email message body like this:

  MY TEXT - HEADER

  EMBEDDED VIEW

  MY TEXT - FOOTER

I also only need to do this for one email, so if possible, I would like to add something like a custom token for Rules to embed the view, but I'm not sure how to go about that.


texts: I want to make a text fields that will make user able to search all the fields. I have tried few modules but nothing is working for me the way i want.


texts:
I have been a Drupal site builder for some time, but I kind of got started with it backwards. Recently, I have begun learning more server-end things like Drush, Git, etc. I'm playing around with a Digital Cloud virtual server, and I'm not having a problem per se, but I have found at least 4 ways to install Drush:

Through Pear
Through apt-get
Through Composer
By downloading the files straight from Github

(If it matters, I am on a Debian environment.)

It seems that Pear may be the preferred way from what I can tell, but that's just based on the fact that I found that to be recommended slightly more frequently than the other methods.

Is this just a matter of preference? I admit I am not very familiar with Pear and Composer. Or is there a method that most devs consider to be a best practice?

Thank you.


texts: How to make a style plugin available only for certain types of panes?

texts:
I'm trying to simplify the admin UX on a site with a few different custom style plugins. I have plugins A, B, C, and D.

I want plugins A and B only to be able to be applied to menu block panes.

I want plugin C only to be able to be applied to a minipanel when the minipanel is placed via something like Panelizer.

I see that I can easily hook_form_alter() the #options in the form but I don't seem to be able to find the kind of context information that I need to know which ones to hide.

How can I selectively hide style plugin options for irrelevant elements?


texts:
I am trying to submit my form. But then the form's required error validation is not adding the class <div class="messages error">. Because of that, my error message is not showing in red text formats.

Here is a screenprint of how it looks like (and in which no red text is shown):

Any suggestions about what could be causing this problem?


texts: Drupal 7.53 pathauto pattern field do not transliterate

texts:
I created a new field in on a content type I have on my application (Drupal 7.53), then in /admin/config/search/path/patterns I have set a pattern to this type of content as the following:

[node:field-nw-sitemap:0:url:path]/[node:field_titulo_url].

I expected to have a result like:

mysite/subpath/new-content
it works fine on development environment, but in homolog, witch is online, the return to the url is
mysite/subpath/New%20Content.
Has anyone been here before? Help please. Thanks.


texts:
I have a Drupal 6 installation, and wanted to make some changes for the client. However, this fails, because as soon as I log in with the super user account it says:

  Access Denied: You don't have sufficient permissions to access this page

So I can't even log in using the super user account (uid 1). The password is already reset several times. The cache tables and session tables are emptied. What can I do?


texts: Behavior of taxonomy-term classified paths

texts:
We have customer who insists that there is a setting/method that will order the listing-page for taxonomy attributed event-type by date ascending. My exploration has lead me to the .../admin/config/search/path/patterns settings in Taxonomy term paths. We are using the default: [term:vocabulary]/[term:name].

However I can not find a setting that will allow for date-ordering. Is there such a setting? The behavior of the site is that the ordering is done by the initial-post date.

I've advised that this can be done w/ View.


texts: Views exposed filters without "Apply" button

texts: I have created a view with exposed filters of term select list. How can I make the select list to work directly on selecting an item, instead of clicking on the "Apply" button?


texts: How to fix floated elements extending height of non-floated elements within a single zen theme region?

texts:
I'm updating a site built on D7 with a 7.x-56 zen sub theme. The theme is laid out with responsive horizontally stacked content regions. I've created a custom blog content type, and three views blocks based on taxonomy, archive, and recent posts, but I'm having trouble with the layout of the individual blocks within the content region.

What I want is the three blog content filter blocks stacked and floating to the right, while the blog itself is floated left. I've more or less pull this off, but floating and clearing the blocks to stack on top of each other, but the issue I'm having is that they are somehow influencing the height of the first blog post. .

So, why are the floated elements influencing the views row's height and how can I fix this? You can see a live version of the site here live site. Should I add a sidebar region here? or is there a css fix for this? For context, page is a view constructed from a custom content type, and the filter views are placed using the context module with equal row height of -9.


texts:
I have installed Drush 8.2.3 globally on a Lubuntu 18.04 image. This was done without Composer (I used the default install instructions here)

However, if I run drush topic and select any topic number from the list I get

phar:///usr/local/bin/drush/examples/sync_via_http.drush.inc: No such file or directory
more: stat of phar:///usr/local/bin/drush/examples/sync_via_http.drush.inc failed: No such file or directory

What gives?


texts: How to create notifications like Facebook about pending workflow approvals?

texts:
Is it possible in Drupal 8 to setup notification bar as in Facebook?

Update:

I have different roles and I am using workbench for applying workflow. I have three transition attached with role like draft, approved, published. When user like reporter who have only draft transition going to save content at that time a user like editor who have right for transition like approve will get notify on screen when login.


texts: Grouping content by Years (For eg Archive 2014-2015 or Archive 2014-16)

texts:
I want to group my content type to group by years in views, for example Archive 2014-2015 or Archive 2014-16. How can I get this groupings?

Archive 2013-2014
-COntent 1
-Content 2
-Content 3

Archive 2015-2016
-COntent 1
-Content 2
-Content 3


texts: One submit button posting to multiple functions

texts:
I am displaying a form inside a block and I want it to submit to multiple functions, namely the original submit functions and in addition my own pm_form_submit. Yet I can't get it to work... you can submit to multiple functions right?

In the case bellow only "Test Form Submit" (the original submit function) is displayed.

Submit button of my test form:

function test_form_form ($form,&$form_state){
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Submit',
  );

  return $form;
}

My code for displaying the form in a block:

$form = drupal_get_form ('test_form_form');

//add our submit function (both are here just to test)
$form ['#submit'][] = 'pm_form_submit';
$form ['submit']['#submit'][] = 'pm_form_submit';

$output .= drupal_render ($form);
return $output;

My submit functions: (the pm_form submit is in the same file where I alter the form and the test_form_form_submit is in the file where the form is generated)

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

function test_form_form_submit(&$form, &$form_state) {
  drupal_set_message('Test Form Submit');
}

when I print_r the $form array I can see the following:

[submit] => Array
    (
        [#type] => submit
        [#value] => Submit
        [#input] => 1
        [#name] => op
        [#button_type] => submit
        [#executes_submit_callback] => 1
        [#limit_validation_errors] =>
        [#process] => Array
            (
                [0] => ajax_process_form
            )

        [#theme_wrappers] => Array
            (
                [0] => button
            )

        [#defaults_loaded] => 1
        [#tree] =>
        [#parents] => Array
            (
                [0] => submit
            )

        [#weight] => 0.001
        [#processed] => 1
        [#required] =>
        [#attributes] => Array
            (
            )

        [#title_display] => before
        [#id] => edit-submit
        [#ajax_processed] =>
        [#sorted] => 1
        [#submit] => Array
            (
                [0] => pm_form_submit
            )

    )

...
[#submit] => Array
    (
        [0] => test_form_form_submit
        [1] => pm_form_submit
    )


texts: Cannot apply custom CSS via theme settings

texts:
With Drupal 7.x and the Whitejazz theme, I want to apply custom CSS styles to some elements. This theme has the option to include custom CSS styles by specifying the path to the CSS file (in Appearance > Settings).

I created the folder and uploaded my file, specified path, but this doesn't work for me, even after clearing the cache. I can apply my styles using the CSS injector module without a problem, but I want to find out why I can not set this using the theme settings.


texts:
I need to set watchdog log entries to unlimitted. Now it clears every time when cron is called.

admin/settings/logging/dblog

now maximum is 100000, is there any better way to do this.


texts: How to create Stacked area charts instead of Basic area charts using the Charts module?

texts:
Anyone know how to create multiple stacked area charts vs multiple basic area charts in Drupal using the Views integration of the Charts module (and using Highcharts as the charting engine)?

I would like to create a (stacked area) chart as shown at http://www.highcharts.com/demo/area-stacked, as opposed to the (basic area) chart as shown at http://www.highcharts.com/demo/area-basic.

Also, I would like pop up information to work with multiple stacked charts as it does with single area charts.  It works on the sites included above but does not work with charts created with Drupal Views.


texts: how to show date filter by next 5 months via expose filter in drupal?

texts: I have a content type with date fields . For date I am using date module. I have created a views in drupal 7 and using exposed filter. I need to show filter my data via month , Means I need to show months(next 5 months including current) in dropdown.


texts: Title tag not overriding after using meta tag module

texts: I have created a content type for uploading user details. I have changed the title as UPLOAD PAGE using drupal_set_title. I have installed Meta Tag module, now page title remains same but title tag i.e. (title displayed in browser tab) are different. Please guide me. Thanks


texts:
I'm using Drupal 8 like an API, headless Drupal, and when creating a content type that has a reference to another "Content type", the resulting JSON has a "target_id" filed but with no data populated of the content that is referenced.
Is there a way to do that that you can point that?
Thanks!


texts:
Suppose that I have a view that outputs a list of some content. Now I'd like to add some action buttons next to each content item, so that clicking these buttons triggers some custom action or redirect the user to another path (specific for that item).

I found a solution here that comes close to what I'd like to do, but that solution is based on D7 Add custom action buttons to view.
Without repeating the content of this link, could someone let me know whether that approach is still valid/good practice for Drupal 8?

In case it is the solution, how would you implement the functionality of passing the $nid of a list item to a different form via POST when clicking one of the action buttons ? Would this be part of the function function query() {...} in step 5 of the link ? If so, how would you approach this ?

Are there solutions that might be better suited to D8?


texts: commerce product display showing only one product when multiples selected

texts:
I'm working on a Drupal 7 site using Commerce module.

When adding multiple products to a product display, I'm only seeing a single "Add to cart" button for the first product in the reference field, with no select menu for the additional products.

What's strange is that I did have that showing on the node, but not now - although I've only been changing view templates. Is there some config I should check to make sure this functionality is enabled that I may have inadvertently changed?

How would I ensure that a product display shows multiple products properly?


texts:
I create a custom entity (pool) with a custom form.

In my custom form, i have a field (start_date)

$form['start_date'] = [
  '#type' => 'datetime',
  '#title' => t('Start Date'),
  '#default_value' => new DrupalDateTime()
];

When i want to save, i have the follow error :

"Data too long for column"

In the log, the value is : 2017-12-21 18:06:29 Europe/Paris
Instead of 2017-12-21T17:06:29

What i'm doing wrong ?


texts: Can I set "$conf["image_allow_insecure_derivatives"] = TRUE" in settings.php file?

texts:
Hi my multisite site structure is, I have followed sub directory multisite mechanism

So in hosting server the url will be

http://123abc.hostring.com/mysitename1
http://123abc.hostring.com/mysitename2

I have pointed and configured with production url as,

www.mysitename1.com (http://123abc.hostring.com/mysitename1)
www.mysitename2.com (http://123abc.hostring.com/mysitename2)

Everything working fine. But the private (Amazon S3) image styles cannot be created.

private file link
http://www.mysitename1.com/system/files/styles/stylename/s3/myimage.jpg

It shows "Access Denied" error.

When I added below line in settings.php file the images styles has been created perfectly.

$conf["image_allow_insecure_derivatives"] = TRUE;

But I believe there are some security issues in that. Do I need to follow any other configuration instead of this?

Please advice.


texts: How can I control class="active" in a submenu

texts:
I have a view with several exposed filters, they work fine. I added the unfiltered view in the main menu. Then I copied the urls of the filtered results to add them as submenu.

The "active" class is attibuted to the ‘better exposed filter’ links in the form I show to my visitors, ahead of the view.
But only one of the submenu links is attributed that "active" class, even though it doesn't fit the displayed result. Does anyone see where the problem can come from?

See for yourself: https://nature-et-sens.eu/boutique.

Edit ----
I figured that the problem is slightly different. Here is what the  submenu looks like (roughly):

…

…

    …

…

The only  item which is properly styled is the one contained within the
. I have no problem with that, my stylsheet complies accoardingly.

I would like to understand why this 'active-trail' class is always  attributed to the very same item, even though it is not the one I clicked.


texts: How does Drupal 7 determine the output of user menu?

texts:
I have the built in User Menu being displayed in a region of my template with the following code:

render($page['user_menu']);

Drupal seems to automatically handle where thsis should be output. Generally it outputs in the /user/* pages.

However, I have recently started working on a custom module that had added a new menu item to /user/my_module but when I visit the page the User Menu is not displayed.

Could someone tell me how Drupal manages the output of the User Menu or possibly how to get it to display on this page/path?


texts: Make Apache Solr return results based on taxonomy term

texts:
I have Content Type A and Content Type B. They both use the same vocabulary. I want to achieve the following:

Let's say that node1 of content type A is associated with the terms term1 and term2. When a search returns node1 as a result (based on its body or other fields), I would also like to present to the user all nodes of Content Type B that are associated with term1 and term2.

Is that possible with the apachesolr module?


texts: Help adding multiple blogs / content areas on a page

texts:
Hi how do I set 4 editable content/blogs block/nodes on a page... i'm trying to do this format http://i.imgur.com/M7Fvc.jpg

main Box 1: width 556 x length 630

right Box 1 : width 210 x length 275

right Box 2 : width 210 x length 185

right Box 3 : width 210 x length 150

also how can I edit the style/css for the blocks/nodes on this page?


texts: Login Failure Messages are not being shown

texts:
I am using Drupal 8 with the Bootstrap 3 theme.

When a user on our site tries to log in unsuccessfully, no failure message are displayed. Is there something I can change anywhere in settings to show a message when the user fails to log in?

I know that eventually, the UserAuthenticationController::login method processes the user/login POST request and will return a BadRequestHttpException if the username and password are not correct with the text 'Sorry, unrecognized username or password.'.

However, I don't see this or any other error message anywhere on the site when testing the login control with invalid usernames and passwords. I'm just returned to the login page with no error. Having spent days googling this and even digging into Drupal 8 core, I am sure I am missing something.

Does anyone have any ideas to try for this?


texts:
I just updated my live Drupal install and now I receive the following notice in the admin:

Found one invalid variable

When I go to /admin/reports/variablecheck it shows that the variable drupal_private_key is invalid.

Is it safe to delete this key? Will it autogenerate? What does this key affect? Will I have to edit my cron to use a new key?

I tried using Google and this site but nothing seems to say what this key is or if it's okay to delete it. I have experienced this issue before a year ago but cannot remember the solution. I'm sure I am not the first person to experience this but intrigued I couldn't find a solution online.

Thanks for any insight on this issue.

EDIT

It appears the last time I had this issue I added the key to the settings file, including a drupal hash salt  variable (see this post). Everything was working fine until the update. This issue does not exist on DEV or STAGE, only on PROD


texts: Drush make Distribution throwing errors: exec() unable to fork bootstrap.inc:636

texts:
I'm using DrupalPro VM and trying to do a drush make on the distribution One Page CV.

I build the distribution:

sudo drush make onepagecv.make -y

But I'm getting the following errors during the make and crashes my terminal. I logged the install process and it seems to stop at the following.

Here is the log:


texts: Add programmatically exposed filter to view without removing the existing ones

texts:
I want to add an exposed filter to a view which contains already exposed filters but without altering them.
When I add the following code it messes up  the exposed filters from the view and only the programmatically coded exposed filter works correctly.

I use the following code:

function music_m_views_pre_view(&$view, &$display_id = null , &$args = null)
{
$filter = $view->display['default']->handler->options['filters'];
$current_latter = arg(1);
$filter['field_last_name_value']['value'] = $current_latter;

$view->display_handler->override_option('filters', $filter);
}


texts: "object not found" error while creating a multisite

texts:
i have an existing working D7 site in my local. when i tried to create another site with same code-base and different db, it is showing "object not found" on hitting url. Below are the list of steps i followed:

Created testdb with testuser.

Created directory named as "domain2" for multisite inside xampp/htdocs/drupal/sites

Copied default.settings.php from existing site to "domain2/sites/default" folder and added testdb details.Given write permissions.

host file:
127.0.0.1   domain2

http-vhost.conf:

<VirtualHost *:80>
                     DocumentRoot "C:/xampp/htdocs/drupal7"
                     ServerName domain2
                  </VirtualHost>

When i hit localhost/domain2, it is showing "Object not found" error in browser.
Please help me with this.


texts: Associate an 'event' content type with a 'project' content type

texts: I have a project content type that can be created by users with certain permissions. I want these users to also be able to create 'events' that are associated with these project content types. So for example, A user who creates a project can create events for that project. I was thinking about putting a entityreference autocomplete field on the event content type that looked up projects created by that user (or could be people who have edit permissions on that content type). Does this  sound like a good way to do this or is there a more standard way to achieve this?


texts: Can a module install a content type optionally or conditionally?

texts:
I have a module which installs a number of different custom content types, each defined in a .yml file in config/install/.

I install my module, and the content type appears and works normally, and I used them to create content.

I was doing some other development that required me to uninstall and reinstall this module. It uninstalled with no problem, and I did not lose any of the content built on the module's content types.

However, the module could not be reinstalled. When I tried, I got the error message:

  Unable to install CustomModule, node.type.custom_node_type_one, node.type.custom_node_type_two already exist in active configuration.

where custom_node_type_one and custom_node_type_two are the content types installed by my theme.

This seems like a potentially serious problem. My module defines blocks that appear on nodes using these custom content types, but they also may contain independent content. If the module is uninstalled for any reason, I don't want to force the site admin to wipe all of that content--but I also don't want the site to be blocked from reinstalling the module.

Is there a way in Drupal 8 to make the installation of a content type conditional, so that the module can be uninstalled and reinstalled without having to first delete all of the site's custom content?


texts: How to trigger function on vocabulary terms update?

texts:
Is there a hook that being triggered when any term in taxonomy vocabulary is edited/added/deleted?

I'v tried to use hook_taxonomy_vocabulary_update but no success so far.


texts: Regarding term clarification in the database api

texts:
So I was making a custom block, and implemented the build() method.

public function build() {
    $result = $connection->db_query("SELECT n.title, u.uid, n.created    FROM node_field_data n, users u WHERE u.uid = n.uid AND n.type = :type ORDER BY n.created DESC LIMIT 5", array(
        'type' => 'article',
    ));
    $content = '';
    if ($result) {
        while ($row = $result->fetchAssoc()) {
            $content .= '
' . $row['title'] . '
';
        }
    } else {
        $content .= 'No blog posts to show';
    }

    return array(
        '#markup' => '
' . $content . '
',
    );
}

So this is a pretty basic helloworld kind of example calling the database. But db_query is deprecated with the following surgestion:

     * @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
     *   a database connection injected into your service from the container and
     *   call query() on it. E.g.
     *   $injected_database->query($query, $args, $options);

The surgestion seemed kind of spacey not entirely knowing all of the expressions but i eventually fixed it with the following code:

    $connection = \Drupal::database();
    $result = $connection->query("SELECT n.title, u.uid, n.created FROM node_field_data n, users u WHERE u.uid = n.uid AND n.type = :type ORDER BY n.created DESC LIMIT 5", array(
        'type' => 'article',
    ));

to call the database.

My question is, \Drupal::database() is a static method, and i call it from inside of my own block, am i doing it wrong? or am i misunderstanding their meaning of dependency injection? if i had to do DI in other web programming i would find the DI container and configure it to give the database into my constructor or via a accessor method right?

Follow up questions is

What exactly constitutes my container?
What is "my service" referring to?  my module maybe?


texts: How to exclude admins from receiving user relationship requests?

texts:
The title seems to be clear enough. I am wondering how the site administrators can be excluded from user-relationship requests (in D6.22).

It seems to be defective in the module's settings: While there is a 'Role Receive' option there which states:

  You may choose which roles are allowed to receive this relationship.
  If none are selected, all roles are allowed to receive the
  relationship

But while I've chosen roles other that 'site administrator', but the site administrators still receive the unwelcommed requests.

Hoping to circumvent this problem, I've installed User Relationship Limits but the admininstrator role is not among the 'Role Limits'!

So I appreciate your hints to resolve this issue.


texts: Getting AJAX 200 error when view with custom exposed filter has no results

texts:
[Edit 3: this turned out to be one of those phantom views problems (*) - after messing around w/ a test view cobbled together to use the custom filter, etc., etc., I ended up simply cloning the original mis-behaving view block, added it to a single page, and the thing worked!  So I took the original out of circulation and am now using the fully-functional clone.  I have no idea why the clone works and the original doesn't, but I'm not going to argue with the result.
(*) On occasion I have seen weirdness that seems to be related to choosing one views option, like a contextual filter validation method, then going a different route with a different validation method, and seeing what appears to be behavior related to the original choice.  Revisiting the settings fixed this "phantom" behavior....]
I created a custom exposed filter for a view, and everything works great when there are results for the view.  However, when the view returns no results, things get weird: my results aren't updated at all (I have auto-submit on), and I get a popup showing:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows
Path: /views/ajax
StatusText: OK
ResponseText:
[followed by what looks like the beginning of normal results]

I've searched high and low for a related Views issue on Drupal.org, as well as on StackExchange and the general internets, but I haven't seen a similar problem reported.
I tried flushing the Drupal cache, turning off Views caching, turning on Views debugging, all to no avail (nothing is written out to the log in the error situation).  There's nothing written to dblog when the error happens.
I tried adding a (Global: Text area) message to be shown for No Results Behavior under Advanced for the view, but that didn't change anything, and I don't see the message.
Out of curiosity, I added hook_views_pre_render, and I see the appropriate row count in the results for non-zero result sets, as expected. However, I see hook_views_pre_render being hit with zero results for the error cases, but there is another pass through the hook with results!
Furthermore, for the error cases, hook_views_post_execute is hit with results = 0, 1 row, and N rows, where N is the same number of results seen for the spurious result set for hook_views_pre_render for the same error case.  For non-error cases, both hooks are only hit once with the correct number of results.
Anyone have any ideas about this?
Thanks!
Lee
[Edit: I'm running Drupal 7.36 and Views 7.x-3.10]
[Edit 2: I applied the custom filter to a new, simpler view display - a page display, this time - and hardcoded a contextual filter and a matching taxonomy term in the custom filter code.  It turns out I was wrong about the error condition - there's actually one row being returned in the case that is showing up with an Ajax error for the original view block display.  Furthermore, I can run this page display with or without Ajax and not have a problem.  Lastly, for the 1-row case, I do see the 2 views hooks being called 2x each - once with 0 results, and once with 1 result for each hook.]


texts: Us js file in a theme already use by a module

texts:
I need to use in my theme a js file used originally by a other module: View slideshow.

View Slideshow take the jquery plugin Cycle from the libraries folder, on the root of the App, something like

libraries/js/cycle/jquery.cycle.js.

Now i need to use the jquery plugin Cycle in my theme, but drupal put it after my main theme js file

<script src=mytheme.js>
<script src=....cycle.js>

So it can't use it, because cycle must be before.

I add the file in my libraries.yml file like this:

mytheme
  js :
    - ...cycle.js: {}
    - mytheme.js: {}

but cycle steel remain after.
How could i move Cycle on top ?


texts:
First of all sorry if this is a basic question.

I have two content types "Category" and "Items"

I used "Entity reference" to link  both content types with each other.

Category contains "Category1, Category2, Categry3" as data.

Items contains 10 items 1 to 10.
Lets say each categoy contains 3 items.

How can I create a view of items grouped by categories?
For example:

Category 1:

Item 1
Item 2
Item 3

Category 2:

Item 4
Item 5
Item 6

Category 3 :

Item 7
Item 8
Item 9
Item 10

Thank you very much in advance for your support


texts: Styling different fields before/while rendering it using drupal_render

texts:
I developed a custom module, in which I display tabs of different nodes. I render each nodes using the below piece of code,

$node = node_load($myNodeId);
$view = node_view($node, 'full');
$rendered = drupal_render($view);
print_r($rendered);

Is there a way in which I can access and style the individual elements in the $node, so that my $rendered contains the HTML that has the fields styled as per my wish.

Also a greedy thought, does drupal allow a call back function to be registered while rendering fields? so that my function takes care of rendering my fields of interest.


texts: How do you call an install function that did not run during install?

texts:
I am using the Currency Taxonomy module to get all valid currencies around the globe as taxonomy terms. On installing the module, I got the taxonomy vocabulary but not the terms.

The code to add the terms is in the install hook but did not get executed for some reason.  Reinstalling the module helped.

However, I need to export this 'reinstall' which I am not able to figure out how to do. I am thinking of calling the adding taxonomy terms function from another module in a hook update.

Does anyone have better solution than this?


texts: Using attachFileToField in a Functional test doesn't allow entering the alt text for an image

texts:
In a Functional test, I am doing:
    $this->drupalGet('node/add/article');

    $page->fillField('title[0][value]', 'Page 1 EN');

    $page->pressButton('Add image');
    // Using TestFileCreationTrait::getTestFiles().
    $image = current($this->getTestFiles('image'));
    $page->attachFileToField('field_image', $this->container->get('file_system')->realpath($image->uri));

This appears to work, in that if I then do:
    $page->pressButton('Save');

I get a form error because the image alt text is required.
But this doesn't work:
    $page->fillField('field_image[0][alt]', 'Image alt text EN');

and in the browser output, I don't see the subfields for the image.
In FunctionalJavascript tests that use attachFileToField(), there's typically a waitForFoo() call which waits for the form AJAX to update and show the image subfields.
But that's not available in Functional tests, and besides, there's no AJAX since there's no JS.
How can I get this to work?
(I'd really rather not use drupalPost() to send a massive edit array; using Mink to fill fields one by one is much better DX I find.)


texts: Unable to create a View with Content Revision relationships. Table workbench_revision_tracker doesn't exist

texts:
I'm working with a View that is supposed to pull in certain content types only if they have 1 or more revisions (i.e., content that has been updated recently). However, when I try to add a relationship in the view to Content latest revision, the page throws an SQL error that the table workbench_revision_tracker doesn't exist.
I found this issue on the Drupal site that says:

So it looks like WBM's revision tracker creates its table on-demand.
... if you want to add a Views relationship to the latest revision of the node, you'd better be damn sure you already have at least one versioned node in the database, or you will get horrible SQL errors as soon as you add the relationship

I created an article and updated (changed body, etc.) it a couple of times after it was published, and thought that created a revision, but the table still does not exist in the database. The "create new revision" checkbox was checked at the time of updating.
How do I correctly query for content in a View that has been updated?
I'm using Drupal 8.


texts: Is it possible to provide a temporary role to an anonymous session?

texts:
Use-case is to provide a set of permissions to an "anonymous" user i.e. we don't know who they are and they haven't logged in, we just have their IP range to confirm where they're coming from (yes I know... it's not a system I would design :) ).

I don't necessarily know what permissions these users need down the line i.e. it may be access to certain node types, it may be access to certain file entities.. it will be an evolving set of permissions that should be configurable later as a role would be.

Is it possible to define a role and then temporarily give it to anonymous sessions that meet our criteria? I tentatively tried using an EventSubscriber to check each time our module loads but that isn't working because obviously we can't really "save" an anon user i.e.:

class CivicrmIpAccessSubscriber implements EventSubscriberInterface {

  public function CivicrmIpAccessLoad(GetResponseEvent $event) {
    $proxy = \Drupal::currentUser();
    $roles = $proxy->getRoles();
    if ($roles === ['anonymous']) {
//Business logic to determine if a user gets access would go here
      $user = User::load($proxy->id());
      $user->addRole('ip_access');
//This user save doesn't work, and I wouldn't have really expected it to but I tried it
      User::save($user);
    }
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = ['CivicrmIpAccessLoad', 250];
    return $events;
  }

}

Is there a good way to accomplish something like this for a session? I feel like anonymous user is barking up the wrong tree and session would be correct but i'm not sure how to interact with access from there.

Edit: $user->save(); also not working. The result of these saves seems to be no log feedback but the role is not added if I go get the current user again and check the roles so they still get access denied.


texts: Using the Answer form of Answers module?

texts:
I am building a Drupal 7 site using: page manager, Panels, Views and the Answer module.

In the Answer module page and on the Demo site there is an option to put the Answer form in the same page with the question.

How can I do that on my site?
I can find how to define that..
In addition, how can I do put the answer form on a Panel Page?

Please Note: This Question is different because it dealing with the specific version (7.x-4.0-alpha1) of the answer module. in this version the Answer form can be displayed in the question page.
The other question I have asked has no relation to the answer module specifically, although I am trying over few days to achieve the same goal.
I already wrote that the answer I got is problematic, and did not solve the problem.

I will be very happy to get any help or suggestions, since I am dealing with this issue for few days without a solution!


texts: How to check order exist or not in commerce order?

texts:
I am using Drupal 7.31 and the Commerce Kickstart distribution. I added an order using CSV file in commerce_payment_transaction table.

I want to check the condition below:

if (isset($_POST['submit'])) {
  $handle = fopen($_FILES['filename']['tmp_name'], "r");

  $i = 1;
  $f_status = FALSE;
  while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
      if($i > 2){

        $o_id = $data[1]; // I am fetch order_id from csv. I wont to check which order_id is coming from csv is present on commerce_order or not?
        $remote_id = $data[2];
        $created = strtotime($data[7]);
        $changed = strtotime($data[11]);
        $amount = $data[8] * 100;

        $db_query = db_select('commerce_payment_transaction','cpt');
        $db_query->fields('cpt');
        $db_query->condition('cpt.order_id',$o_id,'=');
        $db_res = $db_query->execute();
        $row_count = $db_res->rowCount();

        if($row_count == 0){
            $o_load = commerce_order_load($o_id);
        }
    }
  }
}else{
   $output = "Upload new csv by browsing to file and clicking on Upload
\n";
   $output .= "<form enctype='multipart/form-data' method='post'>";
   $output .= "File name to import:
\n";
   $output .= "<input size='50' type='file' name='filename'>
\n";
   $output .= "<input type='submit' name='submit' value='Upload CSV'></form>";
   return $output;
 }
 $i++;
}

How can I do so?


texts:
I'm trying to change the HTML output of the Drupal 7 core main menu block.

I'm using a template file named block--system--main-menu.tpl.php which is overriding it correctly.

Im trying to get the following output but not having any success.

<sidebar id='sidebar1' layout='nodisplay'>

 Nav item 1

 Nav item 2

 Nav item 3

 Nav item 4

 Nav item 5

 Close

</sidebar>

Here is what I am currently using in my "block--system--main-menu.tpl.php" file.

<sidebar id="sidebar1" layout="nodisplay" side="left">
       <?php print $content; ?>
</sidebar>

With this i'm just getting the standard drupal 7 menu output.
I need to be able to control the HTML that is output from the template.


texts: How to get taxonomy term reference fields value translated in twig

texts:
I have a taxonomy vocabulary with terms.
In a content type, I have a referenced field with this taxonomy.
I can get the taxonomy term in twig like this :
{% for item in node.field_lorem %}

    {{ item.entity.label }}

{% endfor %}

It works. But I don't know hot to get the translated terms when I switch language.
All other basic fields are translated. The multilingual configuration seems ok.
Example, a text field {{ content.field_text }} is translated.
The translation is activated for taxonomy (Taxonomy term is checked).
/admin/config/regional/content-language

The termes are translated :
taxonomy/term/11/translations

Is there something I miss in my twig ? Actually, I always get the terms in default language.


texts: Multilevel Menu but all in the same drop down?

texts:
How would you create a menu in Drupal where you had multiple levels, but they were all displayed in the same dropdown but with the child menu items indented.

e.g.

Parent 1
 Child 1
 Child 2
 Child 3
Parent 2
Parent 3


texts: Change the add content look and feel for an specific content type?

texts:
So, I would like to change how the Add Content form looks like. Right now the user sees it like this (everything's in spanish, sorry)

But I would like to change it to something like this (all text in spanish again, sorry)

The text in grey would be the latest saved node, the button on the right ("Agregar Siguiente") acts like the "save" button, but it comes back immediately to this same page.

I know I would have to develop a Module to do this, could you direct me in the right direction to do something like this? Thanks in advance.


texts: How do I get the the last time a webform submission wizard page navigation button was clicked?

texts:
I have a need to know if a multipage webform submission has been edited, and when, by the current user. If I load the webform submission I can see when it was completed, updated or started, but I don't see how to know if there is an edit in process. This might happen when a person edits a page or 2 and leaves without getting all the way to the end and submitting the submission again.

    $completed = $submission->isCompleted();
    $changed_time = $submission->getChangedTime();
    $completed_time = $submission->getCompletedTime();
    $updated_time = $submission->getData()['timestamp'];

$completed shows if form was ever submitted.
$changed_time shows the last time the form action buttons were used, but after the first submit it only updates if the form is submitted again.
$completed_time shows the first time the form was submitted.
$updated_time shows the value in a field I added where I save the timestamp on the validation of any action button, but this is only available in the submission entity after a submit.

How can I get a real last edit time? Thanks.


texts: notice after entering a function in template.php

texts:
I get the following notices on every page:

Notice: Undefined index: node in myZen_preprocess_page() (line 242 of /Applications/XAMPP/xamppfiles/htdocs/drupalH1/sites/all/themes/myZen/template.php).
Notice: Trying to get property of non-object in myZen_preprocess_page() (line 242 of /Applications/XAMPP/xamppfiles/htdocs/drupalH1/sites/all/themes/myZen/template.php).
Notice: Undefined index: node in myZen_preprocess_page() (line 246 of /Applications/XAMPP/xamppfiles/htdocs/drupalH1/sites/all/themes/myZen/template.php).
Notice: Trying to get property of non-object in myZen_preprocess_page() (line 246 of /Applications/XAMPP/xamppfiles/htdocs/drupalH1/sites/all/themes/myZen/template.php).

I put the function I need to use the files page--content-type, and is as follows:

function myZen_preprocess_page(&$vars) {
   if ($vars['node']->type == 'mappe'){
     $vars['theme_hook_suggestions'][] = 'page__mappe';

    }
  else if ($vars['node']->type == 'fatti_e_risorse'){
    $vars['theme_hook_suggestions'][] = 'page__fatti_e_risorse';

  }

  }

Can I disable notices or fix this? thank you!


texts:
If I have a long line of code that exceeds 80 characters, like this:

$last_response = '' . t('Last response: ') . '' . format_interval((time() - $last), 1) . t(' ago');

Should I break it on to a new line and indent once? I'm sure I've read this in the coding standards somewhere, but now I cannot find where I read it, if I did, like this.

$last_response = '' . t('Last response: ') . ''
  . format_interval((time() - $last), 1) . t(' ago');


texts: Add different paragraphs block on translated nodes

texts:
Is it possible to add additional paragraph blocks on an translated node?

If yes; How? I've tried messing around with configuration; but cannot get it to work as expected.

If not; How do we go around this behaviour?


texts: I want to link file in views to files/fid

texts:
I have a content type, which has video and image attachment. In the view created on this content type, the table shows the thumbnails of video and image file. I want to link thumbnails to files/fileid. And not sites/all/default/files/filename....I want to link to file-id and not generic file...
   Tried rewrite results as a link but the lin there doesn't supports the tokens (file:fid or file:filename)..


texts: How to ensure javascript using drupal behaviors is only run only certain pages?

texts:
I have a custom module "mymodule" that will contain a javascript file that use drupal behaviors to do something.

Here is the file structure of the module. In the .info file i have added script[] = "js/mymodule.js"

mymodule:

js/mymodule.js
mymodule.info
mymodule.module

One item i have noticed is that the javascript files runs all pages whenever the page is loaded. How can i limit the javascript to only run on pages where the javascript is needed?

Desired scenario:

If on any admin/* pages, do not run the javascript
If on any node/* page and if the page has a  tag with an id="target-id" (i.e. ), then run javascript.


texts: Custom access method for a Page Manager page

texts:
I've created a page using Page Manager, at the route /project/(node}/attendance.
I need to add a custom access check on it, comparing information about the current user with the node to see if they should have access.
I have added a route subscriber, but when I loop through the route collection, my route does not appear. I have read that this is because pages added through the page manager are they themselves nodes.
Is there a way to add a custom access method to a Page Manager route?


texts: How to upload multiple files in a custom form with Form API

texts:
I have a custom form created with Form API. In this form, I have a file field with the type managed_file
$form['fichiers_justificatif'] = array(
    '#type' => 'managed_file',
    '#title' => 'justificatifs',
    '#upload_validators' => $validators,
    '#upload_location' => 'private://justificatifs',
    '#multiple' => TRUE,
    '#description' => 'types de fichier autorisés : png gif jpg jpeg pdf doc',
);

It works well, I can upload a file, get its name and url.
But I don’t know how to have a multiple file upload like the one with see in admin or with the webform module.
Example of webform module which handle multiple files upload :

I’ve tried to add '#multiple' => TRUE, but I have an Ajax error after  the 2nd file is submitted.
I’ve tried this module Multi-value form element but still have AJAX issue.
I’ve tried dropzone.js but I'm not satisfied with it since it adds an other interface for file (different from the one in admin). User are confused there is an other interface for files.
What could be the better way to handle this ?


texts: How to change the 'Quantity' label in commerce-order-item-add-to-cart-form

texts:
I'm trying to modify my 'Add to cart' form, changing the 'Add to cart' button text and the 'Quantity' label:

if(strpos($form_id, 'commerce_order_item_add_to_cart_form_commerce') !== false) {
    $form['actions']['submit']['#value'] = t('Book Now');
    $form['edit-quantity']['und'][0]['value']['#title'] = t('Number of days');
  }
}

The first part is working, changing the 'Add to cart' button text, but the second part is failing changing the 'Quantity' label.

Any idea how to fix it?


texts: get file path of image style as replacement patterns in views

texts:
i need something like

<img attribute1='value' src='sites/default/files/styles/thumbnails/**pic_0**.jpg'>

in views.

i have to use rewrite result because i need attribute1. but i have no idea how to get src of image.
[filename] is not always same with file path. -for example [filename] is pic.jpg but file path is pic_0.jpg- .

and [uri] give me http://example.com/sites/default/files/pic_0.jpg  not http://example.com/sites/default/files/styles/thumbnails/pic_0.jpg.

how can i get pic_0.jpg or http://example.com/sites/default/files/styles/thumbnails/pic_0.jpg?


texts: Application of patches after core/module updates

texts:
What is the recommended way to automate application of patches after updating core or contrib modules? For now, I'm doing this manually but it gets tedious for sites with a large number of modules that need to be patched.
There seems to be a myriad of methods one can do this but I was wondering if there is a particular method which is the "industry-standard"?


texts: How to copy address on node translate action

texts:
My website is an i18n web site. When it's time to manage content with a location field (address) I need to manually copy the address. Is there a way to make the location copy automatically on translated node?

Let's say I have node type Retail. This node type contains a Location (Field) provide with Location Module for Address purpose.

Use case:

User clicks on Add Retail (in French first). He filled the Location field like (Address, city province, country etc.). After that, the user clicks on save and then clicks on the Translate button. The user chooses to translate in English. The Address field that was previously entered in French is empty and the user needs to enter it again.


texts:
I have the following code:

function trc_upload_file() {

    $form['trc_upload_form'] = array(
        '#type'         =>  'managed_file',
        '#title'        =>  'Upload File',
        '#descripion'   =>  'Uplaod files',
    );

    $form['#submit'][] = 'trc_upload_file_submit';
    return $form;
}

function trc_upload_file_submit($form, &$form_state) {

    $file = file_load($form_state['values']['trc_upload_form']);
    $file->status = FILE_STATUS_PERMANENT;
    file_save($file);

    /*file_usage_add($file, 'trc_upload_page', 'user', $account->uid);*/

    drupal_set_message(t('You Uploaded Successfully!'));

}

This is working fine, but the status remains 0 in database, which means it is not saved as permanent.
How do I use file_usage_add() function? Can I use it for user roles instead of individual users?


texts: Can I restrict the block visibility only show for /worker/*/ but not /worker/*/...?


texts: How do I add a basic FlexSlider to the body?

texts:
I only need a very simple slider on a single page and so I just want to use Flexslider's most basic HTML options. But I cannot get it to work!

My code is pasted from http://flexslider.woothemes.com/basic-slider-with-custom-direction-nav.html except that I'm using images from my test server. I have triple and quadrupal (pun intended) checked that my styles are correct.

Here is the first bit of HTML:

I have confirmed that FlexSlider is working by creating a View and adding it as a block.

One clue: My images all disappear on my test page when the flexslider block is active, which suggests to me that the flexslider JS is NOT being loaded normally (I presume it's loading its CSS dynamically).

Without hacking my theme files or adding JQuery code to my theme, is there a way to get FlexSlider to load in this scenario?


texts: Drupal config error "module.settings" depends on the module that will not be installed after import

texts:
I'm having this error on Travis Build.  I can't go pass this error.  I've been removing dblog from the list of config and also delete from my localhost database before I export drush cex sync -y
 The import failed due to the following reasons:
  Configuration dblog.settings depends on the <e
  m class="placeholder">Database Logging module that will not be install
  ed after import.
  Configuration views.view.watchdog depends on t
  he Database Logging module that will not be in
  stalled after import. '

What else should I try to solve this problem?


texts:
After some painful searching, I think I've deduced a solution (to try) to fix my real problem. That solution involves changing the Author of a node.

The real problem is the Workflow tab showing on a few products for Anonymous users. I've been all through all the permissions, rules and workflows. What I found was that if an Authenticated user who created some content is deleted, that content is assigned to an Anonymous author.

So, I was trying to find the data in phpmyAdmin to edit one there as a test but I haven't found the information.

As the super user, I cannot edit the authorship of a node as I haven't found a tab/setting etc to do so.

Can anybody steer me in the right direction?


texts: User listing not showing up with user reference when create programmatically

texts:
I am using the References module to create a User Reference programmatically.  However, when I use the field that is created, there is no listing of the users to choose from.  The User Reference works when I create a field from the UI.

I first create the field as follows in my hook_install function:

    $field = array(
        'field_name' => 'vendor_user_reference',
        'type' => 'user_reference',
        'cardinality' => 1,
        'entity_types' => array('commerce_product'),
        'translatable' => FALSE,
        'locked' => TRUE,
    );
    field_create_field($field);

I then call when the product type is created the following code

$instance = field_info_instance('commerce_product', 'vendor_user_reference', $product_type['type']);

if (empty($instance)) {
    $new_instance = array(
            'field_name' => 'vendor_user_reference',
            'entity_type' => 'commerce_product',
            'bundle' => $product_type['type'],

            'label' => t('Vendor User Reference'),
            'required' => TRUE,
            'settings' => array(),
            'widget' => array(
                'type' => 'user_reference_autocomplete',
                'weight' => -10,
                'settings' => array(
                        'autocomplete_match' => 'contains',
                        'size' => 20,
                        'autocomplete_path' => 'user_reference/autocomplete',
                ), //end setting array
            ), //end widget array
            'display' => array(),
    );
    field_create_instance($new_instance);
}

This creates the field on the entity/bundle, but when I try to use it from the UI, there are no user listings.  This is the case if I use select list or autocomplete.

What am I doing wrong?


texts:
I'm looking for a way to disable a single link in a menu for a certain language. From my understanding with similar issues, I'd like to activate translation for the menu link field Enabled since this is set for all languages by default.

Is there a way to activate the translation of this field for menu links?


texts: Create a view to show users who flagged other users

texts: I have created a User flag as Report Abuse. Users may flag other users with this flag. Now i want to create a view where the users who are flagged along with the flagging user are shown. However i am unable to show the flagging user (though i am getting the user id of the flagging user). It should have been quite simple. I have added, i think, the required relationships. Here's a screen shot of the view settings.


texts:
Consider this:

I have one fast server with a Drupal installation but this server does not have access to a lot of disk space.
I have another server that isn't quite as fast but does have access to lot of disk space.

My drupal server is hosting a blog and some photo galleries.
I would like my drupal server to use the file server to store its images and files.

How can I achieve such a thing?
The file server can be accessed through ftp or sftp.

I'm considering using the storage api for this, it seems like a good fit (?) but I'm not sure how to implement it. The documentation seems a bit off.

Also, the blog uses the wysiwyg module + the media module to allow for image uploads in the body field. How can I make this functionality work with the storage api?

Is there anyone with experience in this field that can help me out?


texts: Prevent ajax submit function being called when it fails validation

texts:
I have a form, that when it's submitted, should be validated, and if valid, the results of that form should then appear below the form.

This works fine without AJAX:

function _form_validate($form, &$form_state) {
  if (!is_numeric($form_state['vsalues']['zip'])) {
    form_set_error('zip', 'Zip must be number');
  }
}

function _form_submit($form, &$form_state) {
    $values = $form_state['values'];
    $html = "
zip: ". $values['zip'] . "
";
    $form_state['storage'] = $html;
    $form_state['rebuild'] = TRUE;
 }

and then this gets printed out my main form in

  $form['output'] = array(
    '#markup' => (isset($form_state['storage']))?$form_state['storage']:'',
  );

If I make it an AJAX form, and change the submit function to:

function _form_submit($form, &$form_state) {
    $values = $form_state['values'];
    $html = "
zip: ". $values['zip'] . "
";
    $form_state['storage'] = $html;
    $form_state['rebuild'] = FALSE;
    return array("#markup" => $html);
}

It works fine apart from the fact the submit callback is triggered even when validation fails (e.g. passing a non-numeric value shows both a validation error yet also prints "zip: ").

What am I doing wrong? How can I stop the submit function being called?


texts:
I am creating a block and I cannot get it to render correctly. I need to render a list of links but it is not working and it is showing nothing on the page.

I have the hook_theme() function like this:

function list_city_theme() {
  return array(
    'list_city_display' => array(
      'variables' => array(
        'title' => NULL,
        'locations' => NULL
      ),
      'template' => 'filter-by-city--display.tpl.php',
    ),
  );
}

And heres where i'm trying to set the theme inside the block view function:

$args = array(
  'title' => 'Filter by Town / City',
  'locations' => $locations
);
$block['content'] = theme('list_city_display', $args);


texts:
I am using Notification to subscribe to different content types so that I can receive emails when a user creates/updates a particular content type.

The following is an email I generally receive from Notification.

 Greetings, ajinkya.

    These are your messages
    New content of type Blog has been submitted
    - Blog Test, Friday April 12
    Read more [node-url]

The problem is that the token [node-url] is not being replaced with a link to the node that has been created, and I am not able to find any interface that would allow me modify the token replacement behavior. Do I need to manually change the code in Notification?


texts: I am using the Feed module in Drupal to import the list of my users from WordPress and I have faced a big problem: The password field mapping in the Feed module says "unencrypted password", and there is no way of decrypting phpass WordPress passwords into a CSV file (it is not even safe). What should I do?


texts: how to give relative path in drupal for setting an image

texts:
Hi all,
      iam trying to set image here in a module .The image is in the same module folder. but iam not able to get the image path

This is the error which iam getting ..cleary states no path

  How to get a relative path in module to display images?


texts: Linking an action to the button in the view

texts:
I'm looking for some tips how to achieve following functionality in Drupal 8.

I have a simple view where I list filds, nothing special. One of the fields is a custom text which is rendered as a button html element. Now, I want to assign a special action to this button, it is a automatic creation of new node.

Any help will be appresated.


texts: How to identify permissions which current user lacks to access node create page?

texts:
I have a user with custom role. This role has permission custom-type: create new content.

When I try to access node/add/custom-type I am getting 403. Site is quite complex.
What is the quickest way to find which permissions I need to add to this user role to access that page?


texts: How to change the order of the payment methods in Commerce?

texts: How can I change the order of the payments methods in the last step before placing an order in Drupal Commerce?


texts: How might I go about flagging a post or comment containing certain keywords?

texts:
I have nodes coming in via FeedAPI and direct user submission, and I've got comments. A client requires me to check incoming nodes against a watch list of keywords. The posts and comments don't need to be blocked, because the watch list is fairly expansive (~1000 words but many are very context dependent). Rather, I need to be able to check the contents of a post or comment against the list and set a flag that triggers a notification to a moderator, who will manually review the content.

Is there a module that can help me with this? Barring a module, I could use a few clues to get me started on this, e.g.

"To check the content on a newly published node or comment, you could do these things."

"To flag based on a hit, you could do this thing."


texts: How can I detect AJAX request inside Drupal?

texts: I am looking for Drupal way of detecting AJAX request. I need to check this inside hook_form_alter (embedding views with AJAX support)


texts: Why can't I set radios default value (when after build is done)

texts:
I'm putting a node add form on a custom page that is a menu local task tab for specific taxonomy terms, and trying to set default values for some of the elements.

I'm building the form like this:

function emtr_form($form, &$form_state) {

    module_load_include('inc', 'node', 'node.pages');
    $form = node_add('mtr');

    $form['field_shift'][LANGUAGE_NONE]['#default_value'] = 'early';
    // also tried this but it doesn't work either
    //$form[LANGUAGE_NONE]['early']['#default_value'] = true;

}

When I inspect the form array I can see:

#options (Array, 3 elements)
    early (String, 13 characters ) 23:00 - 07:00
    lunch (String, 13 characters ) 07:00 - 15:00
    late (String, 13 characters ) 15:00 - 23:00
#default_value (String, 5 characters ) early
#after_build_done (Boolean) TRUE

This shows my default value matches the options array key, however also shows that #after_build is done. I suspect that the default value gets set in the after build function, however if I set after build to false I seem to get caught in an endless loop and the browser crashes.

I tried adding my own custom after_build function to the form and setting the default values there, but because after_build has already been done it is never called.

How can I set default values when building a form like this? Or is there a better way to load the node add form?

EDIT: Here is a paste bin with the whole form item array

EDIT2: This is a radios field that is part of a field collection that is part of a node add form.


texts: Drupal 7: How to create a slideshow using Twitter Bootstrap Carousel?

texts:
I'm a newbie when it comes to Drupal. But I know HTML/CSS, jQuery and Twitter Bootstrap quite well. I already have Bootstrap and jQuery installed and working fine.

I want to take advantage of Twitter Bootstrap responsive features and create a Twitter Bootstrap Carousel (photo slideshow) on the homepage. http://twitter.github.com/bootstrap/javascript.html#carousel

How can I set that up so that the photos and article links can be setup from Drupal 7 admin?


texts: Automtically creating new redirects and alias on node_save

texts:
Here is the code I'm using to change the name field of my nodes if they contain certain phrases.

$query = new EntityFieldQuery();
$query
    ->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'my_product')
    ->fieldCondition('field_my_name', 'value', 'Old Phrase%', 'LIKE');

foreach ($result['node'] as $key => $value) {
    $node = node_load($key);
    $node->field_my_name[LANGUAGE_NONE][0]['value'] = str_replace('Old Phrase', 'New Phrase', $node->field_my_name[LANGUAGE_NONE][0]['value']);
    node_save($node);
}

It successfully changes the name; however, I'd like to automatically create a new URL and also a redirect entry from the old URL to the newly generated one.

I have pathauto installed and my URL Alias is configured to use the my_name field, but the code above does not change the Alias.


texts:
I created a content type and created various entries. Each entry has the following fields:
name, photo, date.

How can I put a box on the home page with fields covering only the last entry?
(I would also like a page with squares side by side, sorted by date.)


texts: How to give class name to the text field in drupal

texts:
I am new to drupal and I have a problem in drupal text-box.

Question : how to give a class for text box?

my html :

<input type="text" name="uname" class="uclass" id="uid">

i want the same in drupal

My code is :

function my_module_my_form($form_state) {

// This is the first form element. It's a textfield with a label, "Name"

$form['name'] = array(

'#type'  => 'textfield',
                    '#title' => t('Enter Your Name'),
                    '#value' => t('Enter user name'),
                    '#name'  => 'uname',
                    '#id'    => 'uid',
                    '#class' => 'uclass',
                    '#maxlength' => 5
                   );
return $form;

}

Note: through inspect element , i find the class name is "form-text", but actually my class name is uclass, It is not taking, can one help me.


texts: Menu tabs disappear if clicking on custom tab

texts:
I am adding a custom menu tab to a user profile. That works fine, but once I click on the tab the other menu tabs (edit, view, etc.) disappear. How can I keep the other menu tabs?

function my_module_menu() {
  $items['user/%user/inbox'] = array(
    'title' => t('inbox'),
    'page callback' => 'drupal_goto',
    'page arguments' => array('messages'),
    'access callback' => 'user_is_logged_in',
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}


texts:
I updated Panels in Drupal 7, forgetting that I had customised it, panicked, deleted the updated module and replaced the correct one via ftp.
Now I can't run update.php as it says the website encountered an unexpected error.
Is my best option to re-install the updated panels, then delete properly it through the module interface or is there a better solution? My site is large with 6 sub domains.
There are no errors showing in the log files, and no errors showing when the error message is posted. The system log shows updates are up to date, and my database was restored to a point before the updates occurred, so were my sites default and sites all directories. I have emptied the cache on the site and on my browser. I'm at a total loss as I would be able to trace error messages myself


texts: How can I render a field based on the value of another field

texts:
I set up a boolean field and an image field. I want to display the logo when the page is viewed only when the boolean field is checked.
Below is the code that I am working with in a node template file.

<?php
      // We hide the comments and links now so that we can render them later.
      hide($content['comments']);
      hide($content['links']);
      hide($content['field_boolean']);
      hide($content['field_logo']);
      print render($content);
    ?>
  <?php if ($content['field_boolean']['und'][0]['value'] == '1'): ?>
    <?php print render($content['field_logo']); ?>
  <?php endif; ?>


texts: How to write a Drupal 7 query with "count" and "having" properties?

texts:
I am unable to make the following query work in drupal7 standards..Can anyone help me with this? Its little urgent...

SELECT n.nid AS nid, n.title AS title, count(n.title) AS ncount
FROM node n
INNER JOIN taxonomy_index tn ON n.nid = tn.nid
WHERE (n.type = 'test')
AND (tn.tid IN( 23,37))
AND (n.title LIKE '%name%')
AND (n.status = 1)
GROUP BY n.nid
HAVING ncount = 2


texts: Drupal.settings.ckeditor is undefind in CKEditor module

texts:
I have installed CKeditor module as per the guidelines of ckeditor README.txt file.
But in neither text area ckeditor is loading.
When I inspected in firebug it shows me following error

  Error: TypeError: Drupal.settings.ckeditor is undefined Source File:
  localhost/drupal7/sites/all/modules/contrib/ckeditor/includes/ckeditor.utils.js
  Line: 5

I am wondering is there any problem in configuration?

I have installed and configured CKEditor module previously many times but I haven't encountered such type of error


texts: Product display and taxonomy term ID filter (with depth)

texts:
I have a view for nodes that show my products by product reference field.
All of these products tagged with "Catalog" vocabulary.
I have added a reference to the field_product in the view.

Is there any way to use contextual filter «has taxonomy term ID (with depth)» for this view?


texts: Use part of Date field for grouping / sorting in View

texts:
I'm creating a Schedule page. I created a Schedule Item content type with a Date field which tracks the date and the time. I want to create a View which lists Schedule Items grouped by Date alone.

My data looks like:

2012-07-01 08:00, Event 1
2012-07-01 11:00, Event 2
2012-07-01 11:30, Event 3
2012-07-02 09:00, Event 4
2012-07-02 10:30, Event 5

I would like this to be displayed grouped by the Date portion of that Date/time object so it looks like this:

2012-07-01

08:00, Event 1

11:00, Event 2

11:30, Event 3

2012-07-02

09:00, Event 4

10:30, Event 5

I tried setting the Grouping on my View to use my Date field using a format that only displayed the Year-Month-Day. However, when doing the grouping, it is still grouping on the real value and not the displayed value. Meaning that since each Date/time value is actually different in the time portion, each value is being used as a separate group.

Is there a way I can generate a virtual field which only contains the Date portion of my Date/time field so that I can use it to properly group all items by Day?


texts: how to redirect user login from other server?

texts:
The user login is from the other drupal site using cas(Central Authentication Service). Then it will lead to my main site and an authenticated user can view the contents. The main site is used Drupalgap to redesign the interface for mobile.

Now, when using the web browser, it works fine to login and start to view the contents. However, I don't know how to do it for Drupalgap. I saw some apps can login with the account from other sites, once the login is successful, it will redirect and come back to the app.

Does anybody know how to do it?

My attempt is trying to use the login url from the other site.

bl('Login', 'www.example.com/cas', { InAppBrowser:true });

This will open a new web browser, not inside my app page. When successfully login, there's a link to go back to my main site. These are operating through the new web browser, not inside my original app.


texts:
Followed the step to create a subtheme of bootstrap theme. Now, I am not able to see new logo updated, logo is overridden by default logo of bootstrap.

1) Downloaded Bootstrap project (8.x-3.x-dev). Placed the bootstrap folder in theme/contrib

2) Copy the CDN folder from the themes/bootstrap/starterkits folder and pasted in theme/custom folder

3) Changed the cdn folder name to mytheme and all THEMENAME occurrences to mytheme. also the inside file into mytheme.info.yml)

4) Gone to admin/appearance and enabled the mytheme

5) Gone to admin/appearance. Locate the mytheme and click on the Settings link to its right

6) scroll down to the Logo Image Settings section. Uncheck the check box and upload a new logo.

Now the problem is the new logo updated is not visible. It is overridden by theme's default logo.

If I choose other theme such as Bartik 8.0.1 then the logo is visible.

Can anyone please suggest how can I fix this issue?


texts: Is it possible to add a visibility restriction to article comments? (For instance, only the poster can view comments.)


texts: Create a sample HTML select of taxonomy terms

texts:
I created a custom form in a custom module. (in a class that extends FormBase)
I want to add a (very) simple html select element, this select must contains all taxonomy elements of a specific vocabulary, like this, where the integers are the taxonomy term IDs.

<select id="...>
    <option value="4">tutu</option>
    <option value="15">toto</option>
    <option value="61">tata</option>
    ...
    <option value="48">titi</option>
</select>

How can I create this <select> tag using the taxonomy term ID and the taxonomy term name? The users would not see the taxonomy term ID, but only the taxonomy term name.

With a vocabulary name, how can I generate the good structure (an array?) that allows me create the <select> tag?


texts:
Running Drupal 7 and trying to enable secure connection between my AWS EC2 and RDS server using SSL.

Php version 5.3.29

I have found some information suggesting the following setup but I'm unsure how to configure this given my own SSL certs and the single certificate bundle I have from amazon?

When I try the below config I get a 500 server error.

Any pointers much appreciated.

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'database name',
      'username' => 'username',
      'password' => 'password',
      'host' => 'AWS RDS Endpoint',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
      'pdo' => array (
            PDO::MYSQL_ATTR_SSL_KEY => '/path_to_your/client-key.pem',
            PDO::MYSQL_ATTR_SSL_CERT => '/path_to_your/client-cert.pem',
            PDO::MYSQL_ATTR_SSL_CA => '/path_to_your/ca-cert.pem',
                     ),
      ),
  ),
);


texts: Custom field validator comparing original and new values

texts:
In my validator, I need to compare the new field value, that was submitted by the user, with the old value. How can I get the original value?
So far, I have this:
class CompareNewOldValuesValidator extends ConstraintValidator {

  public function validate($item, Constraint $constraint) {

    if (empty($item->getValue())) {
      return;
    }
    $value_new = $item->getValue()[0]['value'];

    /** @var ContentEntityInterface $entity */
    $entity = $item->getEntity();
    if (!$entity->isNew()) {
      $value_original = '???';
    }
  }
}

I need to get the field value that was filled in the form before the user changed it, no matter if it is the active version or a draft or an old revision.


texts: What is rss category format in manage dislay?

texts:
Anybody please explain what is the rss-category format, in the manage display settings of term referense field.

When I check this format, nothing is displayed on the node page.

Thanks.


texts: How to set date format in drupal 8 for date time field?

texts:
The default date format of drupal 8 is d.m.Y but I want it to be d-M-Y.

I have tried

#format => 'd-m-Y'

#date_format => 'd-m-Y'

My date field

$form['start_date'] = [
           '#type' => 'datetime',
           '#title' => t('Start Date'),
           '#date_format' => 'd-m-Y',
           '#description' => date($date_format, time()),
           '#default_value' => time()
         ];

But none of them worked.


texts: Search API Views - Show search string in text

texts:
I created a view to display my indexed data, anything works just fine. What I now want to achieve is, that only the part of the bodytext is displayed, that contains the search string. The default drupal search engine can do this, but I have no idea how to achieve this using views.

Someone got an idea how to do that?

Greetings

SG


texts:
I created custom settings for my theme for storing email, fb url, twitter url
and g+ url. Everything is coming properly but the settings are not getting saved.
I have no idea whats wrong. All the code and screenshots are below.

.info file content

settings[z_email] = mail@zed.com
settings[z_facebook] = fb/url
settings[z_twitter] = twitter/url
settings[z_gplus] = gplus/url

theme-settings.php file content

function z_form_system_theme_settings_alter(&$form, $form_state) {
  $form['z_email'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Email'),
    '#default_value' => theme_get_setting('mail@zealind.com'),
    '#description'   => t("Global Email Id for ZealInd site."),
  );

  $form['z_facebook'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Facebook'),
    '#default_value' => theme_get_setting(''),
    '#description'   => t("Facebook Url."),
  );

  $form['z_twitter'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Twitter'),
    '#default_value' => theme_get_setting(''),
    '#description'   => t("Twitter Url."),
  );

  $form['z_gplus'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Google+'),
    '#default_value' => theme_get_setting(''),
    '#description'   => t("Google+ Url."),
  );

}

The theme setting page:


texts: Oembed content embedding not working when link is shared with text

texts:
I have installed oembed dev version few days ago and i am happy it is converting urls to embedded content. I have tried to add new providers to test, few are working, few are not.

Anyway, I am using it in plain text (text format) and when I am sharing only the link, it is working, but when I write some text either before or after the link, it does not convert to embedded content.

Another way to solve this problem can be to use Facebook style micro-publisher module, a sub-module of statuses module, which provides option to share links, photos, videos with the status updates. These are actually attachments with status updates, but i do not know how to integrate it with oembed.

Any solution to my problem?

Note: I am trying to create a social network. I do not want users to post pictures and videos on my server. The idea is to convert link into an embedded content.


texts:
I have created a View (for /blog). The blog page is just articles grouped together. Underneath each blog post I'd like "Comments (x)" (x = showing the number of comments).

That part is done, using Rewrite results > Output this field as a link. Link path = blog/[title]#comments

What I would like to do now is when there are no comments, have a HTML link "Comments (add)" which goes to the comment form for that blog post. E.g. blog/[title]#comment-form

Problem:

I haven't been able to create the "Comment (add)" HTML link using No results behavior > No results text (Is it possible?)

I've tried:

add

and many other alternatives. The link becomes

/blog/%3Ca%20href=

Am I on the right track? How do you recommend I go about this?


texts: Output block in particular region from custom module drupal 7

texts:
I have a custom module that spits out a form using the drupal form API. What I'd like to do is output a block (a custom menu) in a particular region of the page (using block regions would be the best way I'm guessing.) As of now, the block renders in the top left everytime. How can I output the menu block in a particular region of the page?

function client_menu(){

 $items=array();

 $items['campaign']=array(

   'title'=>'Campaign Manager',
   'description'=>'Area for clients to manage their campaigns',
   'page callback'=>'drupal_get_form',
   'page arguments'=>array('client_campaign'),
   'access arguments'=>array('access client administration'),
   'type'=>MENU_NORMAL_ITEM
 );

 return $items;

}

function client_campaign(){

$block = module_invoke('menu', 'block_view', 'menu-client-admin');
print render($block);

//a bunch of form API stuff...

}


texts:
How can I create individual migration groups - one for each XLM file, without having to write a new migration class for each file?

I have dozens of XML files waiting to be imported into Drupal using the Migrate module and API.

Currently, all my migrations are registered under a single group called Questions as shown below:

That single group of 222 imports represents 5/6 of my XML files. If I import the pending dozens of XML files, I will have upwards of 10,000 imports.

What I would rather have is each XML file having it's own individual group.
That way I can revert a single XML file where necessary instead of all them.

Can anyone help me with this scenario?


texts: How can I use tab_parent/tab_root in hook_menu to have one router item appear as a local task for another router item with a different path?

texts:
Say I have the path widget/123 to view a widget, and have another path to edit some properties of this widget at admin/acme/widget/123/edit. In hook_menu it looks like I can still have the admin path appear as a local task (tab) by setting the tab_parent and tab_root properties in hook_menu(), but I can't seem to get it to work. I know how to setup widget/%/edit as a local task, but in this case I'm only interested in setting a different "root" path as a local task.

Here's my code:

<?php

function acme_menu() {

  // View a widget.
  $items['widget/%'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'acme_widget_view',
    'page arguments' => array(1),
    'access callback' => 'acme_widget_access',
    'access arguments' => array(1, 'view'),
    'file' => 'includes/widget.view.inc',
  );

  // Edit a widget.
  $items['admin/acme/widget/%/edit'] = array(
    'type' => MENU_LOCAL_TASK,
    'tab_parent' => 'widget/%',
    'tab_root' => 'widget/%',
    'title' => 'Edit Widget',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('acme_widget_edit', 3),
    'access callback' => 'acme_widget_access',
    'access arguments' => array(1, 'edit'),
    'file' => 'includes/widget.edit.inc',
  );

  return $items;
}

?>

Am I misunderstanding tab_parent/root, or can this be done?

Update: I was missing a MENU_DEFAULT_LOCAK_TASK. Adding

$items['widget/%/view'] = array(
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'title' => 'View'
);

allows the tabs to appear. However, they don't share the same argument position and so the argument (the widget ID) isn't passed between the two. The 'Edit' tab, for example, links to admin/acme/widget//edit. Is there a way to have different routes like this and pass the argument position around?


texts: Creating JSON-RPC PHP client/server setup: permissions question

texts: I am currently creating two modules in two sites, a client and a server on each site respectively.  I want the client to be able to be called from code in any module that needs to communicate with the other site.  Each site has at least ten custom roles.  Is there a way to grant a global permission, I.E. All, or do I need to grant it to every role explicitly?


texts: Views exposed filter hide if less then 10 items

texts: I want to show the exposed filter only when there are more than 10 items to filter. Any suggestion to accomplish this?


texts: How to access single field in views-view-fields.html.twig

texts:
If I enumerate all fields using loop then everything is printed properly:

{% for field in fields -%}
    {{ field.content }}
{%- endfor %}

But I need to print here the fields individually and the following prints nothing:

{{ fields[0].content }}

What's wrong? This is used in views-view-fields.html.twig


texts:
I'm facing a problem with Ajax enabled forms, so this is the scenario.
I have 2 blocks, the first one has some buttons and the other one has a form ,constructed using the Form API.

When I click any of the buttons in the first block and AJAX Request is sent to the server, then in my callback function it replaces the second's block form data with new values,
for doing this I call the drupal_get_form function, so the code for the callback is more or less like this:

$form = drupal_get_form('panorama_info_form');
print render($form);

And the elements of the form have the following style:

//Text field for title
$form['panorama_titulo'] = array(
        '#type' => 'textfield',
        '#title' => t('Nombre del panorama'),
        '#default_value' => $panorama['titulo'],
        '#description' => t('Nombre del panorama'),
        '#size' => 40,
        '#maxlenght' => 120,
        '#required' => TRUE,
        '#prefix' => '
',
        '#suffix' => '
',
        '#ajax' => array(
          'callback' => 'panorama_info_form_callback',
          'wrapper' => 'panorama_titulo_div',
          'method'  => 'replace',
          'effect' => 'fade',),);

Now, in my jQuery Http 200 success function I replace the old form  with the response data like this:

function reload_element(data){
    $("#panorama-info-form").replaceWith(data);

}

where data is the rendered form.

This works, and I can see my form with the new default values that I declared, however after the form is replaced, ajax is no longer triggered by events. What I mean is that before I replaced the form with jQuery, it used to work, the value was sent to the server and the callback function declared for the textfield was in fact getting called. However after the replacement, no more ajax request...
Why is this happening??? I guess that's because there's some kind of script that uses the form's element's classes to attach functions dynamically to it... Maybe that could be one reason.
How could I fix this???
Thanks a lot.


texts: How to change "Read more" and "Add new comment" link to an image in teaser view?

texts:
On the project that I'm working on now I need to display the "Read more" and "Add new comment" links in my teaser as images in sepperated divs.

The problems that I have is:

I'm using "display suite" to show my content but it only gives me a "Read more" link no "Add new comment" link
I need to hide the tekst and display only the image. (see link "read more" part)

Here is a png of what i need to have:

Thx up front for any help you can give me!


texts: How to get the current path, keeping the langcode?

texts:
For my button I need to specify the destination path, as my site is multilingual it is imporatnt for me to keep the langcode in the path. So how can I get from

 drupal-site/fr/page_1

to

 drupal-site/fr/page-2 ?

By just appending /page-2 I lose my language settings.


texts:
I want to build a page that will be my player.
That page.tpl.php will include code like the following one:

<object bla bla ... idmedia="**the parameter that i want to get**"></object>.

I want to call this page with various parameters that play other videos.
I can I do it?


texts: Printing a function on a content type page?

texts:
So if I have a custom function with a DB query within template.php such as

function innovista_get_page_children() {

 $result = db_query("SELECT link_path FROM {menu_links}");
 return $result;

}

and I have a content type specific template page, then how do I echo the results in the template file?

I tried this:

<?php
$results = innovista_get_page_children();
foreach($results as $result){
    print $result;
}
?>

I get the following error

  Recoverable fatal error: Object of class stdClass could not be
  converted to string in include() (line 83 of
  /var/www/vhosts/vidanlawnes.co.uk/innovista2/sites/all/themes/innovista/node--level_1.tpl.php).

If I remove print $result; and replace with print 'hello'... e.g

<?php
$results = innovista_get_page_children();
foreach($results as $result){
//print $result;
print 'hello ';
}
?>

It echoes hello out multiple times, so the query is providing results, but I can't seem to print them as $result. Any ideas?

Thanks for your time


texts: How can I display the time passed since a comment was created instead of the creation date?

texts:
how to personalize my comments ?

I want to display since when the comment was created instead of the date.
I want to display the comment ID with the link "permalink".

Can you help me ? Thank you

comment--field-article-commentaire.html.twig :

          {{ drupal_entity('user', comment.uid.target_id, 'comment') }}

            {{ permalink }}

            {{ author }}

            le {{ created }}

      {{ content.field_article_commentaire }}

        {{ content.flag_report_comment }}

        {{ content.links }}

Here is the current view of my comments :

https://ibb.co/QF051yV

I would like to display the date like this :

https://ibb.co/QCQbmG2


texts: Pathauto deactivate when I use node_save($node)

texts:
I'm trying to save a node code wise (like I've done a dozen times before), but for some reason, my custom URL given with the Pathauto module, disappears... The Generate automatic URL alias checkbox is checked and Drupal ignores my custom URL...

I've tried to give a custom URL with the URL-alias like:

$path = 'events/blablabla';
$node->path = array('alias' => $path);
node_save($node);

But that didn't work out either. So I'm wondering what do I do wrong. As far as I can see, there seems to be a bug in the module, but I have no clue how to solve this.


texts:
In Drupal 7 this was possible.

$link = array(
  '#type'  => 'link',
  '#title' => t('My Title'),
  '#href'  => 'node/1',
);
drupal_render($link);

But I've tried this with Drupal 8, and it does not output anything.

$link = array(
  '#type' => 'link',
  '#title' => t('test'),
  '#url' => 'node/1',
);
drupal_render($link);

Is there a way I can render a link without having to call the Link plugin directly, or create my own theme function?

I'm theming a field group formatter, which must output a render array.
The use of drupal_render() is deprecated and should not be called directly; I'm using it here to make my example clearer.


texts: How to I get an extra field for a user profile when using EntityFieldQuery()

texts:
I'm currently using something like this:

$users = new EntityFieldQuery();
        $users->entityCondition('entity_type', 'user')
        ->propertyCondition('status', 1);
$result = $users->execute();

Which is great, but it returns a list of 1000 ids. How do I get an extra field with this, without loading 100 user profiles (which would be quite time consuming). So for example I need to get the profile field - field_profile_company

I tried user user_load_multiple($result['user']);

Thanks.


texts: Is it possible to add a validation plugin to a config entity?

texts:
I have a configuration entity that I want to add custom validation to. I tried creating a Validation Plugin (as described here: https://www.drupalwatchdog.com/volume-5/issue-2/introducing-drupal-8s-entity-validation-api), which I've previously created successfully for a content entity.

It doesn't seem to be working for my config entity though. I'm not sure if it's because I've made a mistake somewhere, or if it's just not possible add a validation plugin to a config entity.

Can someone confirm one way or the other?


texts: I have created one menu for all languages and set the items as neutral and added the language translations. But when I add translations, only the title field is working and it's not working with others field.


texts: How to implement georeferencing in Drupal?

texts:
I must make a website with geo-referenced content. And I would like to add POI and the possibility to download this POI for GPX, KML\KMZ (Google Earth), etc.

Any tips or ideas to implement this somehow?

PS: if the above is not clear enough, have a look at this or this (the idea is building a website with such contents).


texts:
anyone know how to create a URL alias and not redirect the user? I have a node with its alias set to /sign-up, but I also want it accessible via /caregiver/sign-up. I created a URL alias, but it seems to just do a redirect to /sign-up.

I checked the current redirects list and the only redirect for sign-up I am seeing as for an old page that redirects from /activate to /sign-up


texts: Disclaimer will not show up on first launch of site

texts:
Basically, all I want is a disclaimer/splash page to where it verifies youre 21 (just by clicking yes or no) before accessing the home page. I have the most upgraded versions of jQuery, Colorbox, Libraries, and Disclaimer. Disclaimer settings appear to be fine and should work, however the disclaimer does not show at all and only my home page shows, even in a private cookie free window. Since this did not work, I've tried adding

scripts[] =  js/custom.js

into the .info file in my theme folder, and creating a folder with a custom.js file with the line

( function ($) { $('p').css('color', 'red'); } (jQuery));

which did not work either.  Any other modules that are stable and could help me out or any other advice is greatly appreciated.  Thanks


texts: Why is the --uri option needed to return absolute URLs?

texts:
I want to execute a View and export the JSON file to the files directory. I am using Views Data Export and VDE drush add-on modules. My view has a file/PDF field and I want to provide a direct link to the PDF file. So I added a Views relation for the field and a file URI formatter field. When I go to see the output the View creates at the Path. The URL is an absolute link directly to the PDF file. The URL includes the domain name when viewing it on development or production instances. And this is what I want. This is the correct URL path in the JSON:

href=\u0022http:\/\/mysite.com\/files\/Allergens.pdf

But when I use this Drush command below provided by views_data_export or vde_drush

drush vde myview myviewid myfile.json

the domain name is stripped out like this:

href=\u0022http:\/\/default\/files\/Allergens.pdf

Why is this happening only when using the Drush command? I found I can fix it by adding this at the end of the command

--uri=mysite.com

So my new drush command looks like this:

drush vde myview myviewid myfile.json --uri=mysite.com

But doing this will hardcode the domain name into the URL. I want the URL to work on development, production and on my local. Thank you for any help you can provide.


texts:
The error that I am getting is as follows

  Strict warning: Only variables should be passed by reference in include() (line 73 of /Applications/MAMP/htdocs/.../sites/all/themes/bootstrap/templates/page.tpl.php).

The code producing this error is

<?php
$path = drupal_get_path_alias($_GET['q']);
$block = block_load('block','2');
if ($path == 'home') {
  print render(_block_get_renderable_array(_block_render_blocks(array($block))));
}
?>

I don't know why this error is coming up because the code is working perfectly.

Could anyone Helo me please?


texts: How to enable / disable a module in settings.local.php

texts:
I'm using a settings.local.php for my local development environment. This is a Drupal 7 site.

I've seen a few references to this via google search, but none of the examples are working for me. I don't want to install a module to make this work if it is possible to accomplish the same result by adding a couple lines to the settings.local.php file.

I use this file all the time for a number of sites so I know it is being read properly. I've also used it to set variables (file_temporary_path, for example) and that works too. It is just enabling / disabling modules I'm having trouble with.

Any thoughts / suggestions?


texts: Countdown timer on discount products pages

texts:
I have created discounts on products, with an end date.

How do I display a countdown timer on my product pages (as in the screenshot) ?

Thank you


texts: What happens to a node/menu item once it's been deleted?

texts: Once a node or menu item etc has been deleted, is there a way to restore it? Other than restoring the database?


texts: Can I display Media Videos in a single "media player" block

texts:
I have several youtube videos listed on a page. I am currently loading them as Media Fields. What I would like to do is declare a single block (or perhaps a region) where the videos play no matter which video I select. SO rather than displaying the URL to a video, or the video itself, I want to display a play button.

Is there a standard way of doing this with Media, or do I have to create my own Javascript to insert the video into a "video player" block