texts:
I am getting the following error on .../checkout/ID/order_information page after submitting payment details for Review.

  Exception: Serialization of 'Closure' is not allowed in serialize() (line 14 of core/lib/Drupal/Component/Serialization/PhpSerialize.php).

I have tried to catch the exception with a try/catch block, but it  always gives that fatal error, if I unchecked My billing information is the same as my shipping information checkbox in the Payment information form.

I am using my custom payment method module for payment. Where should I look in the code to find what is causing the fatal error?

__construct() method :-

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, PaymentTypeManager $payment_type_manager, PaymentMethodTypeManager $payment_method_type_manager, TimeInterface $time) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $payment_type_manager, $payment_method_type_manager, $time);

  if ($this->getMode() === 'test') {
    $url = "url given here";
  }
  else {
    $url = "url given here";
  }

  try {
    $this->soapClient = new SoapClient($url);
  }
  catch (SoapFault $e) {
    throw new PaymentGatewayException($e->getMessage());
  }
}


texts:
I'm trying to create a Parish website. I have a list of parish members with email ids and without email ids. I've imported the users with email addresses as users, and the rest as nodes. Members that belongs to same family shares a common family code, and when a user log in I want to have a view of all family members and their necessary details (i.e. address,phone no,etc).

But the problem I have is that some users are created using user import and some (people without email) are created as nodes.

So how can I display all the members with same family code in a single view? How to relate a user with another user/nodes.

Is it with contextual filters/relationships? I tried with it but couldn't get it.


texts: How to integrate Datatables in my Bootstrap theme (to make it match the look and feel of my site)?

texts:
I am developing an intranet portal using a custom made bootstrap 3 theme.

One of the views I created is a phonebook with 4 columns: Name, Department, Telephone, Email.

When I use table as the view format, I get a really nice bootstrap table, as shown here:

But when I use the views style Datatables (provided via the DataTables module I have installed), I get a table which is fully functional (i.e. paging, search, sorting, etc works perfectly). But the css is not bootstrap, as shown here:

Any suggestions?


texts:
I'm editing a template of the Seven theme in Drupal 7. I want to change something in the html.tpl.php file, but I can't find where it is located.

Where is it the html.tpl.php file used by the Seven theme? Does the Seven theme have a html.tpl.php file?


texts: How do i give other users permissions for modules?

texts:
I have the following question: How do I give other users permissions for modules?
Example: FAQ module.

Any and all help greatly appreciated.


texts: How can a view in DrupalGap, which is used by a custom module, NOT be cached but instead be called each and every time?

texts:
I am using a Local Task Menu as demonstrated in the docs to present one more tab named members next to View and Edit. This tab is showed only to group nodes and i have connected a custom view inside Drupal which fetches the members of this group. Works good. Fetches, displays and links the members in the appropriate page.
But the problem is that this view is called only the first time. In other words, if a user subscribes or unsubscribes from this group after the first call, then this change won't be updated and showed.
In Views Caching:None and Block caching:Do not cache but i think this is a matter of drupalgap menu cache.
Is there a way i can make this specific view not to be cached but instead be called every time the menu tab is clicked?


texts:
What I am looking to achieve is a menu that will list a select number of terms from a vocabulary as a menu.  These select number of terms must be human picked, not just most recent. If this menu is compatible with a responsive menu module, all the better.

I have tried creating a view of these terms (filtered by a bolean field) and using Menu Views module but these modules are not compatible as there is too much markup in a view output. This excessive markup interrupts menu functionality.  I could reduce the amount of HTML markup outputted, but this seams a bit excessive for something which should be simple.

How is the best way to achieve the desired results?


texts:
I've created a content type with some fields like link , address. And I did content-type node theming with name node--machine-name.tpl.php and all fields are printed by this code

<?php print render($content['content']); ?>

or individual fields like this

<?php print render($content['field_link_url']); ?>
<?php print render($content['body']); ?>

But I want to save the link field in a variable, which will be used in various ways.

I just want this field_link_url field to not be printed but to be stored in a variable

What I Tried

echo $link =  $field_link_url['und'][0]['value'];
echo $link = $content['field_link_url']['und'][0]['value'];

Apart from that I got the message with all the array fields with this

`drupal_set_message("<pre>". print_r($node,true) . "</pre>");`

which gave me this..

stdClass Object
(
[vid] => 51
[uid] => 1
[title] => Run Tests on the Cloud. No Software or Hardware Required!
[log] =>
[status] => 1
[comment] => 1
[promote] => 0
[sticky] => 0
[nid] => 51
[type] => landing_pages
[language] => und
[created] => 1392994690
[changed] => 1393072611
[tnid] => 0
[translate] => 0
[revision_timestamp] => 1393072611
[revision_uid] => 1
[body] => Array
    (
        [und] => Array
            (
                [0] => Array
                    (
                        [value] =>
                            No software or hardware to buy or maintain.
                        [summary] =>
                        [format] => full_html
                        [safe_value] =>
                            No software or hardware to buy or maintain.

                        [safe_summary] =>
                    )

            )

    )

[field_link_title] => Array
    (
        [und] => Array
            (
                [0] => Array
                    (
                        [value] => START A FREE TRAIL
                        [format] =>
                        [safe_value] => START A FREE TRAIL
                    )

            )

    )

[field_link_url] => Array
    (
        [und] => Array
            (
                [0] => Array
                    (
                        [value] => http://xyz.displaybox.in/why-xyz/easy-to-manage-your-tests
                        [format] =>
                        [safe_value] =>  http://xyz.displaybox.in/why-xyz/easy-to-manage-your-tests
                    )

            )

    )


texts: How can I apply different templates based on taxonomy hierarchy?

texts:
I'm new to Drupal and I don't have extensive knowledge so I'm hoping I can get this question answered.
I want the taxonomy pages of lower hierarchy to be displayed differently from the higher by applying a different tmeplate.
Is there a way in Drupal 8 to do this other than giving each term its own template?


texts:
Should Views (that are setup as a Page) be able to inherit breadcrumbs/block visibility settings? When I create a Views page, set a path, add it to the menu (then adjust it to be a sub-menu of another parent item), when I am on the actual Views page, it looses (in this case) any block settings that should be shown on this page. From the screen shot below, you can see the menu block disappear (as well as the LEAD logo on the lower left side). More odd than that, is whenever I set the View to be added to a menu (as I have done in the Views settings), it doesn't show up (which is why I had to add it to the menu manually). I've gotten it to work with another Views page (the menu link showing up), but the blocks still disappear.

Also, once you click on an individual node, they also loose any type of breadcrumb/block visibility (even though I've set the URL to be the correct breadcrumb /about/faculty-staff/directory/USER_ID). Any help would be greatly appreciated. Thanks!

Current setup:
Drupal 7.5
Views: 3.0-rc1
Menu Block: 2.2

Screenshot Explanation:

Directory page (Views page - blocks missing from this page)

Main Faculty & Staff page (parent page)

User Profile view

Views config

Menu list

Menu config


texts: Responsive Image Module not reducing the file size when resizing the browser (Drupal 8)

texts: I have an issue using Responsive Image Module for drupal 8 that I can't seem to solved or figure out. As shown in this screenshot the file size of the original image is 685kb. But once I started to resize to the first breakpoint which is around 1366px the file size jumps to 1023kb or 1mb. My expectations was the file size should be reduced to even smaller size. I tried the option Resize and setting different dimensions proportionally or even Scale. But I still get the same results


texts: commerce kickstart adding regions and render page

texts:
After installing commerce kickstart my base theme is Commerce Kickstart Theme 7.x-2.10 . I need to add a new region before "content" region. In my "commerce_kickstart_theme.info" file i added my region name as

regions[contentfull] = Contentfull.

In blocks i am able to see my region. But where to render/print the page. In which file in need to render/print. And which css i have to edit


texts:
Can't connect to DB while installing Drupal 8. DB is located on localhost acording to direct admin but i can get to DB only when using ip address  in advanced options of drupal installation otherwise i get: SQLSTATE[HY000] [2002] No such file or directory. With ip entered it says  following message: SQLSTATE[HY000] [1045] Access denied for user on server.......

I have tried different  users and db that i have created on server (granted all permissions). No luck.

I have no problem logging to that DB with that user using phpmyadmin.  What does it seem to be the problem ?


texts:
The contributed project
Field placeholder
lets one use HTML5 placeholder attribute.  The project page says:

  By default, this module integrates text, number and mail modules,
  but any other widget type can be added through
  hook_field_placeholder_info().

I've tested this with a “Text” field, and it works as advertised.

I want to add hook_field_placeholder_info() for the
Link module.

According to field_placeholder.api.php, this hook should return:

  An array whose keys are the widget names and whose value are the
  widget item where the placeholder will be attached.

So far I've tried this:

/**
 * Implements hook_field_placeholder_info().
 */
function mymodule_field_placeholder_info() {
  return array(
    'link_field' => 'value',
  );
}

This puts the widget for the placeholder settings on the admin page
where one manage the link file, but setting a placeholder value has no
effect when I create a new node with a link field.

I believe the problem is “value”.  According to the documentation,
it should be the “widget item where the placeholder will be attached”.

I am not sure what that is.  So far I've tried “value”, “link_field”,
 “link”,  and “url” (clearing the cache before testing each in
turn), but none of these work for the link field.

So: How to write hook_field_placeholder_info() for the link module?


texts:
I'm on Core 8.7.7
I have a content type: "events"
They have fields: "Date" and "Image"

Events get displayed in 2 lists:

Past events (a view) (just a block showing event entities) (> this is a field in the content type Events)
Related events (this is an entity reference field)

Both events listed in the Past events and Related events list have the same view type "Teaser with image" which crops and scales the image to a thumbnail.

Problem: Upon creating a new event, the "Related Events" list does not show the image next to the event, nor does it seem to generate the thumbnail.

Funny workaround (that puts the finger on the issue, most likely): If I set the date to a date in the past (to force the event to show up in the Past Events list), the thumbnail gets generated (and also shows up in the Related Events list)

Anyone an idea why this is happening ?
I was assuming that when Related Events get displayed, this triggers the "Teaser with image" view and the thumbnail gets created, but it doesn't.


texts:
While working on the SEO of a site, we noticed that, just for the homepage we have 5 redirects (301 and 302).

http://mydomain.be = 301 => https://mydomain.be (well, that one, OK)

https://mydomain.be = 301 => https://mydomain.be/en (EN is the default language)

https://mydomain.be/en = 302 => https://mydomain.be/en/node/42

https://mydomain.be/en/node/42 = 301 => https://mydomain.be/fr/the-clean-url (why does the language detection only appears here? )

https://mydomain.be/fr/the-clean-url = 301 => https://mydomain.be/fr (because this is the homepage)

That's quite a lot of redirect jus for one page... Is there any way to reduce  that?

Like don't go to the default language and directly go to the good language? Or don't redirect to the clean URL if this is juste the homepage?


texts: How can I get and format the node created date in field.html.twig?

texts: The date is being rendered from field.html.twig template from {{ item.content }} from "items" array. After Using a twig filter date {{ items.content|date("long") }} it only outputs current date not the date node was created. How could I achieve node submitted date instead of the current date.


texts: Fluch cache on all sites in multisite platform

texts:
Is there a way to clear cache on all sites in platform by using platform alias? For example, drush @platform_name cc all ? (its multisite setup via aegir).

The problem I am facing with is, when I run that command or the one with @sites, I get a message

  Could not find a Drupal settings.php file at sites/default/settings.php.

So, I then copied default.settings.php as settings.php (which is by default fully commented out) in sites/default, and then it says

  Drush was not able to start (bootstrap) the Drupal database.

Which is obvious, as default doesn't have database (Aegir creates all sites in platform as separately and never touches default).

I also tried to delete default folder but Drush is telling me it needs to have settings.php there (even after I cleared drush cache). Drush in question is 8.1.0.


texts: How to gather user opinions via a survey based on tagging?

texts:
I'm completely new to Drupal, and am hoping it can help me with this job without me having to do too much tweaking.

I'm looking to gather user opinions on different subjects, but would rather not do it with a regular questionnaire type survey. I'm looking for something which would allow users to select topics and simply tag them with whichever words they find appropriate.

Does anyone know of a feature like this?


texts:
In Drupal, we can get argument values using arg() function. drupal.org uses path alias. For example https://www.drupal.org/project/elysia_cron is actually https://www.drupal.org/node/274365, the node with ID equal to 274365.

How can I get the node ID of a project page from drupal.org?


texts: how to unset admin menu links programmatically?

texts:
how to unset admin menu links programmatically ?

I have created a module with this hook in it

function myModuleName_menu_link_alter(&$item)
{

//  dpm($item['link_path']);
     if($item['link_path']=="/admin/config/people")
    {
     $item=FALSE;
    }
}

the link path

  "/admin/config/people"

is listed with dpm.

how can i remove it from the admin menu?

I have also tried with this hook

  function my module_menu_alter(&$items) {

       // dpm($items['user/%user/cas']);
        unset($items['user/%user/cas']);
  }


texts: Turning on aggregration causes a SQL error

texts:
I would like to create a view to display the number of nodes (later I'd like to also sum some numeric fields, but let's not run before we can walk).

In my view, I've turned on aggregation (under advanced settings), set the display type to fields, and added the title field with an aggregation type of "COUNT". However, in the view preview I'm getting the following error:

  SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause: SELECT node_field_data.nid AS nid, COUNT(node_field_data.title) AS node_field_data_title FROM {node_field_data} node_field_data WHERE (( (node_field_data.status = :db_condition_placeholder_0) )) LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 )

What do I need to do to fix this error?


texts: I have 2 forms in drupal 7 and I want to connect these 2 form.. Means when I will fill first form with some values then this form should be submit with ajax.After submit new form should be show.


texts: How can I set up a Drupal rules action to play a specific sound?

texts: I would like set a sound alert as a Drupal rules action- for Drupal to play a specific sound file eg in audiofield. How can I do that?


texts: How ajax open a link of node in custom region?

texts:
Please help someone who knows how to deal with this. I'm not the first day trying to realize this. But unfortunately nothing sensible on the subject on the Internet is not found.

By default in drupal when you link (example, http://site.domain/node/7) to page content of material is loading on a full page.
I need to make so that when you click on link (example, http://site.domain/node/7) first is loading the front page and then over it ajax loading content of material (/node/7) in custom region. How it can be best implemented? I would be grateful for tips.
I create regions in theme and them work well.


texts: 403 Access Denied only on homepage as anonymous, but page displays for all users

texts: I have inherited a very old, oddly customized Drupal 6 website here http://thomascranelibrary.org/. I would like to create a static copy of the site and send it into retirement, but the 403 error is preventing me from running a wget against it. The landing page reports a 403 Forbidden error and the head title reports Access denied, but the page is still fully accessible. The error does not persist if I log in with an admin account; it only displays for anonymous users. I've verified all file permissions and checked the .htaccess file. I've even poured through individual block permissions and menu permissions. I rebuilt the site permissions using the Drupal rebuild button. I cannot figure out what is causing this problem on only the homepage. I also noticed the Site Search is not working, again, only on the homepage. I disabled the search on the homepage completely and flushed the cache, but the 403 prevailed, so I'm not convinced the two issues are related. Any help is appreciated. Even a way to circumvent the 403 and still create a static copy of the site would be great.


texts:
I have created a content type for slide show name as slider in which i have 3 fields

Image, Image Description, and Image Postion(left or right).
I added multiple images and text for this.

Now i want to show slide show according to postion set of each image.

if image is left then it shows to left and text shows to right. and vice versa.

Anybody have idea how to do this

Thanks


texts: How to show content type with only related taxonomy item?

texts:
I have a menu that is taxonomy like so:

A
subterm(A1)##
subterm(A2)##
subterm(A3)##

Suppose A is menu and I linked a taxonomy vocabulary to menu A.

And suppose that on content type X field taxonomy term type is A1.

How to show content type with only related taxonomy item
like for taxonomy menu subterm (A1) with content type X related to that term?


texts: Is there a means to pass some php.ini settings to the drush command?

texts:
Running drush -d status results in this error: Drush command terminated abnormally due to an unrecoverable error. The full output is add below.

  Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.12 sec, 7.41
  MB]
  [bootstrap] Initialized Drupal site default at sites/default [0.12
  sec, 7.41 MB]
  [notice] Cache HIT cid:
  5.7-commandfiles-2-c32acd775c18a90c5b41d0fc9accf5ab [0.13 sec, 7.41 MB]
  [debug] Drush bootstrap phase :
  _drush_bootstrap_drupal_configuration() [0.13 sec, 7.41 MB]                                                                       [bootstrap] Drush bootstrap phase : _drush_bootstrap_drupal_database()
  [0.16 sec, 9.16 MB]
  [bootstrap] Successfully connected to the Drupal database. [0.16 sec,
  9.16 MB]                                                                                [bootstrap] Drush bootstrap phase : _drush_bootstrap_drupal_full()
  [0.17 sec, 9.16 MB]
  [bootstrap] Undefined index: sitename domain.module:2922 [1.24 sec,
  31.05 MB]                                                                                [notice] Undefined index: path domain.module:2923 [1.24 sec, 31.05 MB]
  [notice] Drush command terminated abnormally due to an unrecoverable
  error. [1.24 sec, 31.06 MB]
  [error]

Is there a way to configure a separate php.ini for drush in the .drushrc file or in settings.php, or pass some settings on the drush invocation?


texts: Easy way to add EU cookie notification to multiple Drupal websites?

texts: I have 20+ Drupal sites that I have to add Cookie notifs to. Is there an easy/batch/automated way to do it?


texts: Have the '@domain.com' part of the email fixed

texts:
I'm using the email registration module so that users can log in using their email address. The users are all from the same company, so I want to know if there's a way to have the '@company.com' part of the email as fixed text, like those grayed-out input fields. Someone knows if it's possible?

EDIT:
I'm hoping to have something like this.


texts: How to create a who's online exposed filter for views?

texts: Is there a way to create an exposed filter that will show what users are currently online?


texts: How to move drupal site from remote server to localhost?

texts:
I have a drupal site running currently on bluehost.
The site is big and I want to test every thing I change on local host before doing it on production site.

Unfortunately, I can not move it to from the remote server to local host.

Can someone give me the basic steps needed to move site from remote server to my local host (aquia dev desktop)?


texts:
Tried if someone has already faced or tried for this but I could not find any forum discussion around this.

Within Drupal views I am trying to add date filter based on a CCK date field. I am trying to add date filter within views like:

Past 7 days
Past one month
Past 3 months
Past 6 months
Past one year

I don't see any modules to achieve this neither any discussion around this


texts: How can I add text into ckeditor textarea in drupal 7?

texts: I'm using ckeditor-7.2 version. How can I set the values to my ckeditor text area from out side.


texts:
I'm attempting to customize the search form block. I'd like to be able to change the search submit button, by either changing the text, or turning it into an icon and other various changes.

I assumed I'd be able to make these changes within a template, but the default block--search-form-block.html.twig only contains

{%
  set classes = [
    'block',
    'block-search',
    'container-inline',
  ]
%}
<div{{ attributes.addClass(classes) }}>
  {{ title_prefix }}
  {% if label %}
    <h2{{ title_attributes }}>{{ label }}</h2>
  {% endif %}
  {{ title_suffix }}
  {% block content %}
    {{ content }}
  {% endblock %}
</div>

I don't see anyway I can change anything such as the submit text. Is there any way to make direct changes to the search form block?


texts: Exposed Filters in Entity Type Reference

texts:
I have used and entity reference field in my content type Showrooms. The field references to another content type Cars.

Cars has a category field attached to it such as audi, mercedes, bmw etc. Each car has once category only. Now what i want is that the user can filter the cars on category. I have used a reference field, but it lists all the cars. I want the user to be able to filter it.

Should work some thing like this, the user first chooses the category and then from the other drop down should choose a car and that car should be referenced.


texts: CPU spikes enabling / disabling modules when site is under load

texts:
We are in the process of migrating our website to Drupal 7 and we had a failed launch this past week. We performed load testing and were certain that our server was going to work just fine with our current load, unfortunately we did not perform load testing with logged-in users (we use a 3rd party gateway login system and it was almost impossible to accomplish a load test this way).
Long story short - logged in users overloaded our site and the server crashed.

So we've gone back to the drawing board, implemented APC and Memcache and we believe we have the problem fixed. The CPU no longer maxes out when under an expected load.

However, we now have a new issue that is a critical showstopper if we cannot find a fix for it.

While the server is under load from users, if an administrator attempts to enable or disable a module, ANY MODULE, (and sometimes even if we attempt to VIEW the modules page), the CPU will max out and the server will then eventually crash. The only option at that point is to restart the httpd service, which of course disrupts all user traffic.

When operating normally, CPU usage is at about 20 - 30%. When you attempt to enable or disable a module, the server IMMEDIATELY pegs the CPU at 100% and becomes nearly unresponsive from the browser and command line. Our normal page load times are 400ms, and they skyrocket to over a minute until the server crashes.

With no user load, the server operates as expected, though the action of enabling / disabling a module does spike the CPU for a short period of time. I have checked the sql slow query log and haven't found anything enlightening there. HTTPD is not spitting out any errors either.

Server has 2 CPU, 16GB memory and is dedicated to running this site alone; surely it isn't under powered.

What could possibly be causing this problem?


texts: Views PHP: how to get the `end-date` value within `Global(PHP)`?

texts:
I am rewriting the output a view block with a Global(PHP) field from the module Views PHP, and one of the fields I am rewriting is a Date field.

The value for the field is : 2015 - 08:30 to 09:30

I am looping through the fields and simply printing them to see the output:

foreach ($data->field_field_item_timespot as $timeEntry) {
  $time = $timeEntry['raw']['value'];
  print $time;
}

This is the output: 2015-01-01 08:30:00

The issue that I am having is that it is only printing the start-date of the field, when I need both start-date & end-date. I am specifying the Date field to display start and end date values, and it does in the view, but not inside the Global(PHP).

Any ideas how to get the end-date value within Global(PHP)?


texts:
I have a form that I've added a bit of extra validation using jQuery to

$('#webform-client-form-27').on('submit', function(){
if ($('#edit-submitted-email-address').val() != $('#edit-submitted-confirm-  email-address').val()) {
  $('#edit-submitted-email-address').addClass('error');
  $('#edit-submitted-confirm-email-address').addClass('error');

  return false;
}
else{
  $('#edit-submitted-email-address').removeClass('error');
  $('#edit-submitted-confirm-email-address').removeClass('error')

  return true;

}

});

The problem I'm having is that instead of validating the whole form I'm simply returning false and stopping the whole process, is there a jQuery way that will get drupal to run it's validation checks on the other fields, so as to allow for the standard error message(s) to appear in the event that the other conditions aren't met (the other fields are just required) and add to said error message that, my custom validated field(s), don't match either?


texts: Adding CSS and JS to form with attachments

texts:
I need to add some external and local CSS and JavaScript files to a form, but I can't seem to find the right way to do this.  Do I simply add the paths and URLs for the JS and CSS files?

I assume $form['#attached']['css'][] and $form['#attached']['js'][] are the correct places to do this, so they get reloaded on form rebuilds.  I seem to be missing something.


texts:
On the front page, i'd like the views to output taxonomy differently than i would on a term page.

I know i could modify output using a tpl file indicated by devel_themer; but i'm not certain how one would contextually change it.

How would i go about doing so with a preprocess function?
Is it even possible?


texts: How can I render a view in different languages during queue process, using PHP?

texts:
I am putting views into emails using a Drupal 7 queue of user ids.

In the queue, I load the view and attempt to render it after switching $GLOBALS['language'] to the user's language, and then back.

However, only the first view is rendered with the correct language.

The rest are all English.

_switch_language($language);
$view = views_get_view($view_name, TRUE);

if (!is_object($view)) {
  _revert_language();
  return FALSE;
}

if (!empty($display_id)) {
  $view->set_display($display_id);
}

_impersonate_user($account);

$view->pre_execute();
$view->hide_admin_links = TRUE;
$output = $view->display_handler->execute();
$view->post_execute();

_revert_user();
_revert_language();

Language switching function:

function _switch_language($new_language = NULL) {
  global $language;
  $language_original = &drupal_static(__FUNCTION__);

  if (!isset($new_language)) {
    if (isset($language_original) && (!empty($language_original))) {
      $language = array_pop($language_original);
    }
  }
  else {
    $language_original[] = $language;
    if (is_string($new_language)) {
      $languages = language_list();
      if (isset($languages[$new_language])) {
        $language = $languages[$new_language];
      }
    }
  }

  return $language;
}

The user switching function is similar, but calls drupal_save_session() twice to disable and re-enable session saving.

Any ideas? Thanks. :-)


texts: Dompdf returns PDF on Controller function but not on Submit Form function

texts:
I'm using Drupal's Form api to create a form which returns some values inside a PDF document based on some selected inputs. I'm importing the form like so:

public function content(){
    $form = \Drupal::formBuilder()->getForm('Drupal\custom_module_name\Form\ContributeForm');
    ...
    ... and so on

In my ContributeForm::submitForm I have this code:

public function submitForm(array &$form, FormStateInterface $form_state)
{
    $dompdf = new Dompdf();
    $dompdf->loadHtml('
hello world
');
    $dompdf->setPaper('A4');
    $dompdf->render();
    $dompdf->stream("example.pdf", array("Attachment"=>0));
    if ($dompdf){
        drupal_set_message("DOMPDF");
    }
    foreach($form_state->getValues() as $key => $value){
        drupal_set_message($key . ': ' . $value);
    }

and I don't get a pdf doc on the reloading of the page, though I do get the contents selected in the form returned to me in the drupal_set_message call.

Now to sanity check, I created a dummy module with only a controller (no form import) and this one DOES return the PDF with the content inside ::loadHtml:

public function content(){

    $domp = new Dompdf();
    $domp->loadHtml('
Hi
');
    $domp->setPaper('A4');
    $domp->render();
    $domp->stream('example.pdf');

    return array(
        //'#type' => 'markup',
        '#markup' => $this->t('Hello World yall'),
    );

}

Am I missing something on the form return? Am I adding an unnecessary layer of complications by importing the form into the controller, and should I just have the form load to it's own url?


texts: What file permissions and ownerships are appropriate for the files directory and subdirectories?

texts:
Possible Duplicate:
  What are the recommended directory permissions?

I've scoured the net, and it seems that everyone has different methods of doing this and I just want to get a quick straight answer if possible. So i'm on Centos with apache installed.

I know the files folder has to be 777, but 777 is insecure as anyone can write to it, but isn't that what we need since anonymous users have to write to it when they upload to the server like images or what not? And not to forget drupal throws an error if its not 777.

Also if my user for that domain is foo, then the ownership of files and all its items inside would be foo:foo  correct? But im reading it should be foo:www-data ? so which one is it?


texts:
How do I change the text of a link in Views?

Under 'Fields' I have Content:Title (the default)...and that's what I want. It links to the piece of content with the link being the Title of that document. But I want to change the link text to something else.

I tried clicking that field. It opens up a dialog. Under 'Rewrite Results' I selected 'Override the output of this field with custom text' and put in my custom text. But now instead of it being a link it's just static text. That's useless.

Replacement patterns don't have any links listed just {{title}} and {{ title__value }} == Raw value

'Link to this content' is still checked at the top btw.


texts: I have a custom content type with a image field and several other fields, how do I make the other fields appear next to or inline with the image?


texts: how to add html elements inside block and get data when saving

texts:
i want to add few html elements call first name and last name,company name in top of user/register page and save that data when user click create account button..,how can i achieve that,i add html elements  in block as normal html tags like
but dont't kow how to get data...thanks


texts: Delete a field from the database manually

texts:
I installed a module that left a ghost field that isn't tied to any entity bundle :(

How would I go about safely and thoroughly deleting this field from the database?

I have to delete this field to uninstall the module. I have attempted to run cron and clear cache to see if that would remove the field (it does not).

MYSQL command: show tables like '%<string in field>%'; only produces one result (the field I want to delete). Do I just drop that table?

I am using Drush 9.x, so unfortunately it looks like drush field-delete is not available. Is there a way to do this with Drush 9 or Drupal Console?

Thanks in advance for your help!


texts:
I want to hook the Drupal advance search form for add more filter criteria,

I want to add the below criteria
1) Search By Post Date
2) Search Between Post Date
3) Search by last day, last 7 days

I applied the hook Mymodule_search_form_alter(&$form, $form_state) {} to add the fields,

Please You suggest me Guys that how can i alter the search query, i am looking for this by last 2 days, but nothing found

This is the link that i got only

https://stackoverflow.com/questions/8575289/extending-drupal-7-search

But that not works,

Any suggestions Please...!!


texts: Views contextually filtered by terms in paragraphs

texts:
TL;DR, Below are the structure of content types, paragraph types and taxonomy in my site.

Taxonomy vocabulary - Category

Terms - Sports, Politics, Business

Paragraph type - Multi Article

Fields -

Category (term reference to Category vocabulary)

Content types - Landing page , Article

Landing page (fields) -

Multi category (Paragraph field referring to Multi Article paragraph type)[unlimited]

Article (fields) -

Category term (term reference field to Category vocabulary) [unlimited]

Sample content example -

Landingpage A paragraph field has Sports,Politics

Landingpage B paragraph field has Politics

Landingpage C paragraph field has Business,Sports

Article A is tagged with Business

Article B is tagged with Sports,Business

Article C is tagged with Politics,Sports

Desired output -

Landingpage A detail page should be showing something like -

Sports  [based on paragraph field]

Article B  [based on term reference]
Article C  [based on term reference]

Politics

Article C  [based on term reference]

Landingpage B detail page should be showing something like -

Politics  [based on paragraph field]

Article C  [based on term reference]

Landingpage C detail page should be showing something like -

Business . [based on paragraph field]

Article B  [based on term reference]

Sports  [based on paragraph field]

Article B  [based on term reference]
Article C  [based on term reference]

Can this be achieved with views and contextual filters ?

Question in detail -
Forgive me for a lengthy question.

I have a field in the content type - Landing Page, which refers to a Paragraph type.

The paragraph type intern has a term reference field.

When I edit/ create a Landing page content, the desired term names are selected and saved (it can be any number of terms and it doesn't mean that this landing page is tagged to these terms. This is done just to categorise the result while rendering).

I also have another content type - Article which are actually tagged to some terms (both the above paragraph term reference and Article term reference are of same vocabulary)

Now, when any of the landing page content is rendered, I would like to show the latest 5 (or any number) Article contents tagged with each term that was added to the paragraph field which was selected from the paragraph field earlier.

The idea is to make the view result dynamic based on the terms added in the paragraph field of the content. In other words, the view result should vary on every node detail page.

Is there a way to achieve this with the help of views ? My final hope if I don't find a solution is to programatically fetch the latest contents under each term and display them.
Would like to know if a better more elegant way is there with views.

Note - The reason why Paragraph is chosen is due to the flexibility it provides with rearranging the terms etc.

Would be great if any reference or examples are provided if my approach is right.
Thanks.


texts: How can I track how embedded media is used across my site?

texts:
My site uses the core Media module, Entity Embed, and LinkIt to reference media and other entities in various ways.

I want to keep track of which media is embedded on which nodes.

I tried adding an entity reference field to media on my content types, but this means that I have to add the media twice: to the field where I actually embed the media and to the entity reference field to track it.

Is there a better way?


texts: Display the value of a field list in views

texts:
suppose we have this field list:

Status
  1 => foo
  2 => bar
  3 => foo_bar

in the views page I want to display

Status
------
foo
bar
foo_bar

but now it give me:

Status
------
1
2
3


texts:
I am working on a Drupal 7 Based Web Application Development with a core server and multiple client web sites.

The core server will be exposing APIs which will be called from the multiple web sites. The core server will also be the OpenID authentication provider and multiple web sites will use this OpenID.

If a user loges in to the core then the user should be able to use any of these multiple web site with the same authentication.

For this purpose I have decided to use the OAuth2 Server and OpenID Connect modules based. I could not find appropriate tutorial or example even after days of searching the web.

Thus I have the following queries. I would be thankful if the commerce guys or any one who know how to work with these two modules could help me.

On the basis of my search and initial implementation I found that one OpenID Connect client will have one authentication Token. But for me each individual login user will have different credential decided by the core server. How can I send this individual credential to the client.
Once the user loges using this OpenID then he/she should be able to access the APIs form any of the client without further login.
How to transfer the Token that is received by the client in each of the successive calls to the server.
Proper way of using OpenID connect and OAuth2 Server for distributed web application and OpenID concept.

I would be grateful, if I could be directed in the right and correct way of working with this concept.


texts:
I am trying to override the 'link_field' theme function in the Link module. I've put this function in my template.php of my active theme and have cleared the cache, but its not overriding. What am I doing wrong?

 function tma_corp_link_field($vars) {
  dpm($vars);
  drupal_add_css(drupal_get_path('module', 'link') . '/link.css');
  $element = $vars['element'];
  // Prefix single value link fields with the name of the field.
  if (empty($element['#field']['multiple'])) {
    if (isset($element['url']) && !isset($element['title'])) {
      $element['url']['#title_display'] = 'invisible';
    }
  }

  $output = '';
  $output .= '
';
  if (isset($element['title'])) {
    $output .= '
' .      drupal_render($element['title']) . '
';
  }
  $output .= '
' . drupal_render($element['url']) . '
';
  $output .= '
';
  if (!empty($element['attributes']['target'])) {
    $output .= '
' . drupal_render($element['attributes']['target']) . '
';
  }
  if (!empty($element['attributes']['title'])) {
   $output .= '
' . drupal_render($element['attributes']['title']) . '
';
  }
  if (!empty($element['attributes']['class'])) {
   $output .= '
' . drupal_render($element['attributes']['class']) . '
';
  }
  dpm($element);
  return $output;
 }


texts:
I installed the tinymce wysiwyg editor and it converts hyperlinks into [url= tags.
How do I convert this to html i.e. <a href="


texts: How to see #default_values in multiselect form

texts:
I've done a custom form that is a multiselect type form. When I edit the node, the options that were previously selected are not shown in the selected options part.

This is the code that I've done:

 foreach ($node->field_tem_tica[LANGUAGE_NONE] as $delta => $value) {
    $term2 = taxonomy_term_load($value['tid']);
 }

  $query2 = "SELECT name, tid FROM taxonomy_term_data WHERE vid=4 AND language = '$language_url';";
  $result = db_query($query2);
  foreach ($result as $row2) {
     $options3[$row2->tid] = t($row2->name);
  }

  $form['group_config']['tematicas'] = array(
     '#type' => 'multiselect',
     '#title' => t('Temáticas'),
     '#options' => $options3,
     '#required' => TRUE,
     '#multiple'=>TRUE,
     '#default_value'=> $term2,
     '#prefix' => '

',
     '#suffix' => '
',
     '#size'=>20,
  );

Does anybody see a mistake? Is there any way to see the default_values?

Thank you.


texts: How to re-run javascript core code for content loaded with jQuery's ajax()?

texts:
I'm trying to AJAXify page loads using .load()/.get() methods and the main problem I'm currently stuck with is that the loaded content isn't being processed by the relevant javascript code.

I've tried upgrading to jQuery 1.7 and addind this scary workaround: https://stackoverflow.com/questions/11442723/how-to-convert-bind-pass-through-to-on-to-delegate-like-right-inside-jqu , but the problem is not in the bind() calls AFAIU.

Something with Drupal.behaviors?

The simplest way to reproduce the issue is to take a page's #content.innerHTML that is normally being processed by JS (/admin/structure/block) and replace the #content HTML with it. This way the resulting HTML is the same but [for me] it's not processed by JS functions.


texts: How to make JS Async and eliminate unnecessary JS?

texts:
I've been told this could be done with the Magic module but I couldn't find documentation\videos\readme anywhere for it so I ask how to do these specific things with it in my Drupal 7 site:

How to make JS Async?
How to eliminate unnecessary JS?

I need this for trying to take care the known Page spped insights advice "Eliminate render blocking JS above the fold content". Thanks.

Update: This could be done with AdvAgg module easily, see the following answer by Mikeytown2:


texts: Language switcher shows wrong language on front page after detection by browser settings

texts:
Content and interface are displayed correctly but the language switcher shows the default language when the language negotiation is set to these options:

URL (language prefix)
Browser
Standard

Means: Browser detection leads to displaying content in german for example, but the language switcher itself shows still "english" as selected. Even when clicking on it the language still is german.

This only happens on the front page, on other paths the prefix takes effect and the switcher shows the correct, selected language.

Any ideas how to fix this?
Thanks in advance!

EDIT: The frontpage is designed with translated blocks only, there's no node to point the multilingual variable to.
For multilingual we have following modules installed and used:
- Internationalization (i18n)
- Block languages (i18_block)
- Multilingual content (i18n_node)
- String translation (i18n_string)

For each language there are several "standalone" blocks, meaning not translated via the block translation option. Visibility is set through these settings:


texts: How do I get product variations in a preprocess function?

texts:
I'm trying to do something like this.
function clientname_preprocess_commerce_product(&$variables) {
  $product = $variables['elements']['#commerce_product'];
  // Get the product variations and store them in $variations.
  if (!empty($variations)) {
    /** @var \Drupal\commerce_product\Entity\ProductVariationInterface $variation */
    $variation = reset($variations);
    /** @var \Drupal\commerce_product\ProductVariationFieldRendererInterface $variation_renderer */
    $variation_renderer = \Drupal::service('commerce_product.variation_field_renderer');
    // Override the variation list price with the price of the variation.
    $product['variation_list_price'] = $variation_renderer->renderField('list_price', $variation);
  }
}

I am not sure how to get the product variations in hook_preprocess_commerce_product().
What code should I use to get the product variations and store them in $variations?


texts: how to resolve ubercart checkout IE Issue?

texts:
I am using Drupal 6. While checking out with IE 7 or 8, users get stuck in a loop; when they click on

they are redirect to

When users click on the submit button, they are again redirected to the review order page, as in the first image.
When I searched on drupal.org, I found a "fix in Ubercart Webform Checkout Pane" module, but I am not using it.

It is working fine on Firefox and Google Chrome.

Do you have any suggestion?


texts: $scripts variable in drupal 6 adding unwanted script codes

texts:
From where does the $scripts variable in drupal gets generated? I am getting an unwanted code generated in the html code like this

 <script type="text/javascript" src="/js/js_01770598d5388f7cbcfe786a6df4ef2a.js"></script>

I want to remove that code, for that I need to know the details about $scripts varialble used in tpl file


texts:
I am trying to call a JavaScript function when I click on a button in a form. I have multiple buttons in a for loop and I have attached the library to all those buttons. (Not sure whether this is a correct way or not)
I also need to pass some values to the JavaScript function depending on the button pressed, which I am passing using drupalSettings.
The issue is for the first button the value is passed and I can print it. For the second button, it is not passed. I guess the JavaScript is not called for the second form element.

buildForm Code:

$levels = 2;
$level_labels_array = ['chapter', 'sloka'];
for ($l = 1; $l <= $levels; $l++) {
  $levelName = strtolower($level_labels_array[$l-1]);
  $textOnButton = '';
  for ($k = 1; $k <= $l; $k++) {
    $textOnButton = $textOnButton . '&gt;';
  }
  $label = $levelName . '_next_navigation';

  $wrapper = $levelName . '_wrapper';
  $form[$label] = [
    '#type' => 'html_tag',
    '#tag' => 'input',
    '#attributes' => [
      'type' => 'button',
      'value' => $this->t($textOnButton),
      'class' => 'button',
      'name' => $this->t($label),
    ],
    '#attached' => [
      'library' => [
        'heritage_ui/heritage_ui_library',
      ],
    ],
  ];
  $form[$label]['#attached']['drupalSettings']['nav'] = $label;
  $form[$label]['#attached']['drupalSettings']['navLevel'] = $levelName;
}

JavaScript function:

(function($, Drupal, drupalSettings) {
Drupal.behaviors.navigation_levels = {
  attach: function (context, settings) {
    var navLabel = drupalSettings.nav;
    var navLevel = drupalSettings.navLevel;
    console.log(navLevel);
    // Attach a click listener to the nav button.
    var navBtn = document.getElementsByName(navLabel);
    if (navBtn.length != 0) {
        for (i = 0; i < navBtn.length; i++) {
            navBtn[i].addEventListener('click', function() {
                console.log("entered");
                var navLevelElement = document.getElementsByName(navLevel);
                if(navLevelElement.length != 0) {
                    $(navLevelElement[0]).trigger('change');
                }
                // Do something!
                console.log('Nav button clicked!');
            }, false);
        }
    }
  }
};})(jQuery, Drupal, drupalSettings);

Question edited for better clarification


texts: Multiple facets are shown with Content fields with multiple words

texts:
I implemented filtering through facets and facing a very strange problem.

I have been trying a content type with a field for Region. Region contains options like North America, Latin America, Asia, etc. In my facets, it ends up looking like this (screenshot attached as well):

REGION:
america
asia
north
latin

What I am hoping is that it shows me the way I entered it in the system.

Why is it breaking at the spaces and turning "North America" into "North" and "America"?

The field type is "Text" though.


texts:
How would I center a Content-Image with the Views Module? I would edit the css, however each image is a different width/height. See image:

How would I center each images to the text in the Drupal Views module?


texts: How can I link css/js from main bootstrap theme to subtheme?

texts:
I'm kinda a newbie to web development and web coding languages. I recently installed Drupal 7.54 on localhost (xampp), then loaded it with Bootstrap 3.13 theme but when I come to creating a subtheme, It does not resemble the main theme though I've followed instructions here: https://www.gaslampmedia.com/tutorial-drupal-bootstrap-3-4-subtheme-with-less/

My subtheme looks like this:

Can anyone configure this? thanks


texts: How to translate a view and keep contextual filters?

texts:
I'm building a bilingual website (French/English). I created the "user biography" for me to display later in the view. The biography is translated.

The view is called in the page : biography.php?id_author=405 with a contextual filter (405 in this example). Now when we click to see the other language version, we are redirected to "biographie.php" (in french), but we lose the parameter.

How can i keep the parameter ?

Thanks


texts: Where to change default translation language for drupal 7 while using entity translation module?

texts: I'm doing some translations, but I'm not sure how to change the "original content" to english. I can't seem to find a setting to change it to english. Anyone knows where to go for this?


texts:
I am working on hook_theme_registry_alter. I have tried to dpm($theme_registry). But comment_admin_overview is missing, The version of drupal is 7. Any ideas??.

function hook_theme_registry_alter(&$theme_registry) {
  dpm($theme_registry);
  $theme_registry['comment_admin_overview']['function'] = 'theme_hook_comment_admin_overview';
}


texts: Unable to post message to wall on facebook using facebook rules module

texts:
I have following modules installed

FBOauth
Facebook Rules

I have installed its dependencies like Rules and Oauth library.

The settings implemented on the facebook app

Dashboard

TEST
This app is public and available to all users
App ID :
22321917809249
App Secret :
●●●●●●●●Show

In the below all the blurred value has been appropriately added.

Also in the status and review I have made following changes as shown in the image

In the facebook rules I have created a rule with following

Events
User logged in using Facebook connect.
User registered using Facebook connect, requires admin approval.
User registered using Facebook connect.

Action

Post an update on user's facebook wall.
Parameter: Message: Hello Facebook world!, Link to post: m2w.redcom.in

The api and secret key has been added on the facebook configuration settings page and I am able to retrieve the facebook details of the user on the  user details on the websites.
How can I post to the user's facebook wall using the above rules configuration?

All while facebook is logged in and i try to use the fconnect feature,
I get a message dialog box which has following text
"This does not let app post to the facebook"
How can I allow my app to post to the facebook. ??

Drupal Issue posted : https://www.drupal.org/node/2299375


texts: How to make a taxonomy term display a field

texts:
I set up a taxonomy vocabulary (College attended) to be a field in my profile 2 registration form.

When a new user registers, he selects one of the terms of the vocabulary (i.e colleges).

I would like to have the surname of the users (a field in the core registration form) who went to a particular college displayed when a term is selected.

Please how do I achieve this.
P.S.: Presently I get only the notice "There is currently no content classified with this term", when i select a term.

Thanks in advance.


texts:
For example, the URL http://example.com/user/20/edit/cocktail?destination=user%2F20 leads to a page with the form to add content.

I want to create an alias like bartender/add/cocktail, or
(if possible) bartender/profile/[current-loggedin-bartender-name], [current-loggedin-bartender-surname]/add/cocktail.

Is this possible? How can I do it?


texts: drush sql-dump with --gzip from remote to local machine

texts:
I can use drush sql-dump to get the production db from my remote server and save it to my local machine no problem using:

  drush @site-live sql-dump > /home/backups/my_db_backup.sql

but i want to enable the --gzip option to make the process faster which i've tried with

  drush @site-live sql-dump --gzip > /home/backups/my_db_backup.sql.gz

but i get this error from archive manager in Ubuntu:

  gzip: /home/backups/my_db_backup.sql.gz: not in gzip format

For starters...can i actually use --gzip with sql-dump?

UPDATE: the problem appears to be that "stdin: is not a tty" is being appended to the first line of the file whether it is a plain .sql or a .sql.gz file


texts:
I've read several custom module tutorials but none seem to show how to edit a record. My module does not use node but has a custom table. So, I think I ought to be able to drupal_get_form and populate the #value with the fields. But to set up the menu to get the parameter in the URL and my page callback is not working.

Looking around I found this answer and modeled the below after it but I get a default page instead of my expected form.

$items['redashboard/project/%/edit'] = array(
  'title' => (t('Edit project')),
  'page callback' => 'drupal_get_form',
  'page arguments' => array('re_dashboard_edit_project_form', 2),
  'access callback' => TRUE,
);

function re_dashboard_edit_project_form($form, $form_state, $projectid) {
  $project = pull_project($projectid);
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Research Project Name/Question'),
    '#value' => $project->projectName,
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Create',
  );
  return $form;
}

function pull_project($projectid) {
  $query = db_select('Projects', 'p');
  $query->fields('p', array('ProjectID', 'residentID', 'projectName', 'projectMentor', 'projectStatus', 'citation', 'lastUpdated'));
  $query->condition('ProjectID', $projectid);
  $result = $query->execute();
  return $result->fetch();
}

So, how should I set up a page to edit this record if not this way? Or to the point how should I set up the menu so that this callback gets rendered? thx, sam


texts: Create several form in a same module or function in Drupal 7

texts: I want to create several forms from the same page. And these form I am generating from a custom module. I have already generated the function my_module_form (), but I can only create a single form. How can I generate more forms?


texts: (Good or bad?) Calling a Function in Template File which returns a theme() Function value

texts:
I have a function which get some values from a Term, calculates something and at the end of my function, there is a statement like this:

return theme('foo', array('bar' => 1);

This function is in a self-written module. In the same module, I've got a template file.

Now my question: is it good or bad Practice to call the function which one I describe above in the template file? I know that I could calculate all this before calling the template file, but with my solution, the could would be more readable.

Thank you in avantage for inputs.


texts: I have installed the GTranslate module, and I am searching for how to use it. In the module page, the language selection drop-down box is there, but when I installed this module the drop-down list didn't appear. How do I use the GTranslate module?


texts: How to format user profile content to be printed on a printer?

texts: I'm building a recruiting website using the eRecruiter profile distribution which uses Profile2 and was wondering if there is defined solution to creating a formatted page specifically for printing in D7 so the resumes can easily be printed in a nice format.


texts: Language selection based on a domain\path hybrid

texts:
I have a site translated in 2 languages - English and Spanish.

The English site is on example.com, the Spanish site is on example-SPANISH.com, so I set the "language detection method" based on the domain.

Now, the english site has a slightly different content based on the exact location of the users, so I have created different languages like EN-US, EN-GB, EN-CA, etc...

I want to set this (sub)language based on a GET parameter, like this

example.com/?from=england -> sets language to EN_GB
example.com/?from=canada -> sets language to EN_CA

I could use the Session detection method as primary one, but I want to prevent (for duplicate content \ SEO reasons) the spanish site to return the english content if the ?from parameters is set.

In other words, this URL

example-SPANISH.com/?from=canada

mustn't set the language to EN_CA: it should remain ES_ES instead.

Any ideas on how to achieve this?

I was thinking about a function like this in a custom module:

function MYMODULE_boot() {

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

 $allowedLangs = array(

  'www.example.com' => array('en', 'us', 'ca'),
  'www.example-SPANISH.com' => array('es')

 );

 if( in_array($_GET['from'], $allowedLangs[$_SERVER['HTTP_HOST']]) )
  $_SESSION['from'] = $_GET['from'];

 }

}

The problem is that when the ?from param is set in the URL, whatever i set in _SESSION seems to get ignored.


texts:
I want to know which function is called for views auto submit function. I want to do this auto submit manually through PHP or jQuery, when some action is performed.

I mean Ajax auto submit without page refresh.


texts: How do I display all available field types?

texts:
I want generate an new form in a custom module via the generate:form command.

In this step, I must enter a field type.

How can I get all available field types?


texts: Use read-only database user to minimize security risks

texts:
I want to phase out an old, unmaintained Drupal 6 page. The website should still stay online, but should be read-only.
I want to change the database user so that it only has read privileges. I don't want the website to be exploitable due to any security issue in Drupal 6 or any of the modules.
Is it possible to give Drupal 6 a read-only database user? On which table is write access necessary?


texts:
I need to get the terms a node has. I found out that you can use this:

$result = field_view_field('node', $node, 'field_tags', array('default'));

But this prints a rendered list. I need the names, or tids.

How do I separate them?


texts: hello when I add a promotional code for an order, I must reload the page manually to see appear the discount. How to disable the ajax and page reloads automatically when a code is entered? thank you


texts: Remove every Javascript except own theme scripts

texts:
In my current Drupal 6 installation, a lot of Javascript scripts are being loaded (core scripts, jQuery, modules, etc).

I only have one script in my theme that I need, so I want to only include that file and get rid of everything else.

What's the best way to accomplish this?


texts: simplenews-newsletter-body.tpl.php won't be overridden

texts:
My newsletter is almost ready, where it not that the node title ends up in the sent testmail as well. So I figured if I would just override the simplenews-newsletter-body.tpl.php
I followed the guidelines from this page.

In my simplenews configuration I just checked just the generic content type that simplenews generated. In that same configuration page, I chose 'newsletter' as the taxonomy term attached to it. This makes the filename simplenews-newsletter-body--newsletter.tpl.php

The idea to just delete the following line from the copied file:

<?php print $title ?>

The tutorial I mentioned says to paste in into the custom theme folder directly. I was assuming not in the templates folder. I tried both though while flushing cashes at least twice after each try. Still getting the darn title in my test mail.

UPDATE: I discovered that the filename needs to be the term ID of the simplenews newsletter, being a number. I looked up the tid and changed the tpl filename accordingly - in my case making it simplenews-newsletter-body--110.tpl.php. Of course the needed flushing of cashes. Didn't help either.


texts: How can I bulk update the language for all content?

texts:
I have a site that has been duplicated from an english site and has been translated into Italian.

I installed Italian as a language and have set it as default. However, all of the nodes created in the cloned site are still set to "english".

How can I bulk update the language for all content, either programmatically or directly with SQL?


texts: Views with filter on "main" and "additional" taxonomy terms

texts:
My articles are organised in a taxonomy, where each article has multiple taxonomy terms. I now want to build views for my front page, where each view represents a part of the taxonomy.

However articles can have tags from multiple parts of the taxonomy, but here, each article should only appear in one view. Is there a simple way to somehow in the admin interface mark one taxonomy term as "main term", such that in the front page views, the article only shows up for the view which shows this "main term"?

What I have tried so far is to have two taxonomy fields for my article, one for "main term" and one for "additional terms". However when building the view with the filter "has taxonomy terms (with depth)", there seems to be no way of specifying that I only want it to look in the "main term" field. Is this approach viable and how would I build the view?


texts: Drupal 8: how to generate options based on Ajax callback

texts:
In Drupal 8, I want to generate options of second select-box based on Ajax call of first select-box. The result generate a third new select box but I don't need to generate a new one. I want to replace the options of the second select-box. Please see my codes below:

public function buildForm(array $form, FormStateInterface $form_state) {
$form['example_select'] = [
  '#type' => 'select',
  '#title' => $this->t('Select element'),
  'wrapper' => 'first',
  '#options' => [
    '1' => $this->t('One'),
    '2' => $this->t('Two'),
    '3' => $this->t('Three'),
    '4' => $this->t('From New York to Ger-ma-ny!'),
  ],
  '#ajax' => [
    'callback' => '::myAjaxCallback',
    'disable-refocus' => FALSE,
    'event' => 'change',
    'wrapper' => 'edit-output',
    'progress' => [
      'type' => 'throbber',
      'message' => $this->t('Verifying entry...'),
    ],
  ]
];

$form['example_select2'] = [
  '#type' => 'select',
  '#title' => $this->t('Select element'),
  '#prefix' => '
',
  '#suffix' => '
',
  '#options' => [
  ],
  '#ajax' => [
    'callback' => '::myAjaxCallback2',
    'disable-refocus' => FALSE,
    'event' => 'change',
    'wrapper' => 'edit-output',
    'progress' => [
      'type' => 'throbber',
      'message' => $this->t('Verifying entry...'),
    ],
  ]
];
return $form;
}

public function myAjaxCallback(array &$form, FormStateInterface $form_state) {
  if ($selectedValue = $form_state->getValue('example_select')) {
    $arr = array('1' => 'Nice way', '2' => 'Good way');
    $form['example_select2']['#options'] = $arr;
  }
  return $form['example_select2'];
}


texts: What's wrong in my rule for sending e-mails using VBO?

texts:
I am trying to send a mail to a set of users when a node is created, so I made a users view including VBO field and a rule for it. You can see the settings below. It's about D7.

But when the rule gets in action, no mails sent and the following messages appear in admin/reports/dblog:

Unable to evaluate loop.
Unable to get variable entitylistem, it is not defined.
Unable to evaluate action views_bulk_operations_action_load_list.
Unable to get a data value. Error: Invalid data value given. Be sure it matches the required data type and format. Value at user():

What is wrong?


texts: How can I embed an Editor just like those in StackExchange Q&A in Drupal 7?

texts:
I am new to Drupal.

I want to embed an editor in my content, body nodes so that I can do different editing when I add a new content. (i.e., bold , hyperlink, list) etc.

Is it possible to do that? Any module is available?


texts: Some basic questions about creating a webform handler from the module webform_example_handler

texts:
I'm "cutting my teeth" in Drupal 8 on the Webform module so these are going to be rather naive questions.

I need to programmatically fill a URL field in the form with an XML file that
I generate from the other data in the form and do it just before the submit
so that the form is complete. To do so I figured using a webform handler is
the way to go and I have been using webform_example_handler as my
template.

Now for my ridiculous naivety, just a few basic questions:

In webform_example_handler.schema.yml the first line is:
"webform.handler.example". Is this a standard Drupal construct of <webform>.<handler>.<my_module>, or
something specific that must be followed set by the webform module
or am I completely off base on how this is derived?

I would guess that for my
module the line would be: webform.handler.dis_doc_gen?

The "webform.webform.webform_example_handler.yml" file: could someone explain the parts? In my module would it be: webform.webform.dis_doc_gen.yml ?

Last: I have built my webform through the interface so I assume that I don't
need the file "webform.webform.webform_example_handler.yml" as that would
only be for creating a webform from a yml file upon installing the module as
far as I can tell. However, is there something in my webform that I need to
set so that it knows about my
".../dis_doc_gen/src/Plugin/WebformHandler/DISDocGenWebformHandler.php"
handler?

Could someone please tell me what key thing(s) I need to do to make that connection or is that all automatic as long as you clear the Plugin cache? (I just discovered that cache through the "Admin Toolbar" module).

I realize this could be done through one of the webform hooks but I would rather use a handler as part of getting familiar with Drupal 8 in general.


texts: Theme and Override Privatemsg messages/view/%thread

texts:
I've managed to embed all the other pages within Panels as per the D7 Panels/Privatemsg patch, and the only remaining page is the /messages/view/%thread pages. After scouring the Privatemsg API documentation and the internet, I still cannot figure out how to manually present this view or how to embed it in another location either with the API or with regular Drupal theme .tpl.php overrides.

I need to get a sidebar on the /messages/view/* pages, preferably using panels.

  Is there a function call to produce or print the entire thread list/reply form?
  Do I have to break the reply form apart from the thread list?
  After obtaining the thread list using `privatemsg_thread_load()`, is it possible to pass the data back into the overridden privatemsg-view.tpl.php file?

Any and all thoughts or hints are welcome... thanks guys.


texts: How to get taxonomy contextual filters working by name for users?

texts: I have users sorted by taxonomy. I created a page, added a field to a contextual filter and it works, but by ID only. I want user friendly paths, so I need it to work by name. All solutions I've seen was for nodes, where contextual filter is Taxonomy:. There is no Taxonomy: filters category for users, i need to use User: field_name and I can't get it to work.


texts:
I am trying to get quick edit to work in combination with my twig templates where i only print out specific fields like this:

{{content.field_teaser_overline}}

The rendered markup of the field looks like this

Overline

What i figured out for now is that it must look like the following to actually work

http://www.google.de

So the classes:

quickedit-candidate quickedit-editable

are missing.

Any idea what I am doing wrong?


texts: is there a way to know witch module is responsible to programmatically alter a view's query?

texts:
I have a view that diplays some orders with a filter by current user if he is owner of the order or not ..

If the current user is admin, i can see my orders with no problems.
If im logged in with another role the view is always empty althought im ordering products with that user.

I doubt about the view access, or some modules permission (for example if this role has the permission to view his own orders or if he has permission to view his own product ...) I checked these permissions carefully, but the view result still empty.

when I debug the query I get inside where clause an additional condition that's applyed only for non admin users :

  (AND 1 = 0)

as you know this condition returns always false, so that's why the result of the query is empty.

Is there a way to know from where is coming this condition when im logged in with a non admin role ?

Thanks in advance.


texts:
I got this error on a server I setup and was confused:

  Error: Call to undefined function Drupal\Component\Utility\imagecreate() in Drupal\Component\Utility\Random->image() (line 282 of /var/lib/jenkins/src/grls/docroot/core/lib/Drupal/Component/Utility/Random.php


texts: Does my Feature module have to explicitly define the body field in it's components?

texts: When a new content type is created in Drupal it is automatically given a title and body field. Now that I am defining my components for my feature to I have to select it as one of the components of the feature module?


texts: How to find and remove string in front of URL?

texts:
We have a url pattern of [node:menu-link:parents:join-path]/[node:title].

We are finding that it is resulting in the following urls and we wanted to see if we could use hook_pathauto_alias_alter to remove the undesired string. We are finding that when doing the preg_replace, that is removing all instances where the "/" is found. We just want to remove the string upto the first "/" character. Need assistance in figuring out why it is not working.

function mymodule_pathauto_alias_alter(&$alias, array &$context) {
       $patt = '.+(\/)';
       $replacement = '';
       preg_replace($patt, $replace);
}

Current results:

some-text/menu-linka/menu-linkb
some-text/menu-linka/menu-linkb/menu-linkc

Desired results:

menu-linka/menu-linkb
menu-linka/menu-linkb/menu-linkc


texts:
For PCI compliance reasons, I need to remove the name attribute from a form field.

I have tried:

(1)

$form['field']= array(
    '#name'=>'',
)

(2)

$form['field']= array(
    '#name'=>false,
)

3)

$form['field']= array(
    '#attributes' => array('name' => ''),
)

(4)

$form['field']= array(
    '#attributes' => array('name' => false),
)

None of the above work (each of the above produce a field with the name attribute present, just empty. I need it removed altogether).

I haven't managed to achive it with the hook_form_alter hook either.

Any ideas?

Thanks


texts: Why don't I get any CSS after deploying my Drupal site?

texts:
I have deployed my Drupal 8 website, but I don't get any CSS on it.

I deployed it on mydomain.com/newdrupal, maybe this needs extra configuring somewhere?

When I check my logs, I have about 20 messages with this warning:

  Warning: file_put_contents(temporary://filedGJSiQ): failed to open
  stream: "Drupal\Core\StreamWrapper\TemporaryStream::stream_open" call
  failed in file_unmanaged_save_data() (line 888 of
  /var/www/stijnAerts/notify/core/includes/file.inc).

I also have this in my console:

  Resource interpreted as Stylesheet but transferred with MIME type
  text/html: "*****/notify/?o66rbh".

Note: This is a base theme, so no custom theme.


texts: What's the easiest way to create CRUD interface for custom entities?

texts:
What is the fastest way to create admin UI for new entity type? Like at content types. I just need basic list/add/edit/delete actions.

One would think this comes with entity api?

I have found a lot of solutions but all of them included a lot of custom code, which is prone to errors.

is DrupalDefaultUIEntityController the answer? how can one use it?


texts: How to use checkbox under description of any webform field?

texts:
I am using webform module where I have a text field named Mobile Phone Number.

I wanted to use checkbox under the text field as shown below:

The content can be written in the description of that text field. But how do I use the checkbox as I shown above.

Note: I tried to enter the html form tags in the description but didn't help.


texts: How to link a Radio Button choice to a taxonomy term or tag

texts: Using drupal 7, when my users select a certain choice out of 2 radio buttons, i want whichever one they choose to also have a tag or taxonomy term applied to it. So if they chose "never" then that node will also have the tag "never"


texts: Generate image styles on upload or in some other memory-conscious fashion?

texts:
I have a D7 site that is hovering around 55mb on devel_shutdown(); for most uncached pages and has a lot of migrated content that has images linked to various styles around the site, many of which are currently ungenerated.

If I bump PHP memory usage allowance to 130mb (I'm on Dreamhost shared hosting, so 150mb is the top end for any individual process), images generate fine. If I leave it at the unmodified 90mb, image generation starts to fail.

It seems there are two options:

a. Get more RAM, through a virtual private server or some other hosting-related fix.

b. At my coworker's suggestion, find some fiddly way of getting images to generate ahead of a user running into them.

In terms of option B, we're using, gasp!, WordPress for an inspiration, which seems to handle images more intelligently in low-memory situations (Heresy! Madness! Spartaaaaaa!).

To explain — after the page has loaded and PHP has released memory, thumbnails are generated as they are uploaded, noticeable when WordPress says "Crunching" during the upload process. This way, there isn't any delay when a user then views them, and there's no worry that the combined memory load of the CMS and the image library will cause one of them to fail.

Is this at all possible in Drupal? Would a module like Cache Warmer do this if set up in a cron job? Is there even any benefit to doing things this way?


texts: How do I alter the page title h1 tag from a module?

texts:
I miss hook_page_alter()!

I want to create a module that adds some configurable markup to page titles (the H1 tag on the HTML document) for full node pageviews of certain, configurable content types. But according to this change record:

  You no longer can change $page['content'] (or, generally speaking, $page[$region_name]) into something completely different.

I know I can override twig templates to achieve this, but can I do that without creating a theme? I'd like this to be a reusable module.


texts:
I am using commerce_userpoints which allows the use of credit to discount the amount at checkout of a product.

Right now the user needs to do this manually however I would like to automate this.

Any clue on how can I get this done ?


texts: Is is_front variable available in menu.html.twig template?

texts: When the page is actually rendered, the last suggestion is checked. If it exists, that suggestion is used. Otherwise the next suggestion up is checked, and so on. Of course, if none of the overriding suggestions exist, page.html.twig is the final suggestion. This also explains why page--front.html.twig,


texts: I want to have a table view that remains on a particular page, but once someone anywhere on that site creates a node that is a part of that view, the view updates through AJAX and I see the new entry. Like a live twitter feed but for nodes.


texts: EFQ propertyCondition Doesn't work in Simpletest

texts:
This Entity Field Query works as expected outside of simpletest:

$query->entityCondition('entity_type', 'node')
  ->fieldCondition('field_exhibition_window_start', 'value', $date, '<=')
  ->fieldCondition('field_exhibition_window_end', 'value', $date, '>=')
  ->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT')
  ->propertyCondition('status', '0');

Inside of a simpletest, after the creation of an unpublished node within specified parameters, it unexpectedly returns zero results.

However, if I comment out this line:

  ->propertyCondition('status', '0');

(and put a semicolon on the line above) then the query works as expected and returns a node ID. I've even done a node_load() on the node ID returned and inspected the node to be sure that it is, in fact, at that exact moment in time, unpublished.

My simpletest has a user with node access bypass permissions, and I'm using DANGEROUS_ACCESS_CHECK_OPT_OUT, so it doesn't seem like a permissions issue.

Does Simpletest do something weird with EFQs? Why isn't it finding my unpublished node?


texts: Custom field displayed based on author node

texts:
I have a website for ads. In addition the user will have opportunity to make his ad as a VIP ad.

When the user creates a new ad, down bellow will be displayed a field "Make your ad VIP" and after clicking on that button it will popup a description.
This field is created as custom field with Display suite, but I want to make visible only on node author.

The idea is only user that is author of the node can see that field "Make your ad VIP".

The module "Field permissions" cannot control this custom field.

EDIT:

The field name is "adding_make_vip", the custom module is "custom_alter" and this is the code that I've tried:

<?php

function custom_alter_field_access($op, $field, $entity_type, $entity, $account) {
  global $user;
  if ($op == 'view' && !empty($entity) && $field['field_name'] == 'adding_make_vip') {

   // $entity will be the node,so check node author with current user.
   if($entity->uid == $user->uid) {
      return TRUE;
    }
   else {
    return FALSE;
    }
  }
}

Unfortunately it didn't hide the field for anonymous users and users that aren't authors of the node.


texts:
We have a website that is linked to a drupal database. I need to update some HTML text and could not find the file on our server but did find the content in two tables in the drupal DB: dbo.field_data_body and dbo.filed_revision.

I made the change in the db but this has not been relayed to the site.

Please advise

Thank you,
Kai


texts: How to allow users to create only one group using Organic Groups 7

texts:
I am trying to use OG7 to get users to create groups as companies - i.e., each group set up will be a company. I would like to to make sure that ea ch group admin can only create one group (i.e., her/his company); and the "add content>> group" link is disabled or not displayed once a company has been created.

How do I do that?


texts: Image-link to content works only on preview

texts: I have a view showing content of a specific content type. In the view, I show 2 links, linking back to the specific content. The first one is an image field and the second is the title field. Both links work on the preview but on the actual display only the title links to the content. The view is shown through a panel.


texts: How to print rest of the form using "without" function in twig while printing custom user field present account array?

texts:
I am writing custom template to style my "edit user profile" form page.

Below is the code in twig file :

  {{ form.first_name }}

  {{ form.last_name }}

  {{ form.account.mail }}

  {{ form.account.current_pass }}

  {{ form.account.pass }}

  {{ form.actions }}

  {{ form|without('first_name', 'last_name', 'account.mail', 'account.current_pass', 'account.pass', 'actions') }}

The Problem is that it is print all account field for example account.mail. I guess it is is not understood by "without" function and it prints that field twice so I am unable to print all account custom field elements individually.

Here is the Dump output of twig form:

It is very important to print rest of the form using "without" function but "without" function printing my custom account field twice and not understanding that it is already printed on page.

Also I tried to directly use "account" as argument in without function which is working fine but this may miss some important content render which is present in account array. I want to render all account data except the fields which I want to print individually.


texts:
Ok, so I've got a script that's going to go through about 13000 nodes (which might be part of the problem, but I don't think it is).

I can either put them as one large array, which seems to go through the nodes fairly quickly, but eventually leads to a timeout after 600 seconds (10 minutes).

My batch is being produced with this code:

function revision_published_lr_build_batch($items) {

   $count_items = count($items);

    $i = 0;

   foreach ($items as $item) {
    $i++;
    // Here we can add multiple operation using an array variable.
    $operations[] = array('revision_published_process_data', array($item, 'details' => t('(Importing item @item  of  @count)', array('@item ' => $i, '@count' => $count_items)))); // operation with argument
    }
  //$operations[] = array('revision_published_process_data', array($items, 'details' => t('(Importing items)')));
  //Define your batch operation here
  $batch = array(
    'title' => t('Batch operation process'),
    'operations' => $operations,
    'finished' => 'revision_published_lr_build_batch_finished',
    'init_message' => t('Initializing...'),
    'progress_message' => t('Operation @current out of @total.'),
    'error_message' => t('Found some error here.'),
  );

  return $batch;
}

Each batch item should be just an MD5 hash.

However, when going through everything, it is taking forever - the process has been running for hours and it is only on the 86th or so node.

Note, the ONLY major difference in speed appears to be whether or not I put in the foreach loop and create a lot of different operations, or whether I just put $items straight into the operations variable.

Why would this difference cause such a marked speed difference? Batch API seems like it would be more suited to work with lots of small items, rather than one big one.

I suppose one solution would be putting 100 nodes in one batch item, increasing speed for processing and decreasing the probability of a timeout during processing, but this seems like an inelegant solution.

So in short - how do I make batch API process faster?

To clarify, changing the code to this (and removing the foreach loop) is what makes processing faster (but eventually leads to a timeout because the processing is all happening at once):

$operations[] = array('revision_published_process_data', array($items, 'details' => t('(Importing item @item  of  @count)', array('@item ' => $i, '@count' => $count_items))));


texts: Scoping an admin link to only show for certain node bundles

texts:
I have 2 node content types / bundles, A and B. each A has a relationship with multiple Bs. When on the edit page, node/%/edit, for A, I want to show a link to the list of related B so that an editor can easily see a prefiltered list of B for A.

I have created a route:

in my_module.routing.yml

my_module.related_B:
  path: '/node/{node}/related_b'
  base_route: entity.node.canonical
  options:
    _admin_route: TRUE

and have configured a view page at the same url node/%/related_b that contextually filters porperly. no issues there.

The link is added to the menu via the my_module.links.task.yml

my_module.related_B:
  route_name: my_module.related_B
  title: 'Related B'
  base_route: entity.node.canonical
  weight: 100

Everything shows up and looks/works the way I want it to.

The problem is that I cannot seem to figure out how to limit that link/view to only show and work when on the edit page for an instance of content A. It shows on EVERY node edit page.

I've tried the following and did not seem to get anywhere:

trying to hook into hook_local_tasks_alter in my_module.module
custom RouteSubscriber Plugin

In D7 I was abel to accomplish this with a hook and access callback:

function my_module_menu()
{
    $items = array();

    // Single sync functionality
    $items['node/%node/related_B'] = array(
        'title' => 'Related B',
        'page callback' => '_B_page_callback',
        'page arguments' => array(1),
        'access callback' => '_B_access_callback',
        'access arguments' => array(1),
        'type' => MENU_LOCAL_TASK,
    );

    return $items;
}

function _A_access_callback($node)
{
    if($node->type == 'A' && user_access('administer nodes'))
    {
        return TRUE;
    }

    return FALSE;
}


texts: how to print value of a taxonomy field to headline with node.html.twig?

texts:
field_test1 is a taxonomy field like fields_tags.

{{ content.field_test1 }} prints the title and the value (not in teaser - why not?).
I only want the value and want to print it in the header of the node before {{ label }}.

{{ content.field_test1.value }} or {{ node.field_test1.value }} don't work.

{{ node.field_example.value }} seems to work only for "usual" fields, but not for taxonomy fields.

How to do that?

(I've read the book of Chaz Chumley, but found no solution. I've got an answer of 4k4 in another thread, but I didn't understand. Therefore I've clarified my question here.)


texts: Prevent a date from happening in the past

texts: I have a CCK field that is a date. I want to prevent people entering a date that has happend in the past. I know you can set Years back and forward and I have set this to -0:+2 but this just limits the calendar. Any ideas what I can do?


texts: Front Page button to add new element in node

texts:
I'm completely new to drupal and actually building a charity community site on Drupal 8.

I have a content type "PROJECT" with a field "PROJECT MEMBERS" as entity reference to "USER".

Now I would like to have a button on the display of any project node "REGISTER ME FOR THIS PROJECT".

If an authenticated user clicks on that button his name should be added as new Project Member Element in my node.

Is there any way to do this ? Thank you so much !

Cheers,
Tom


texts: How to update users password using a custom resource?

texts:
I'm using services module, I want to modify (update) password on users table.

This is the resource definition.

'client_modification_mdp' => array(
  'operations' => array(
    'update' => array(
      'help' => 'Client souhaite modifier son propre mot de passe',
      'file' => array('type' => 'inc', 'module' => 'my_module', 'name' => 'my_module.resource'),
      'callback' => 'my_module_password_update',
      'access arguments' => array('clientPassword resource update'),
      'access arguments append' => FALSE,
      'args' => array(
        array(
          'name' => 'uid',
          'type' => 'int',
          'description' => 'id du client qui modifie son mot de passe',
          'source' => array('param' => 'uid'),
          'optional' => FALSE,
        ),
        array(
          'name' => 'password',
          'type' => 'string',
          'description' => 'password actuel du client',
          'source' => array('data'=>'password'),
          'optional' => FALSE,
        ),
        array(
          'name' => 'new_password',
          'type' => 'string',
          'description' => 'nouveau password du client',
          'source' => array('data'=>'new_password'),
          'optional' => FALSE,
        ),
      ),
    ),

This is the callback for that resource.

function my_module_password_update($uid, $password, $new_password) {
  $user = user_load($uid);
  $username = $user->name;
  $authentication = user_authenticate($username, $password);

  if ($authentication == true) {
    $update_psd = db_update('users')
      ->fields(array(
        'pass'=>$data["new_password"],
      ))
      ->condition("uid", $uid, '=')
      ->execute();
   }
 }

I'm sure there are some errors in the callback, but Postman returns the following error.

  404 Not found: Could not find the controller.

I'm executing a PUT method.

Did anyone can help me to fix this issue please?
Thank you


texts: I want to set facet value default, when we search it will automatically checked 1st facet.


texts: Implementing i18n string translation in a custom module?

texts:
I have a custom module I've built which essentially acts as a repository of custom CTools keywords that users can arbitrarily define. The issue I'm facing is I need to be able to translate these user-defined strings, so I think I need to implement string translation using the i18n_string module.

I have never worked with translation or localization before, so I'm a bit lost with regards to going about how to implement this. I think I'm on the right path with i18n_string though. Can someone experienced with i18n provide examples that I can look at so I can learn the proper way to implement this?


texts: Two random blocks displaying different fields from the same node

texts: I have a content type with field_1 and field_2. I want to have two blocks displaying different fields from a one random node. I can easily create two random blocks via views module, but they wil not be synchronized. Any ideas?


texts:
I have to deploy a drupal 7 site built on Linux on a windows machine. Some (image) files are referenced via the public file mechanism. Some of them have special characters in their names, encoded in UTF-8 (AFAIK)

Files directly referenced are correctly handled by apache, for example:
http://localhost/lv/sites/all/themes/bizz/images/1.pr%C3%A9sentation.jpg
But the ones that are referenced via drupal public files cannot be accessed; for example http://localhost/lv/?q=sites/default/files/styles/large/public/2.teint%C3%A9_60_380X448_2.png&itok=RvL-USAY returns a 404

The file exists in the filesystem (as 2.teinté_60_380X448_2.png and as 2.teint├®_60_380X448_2.png [that was the name I got in the zip export file]) I tried 2.teintÃ©_60_380X448_2.png (UTF-8 as latin-1) too, but without more luck.

Is there a way to get drupal finds these files without editing all posts ?


texts: Making custom fields available to views module

texts:
I have gone through tons of reading... I even went into drupal archivess looking for help :(

I have defined my own content types and fields as well as my own db tables.
I want to be able to display these fields using views module in drupal 6.

This is the coding I have done so far:

function svm_mail_views_tables() {
  //Define the groups table
  $table['svm_mail_groups'] = array(
      'name' => 'svm_mail_groups',
      'join' => array(
          'left' => array(
              'table' => 'node',
              'field' => 'nid',
              ),
          'right' => array(
              'field' => 'nid',
              ),
          ),
      'fields' => array(
          'group_id' => array(
              'name' => t('SVM: Group ID'),
              'help' => t('The group id'),
              'sortable' => TRUE,
              ),
          ),
      'sorts' => array(
          'group_id' => array(
              'name' => t('Group ID'),
              'help' => t('The Group ID')
              ),
          ),
      );
  return $table;
}

I still don't have this available in my views module when building a view.

Can anyone help me out here and tell where I'm going wrong?

Thanks in advance.


texts:
I have just written a "complicated" @Filter plugin which does this:

public function process($text, $langcode) {
  return new FilterProcessResult(str_replace($this->settings['from'], $this->settings['to'], $text));
}

Now, both from and to can either be an array or a string (except the from string and to array case makes no sense.) For now I just dropped

filter_settings.str_replace:
  type: filter
  label: 'Filter URL'
  mapping:
    from:
      type: ignore
      label: from
    to:
      type: ignore
      label: to

Is there a more specific type? Is it possible for me to add a type?


texts: jQuery only works if I hard code it into the html.tpl.php

texts:
Running into this issue where my custom jQuery code only works in my drupal theme if I end up adding <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> in the <head> tag of the html.tpl.php file.
I tried all the other ways via template, info and still none of them work other then doing this.
Suggestions?
Thanks,
.-C


texts:
I have a simple question: i need to use the layout and structure of drupal admin menu for my own nodes.
I need to replicate the structure and the feeling of admin menu and the page design for my nodes, how can i do that?
I need to replicate exactly the way the admin menu acts and feel on the body part of the site, so with two columns, groups of subtopic for each main topic, links listing for each level and my nodes as leafs of this structure.
Since this is already done on the admin menu, it should be possible to do it also with my own nodes, but how?
I am using Drupal 6


texts: Add Custom Bulk operations to an existing Views

texts:
I am creating a custom bulk operation using hook_action_info and I can see that the operation is created successfully. But however, I want to add this to an existing views. I can do this using Views UI with editing the view and editing "Selected bulk operations". So there I can select the custom operation that I have written.

So far doing this works for me but I want to automate this one. So once I enable my module with this custom operation I need to add this custom bulk operation to the existing view's "Selected bulk operations".

Is there any hooks or alters that do this?


texts:
It was easy to get Drupal installed with a single drush command before:

            drush si $profile -y \
            --db-url=mysql://$MYSQL_USER:$PASS@localhost/$DB \
            --site-name=$DOM \
            --site-mail=$EMAIL \
            --account-mail=$EMAIL \
            --account-name=$USER \
            --account-pass=$PASS >> /dev/null 2>&1

and it would completely finish Drupal installation without expecting user to do anything on UI.

Now with Drupal switching to Composer package manager, I am using the following command

composer --quiet create-project drupal-composer/drupal-project:8.x-dev $HOME --stability dev --no-interaction

however, unfortunately this method expects user to finish Drupal 8 installation on UI entering database, username and password manually. I wonder is there any way to make Composer do installation till the very end without any human interaction?


texts:
How can I check if the current page is a taxonomy term page, similarly to what done with the following code used to check if the current page is the front page?

if (drupal_is_front_page()) {
  // The current page is the front page.
}
else {
  // It is not the front page.
}


texts: How to eMail a file uploaded to a Webform to a sysadmin using the Rules module?

texts: I have a webform where a user can upload a file to the webform. I would like to be able to email the file via Rules to a sysadmin. I know I can send it from Webform directly, but I am also needing to attached a FillPDF file that can only be sent via Rules.