texts:
I am trying to add additional submit buttons to the webform to navigate between different steps. I have added button like below:

function mymodule_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {

  if($form_id == 'mywebform_id') {

    $form['actions']['submit_button_step_1'] = array(
      '#type' => 'submit',
      '#value' => t('Go to Step 1'),
      '#submit' => array('custom_navigation'),
    );

    $form['actions']['submit_button_step_2'] = array(
      '#type' => 'submit',
      '#value' => t('Go to Step 2'),
      '#submit' => array('custom_navigation'),
    );
  }
}

function custom_navigation(&$form, \Drupal\Core\Form\FormStateInterface $form_state) {

  $value = $form_state->getValues();
  //echo '<pre>';print_r($form['actions']);echo '</pre>';exit;
}

But, I'm using same custom submit handler both the custom buttons. How I identify which button has clicked by user? And based on user click I need to redirect user to corresponding wizard page.


texts: Is it possible to override a user page with a view? I would like to override the user page to show all the nodes created by that user.


texts: Would be Drupal a good choice for my web app?

texts:
I have a 'webapp' that consists basically of making Linux command line calls; let's admit it runs the 'uptime' command and returns the output.

My app is currently built using CodeIgniter; it works fine, but i'd like to use the powerful features of Drupal that are built-in like users handling, views, imagecache etc.

My main concept is having a 'button' on which user clicks and then it runs the selected task (asynchronously, AJAX) and then shows the result (with jQuery).

I know of 'triggers' but I can't really think of having them 'do' some action once a 'button' (a link) is pressed, not a 'on node creation do ...'.

I just wonder if anyone has done something similar, and how.


texts: How to add new blocks when "The block X was assigned to the invalid region Y and has been disabled"

texts:
I have inherited a site (in Drupal 6) and the original developers are completely out of the picture. I need to add a block but it looks like they've customized things and blocks are being rendered in a way other than assigning them to block regions as per the default.

I get a lot of warnings to the effect of The block X was assigned to the invalid region Y and has been disabled but those blocks still appear on the site. So they must be being brought in another way. I am not too terribly worried about the warnings (so seeing this discussion is not really what I need: https://drupal.org/node/1172560). I am more concerned that it is taking me hours to add a link and image to the homepage.

I see that the previous developers installed the Nodeblock and Nodeblock Auto modules and the nodes that come in have html ids like: block-nodeblockauto-node_<NID> so I imagine this is how they are being brought in.

But I don't see any options in the admin panel for configuring nodes any further than what I am used to from the default. In looking through the template files for the custom theme, I also do not see where these are being brought in.

Note: I am not in a position to migrate to Drupal 7 so I have to keep things in Drupal 6 for now.


texts: Highlight active page in a table row using views

texts:
I have a drupal 7 view that is outputting the titles of nodes which is in table form.

       Link 1

        Link 2

Drupal gets me close by adding "active" class to the link (Link 2), but I would like it for the entire row (TR).

I saw another question like this one asked for an unordered list, but I tried that code and it didn't work. Maybe a little tweaking needed?

Thanks guys!


texts: Pull all articles from my Drupal Site as JSON

texts:
I am trying to pull all articles from my site in form of JSON.

I know it can be done by either Services, RESTful Web Services or Views Datasource but I don't know how to do it. I am a complete n00b in Drupal.

Could you specify me, with an example hopefully, that how can I pull all articles in a JSON and show that JSON through a URL?

Many Many Thanks.


texts:
I have a views block that I want to modify with javascript. I can get it to load with the following in my template.php:

function THEME_preprocess_block(&$variables) {
      drupal_add_js(drupal_get_path('theme', 'THEME') .
      '/js/script.js' ,  array('type' => 'file', 'scope' => 'footer'));
}

However, I only want it to load when a certain block is displayed. I want to use something like:

function THEME_preprocess_block(&$variables) {
    if ($block->block_id == 'matching_id') {
      drupal_add_js(drupal_get_path('theme', 'THEME') .
      '/js/script.js' ,  array('type' => 'file', 'scope' => 'footer'));
    }
}

If this is possible how would I go about making sure it only runs on that block?


texts: How to access a remote site using the command line (with drush)?

texts:
I don´t know how to use drush nor the command line, so I´ve started to read some tutorials, and watch some videos. I´ve installed the drush windows installer, because I have windows.

The thing is that all examples I´ve read so far, start with localhost. What if I have my devel installation in a shared hosting or a VPS, in the cloud? How to access that?

Using my ftp program, I access it using hostname ftp.mysite.com the username and the password to that account. How may I do that with the command line?

Thanks!


texts: if term reference is value X in tpl.php file

texts:
I want it so that in my page.tpl.php file if the user has selected "Standard" as the "Page Type" term reference it prints an extra bit of html.

I tried something along the lines of the code below but have not had any luck so any help would be greatly appreciated.

<?php $page_type = field_get_items('node', $node, 'field_page_type');
if ($page_type == 'Standard') {
    print "worked";
} ?>

If I print the "field_page_type" value further down the page it prints "Standard" on the page but if I use the if statement above it doesn't print the "worked" result.

I am using Drupal 7.


texts: I did some searching here, but I couldn't find exactly what I was looking for. Is there a template.php function that I can add to change the content title (not the <head> page title) of a user to be a field created after-the-fact (like a first name or the last name field)? If it can't be a function, maybe some type of 'if' statement to wrap around the content title output to check if it's a user page and then output the fields would probably work.


texts: How to hide the site name from browser tab?

texts: Is it possible to rewrite what is displayed in the browser's tabs. Fro example when I open some page, in the browser tab it is displayed as  "Page name | site_name". For example " About | site_name". And we would like to keep only the name of view page. Is it possible in Drupal 8 ?


texts:
I was wondering if the Print module can be used to print an entire page, not just nodes. I need to add some blocks to the pdf as well, not just the node content.

Is there any way of doing this, or will I need to manually add the blocks to the node->content property?

LATER EDIT: The problem is that the print module takes the node ID as a parameter. This means I cannot print blocks on those pages.


texts:
I was working on transferring my website to a new folder. Same database, just a new folder. Worked a bit on the new address, etc.

When I went back to the old address, website is not working anymore. More precisely, it throws a lot of "undefined variables" alerts that clearly have to do with the theme, but I'm pretty sure I have not touched any files there...

Notice: Undefined variable: site_logo in include() (line 16 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).
Notice: Undefined variable: site_logo in include() (line 18 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).
Notice: Undefined variable: site_logo in include() (line 21 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).
Notice: Undefined variable: hgroup_attributes in include() (line 28 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).
Notice: Undefined variable: site_name_attributes in include() (line 31 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).
Notice: Undefined variable: tag in include() (line 100 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).
Notice: Undefined variable: primary_local_tasks in include() (line 102 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).
Notice: Undefined variable: secondary_local_tasks in include() (line 117 of /hsphere/local/home/ulufenci/test.ulufencing.net/sites/all/themes/corolla/templates/page.tpl.php).

are the kind of errors that I get. I'm using the theme Corolla. Can you please provide any lead as to what might be causing the error?

Thank you!!!


texts: Render published content or comments on new created content using a link

texts:
I was looking without luck for a way to be able to make a link or button with the functionality of making a new content showing some content or comment already posted above, something like the Retweet option to be more clear.
Is there a module or combination of modules to achieve this?
Edit:
Now after an answer I know it is easily rendered with a reference field, all I need now is a way to create a link that will auto fill the reference field. That way the user clicking the link never see the field, my idea is that that field is not visible in 'Manage form display'.
Edit 2:
Prepopulate module do the desired link. If I disable the field on 'Manage form display' it stop working. So I used Popup field group
As I told in the comments, this module makes a Popup with only desired fields, but instead doing it, no Popup is opened and the form is rendered with all the fields except the ones supposed to appear on the Popup, so I use the module to get my reference field only on the Popup group and that way this field disappear on create or edit content. Because I am solving this taking advantage of a module that did not do correctly what it should do, if someone thinks that this solution is not a safe way to do it let me know other way to achieve it.


texts: Send email after updating a field on a webform

texts:
I have a webform with a set of fields. When the form is submitted, a website admin needs to update a field on the form based on some criteria. I need to send an email to the sender only if the value of that field equals something.
I have tried implementing this with Rules:

Event: After a webform submission has been updated.
Conditions: Webform has name
Action: Send HTML email

I need something else on step 2, to compare the field value submitted, but I don't see any condition for that.
Drupa 7, Webform 4.


texts: Overwrite the url function of a specific node entity

texts:
Can I overwrite the url function of a specific content type of node entity ?
 So to have a different pattern when i use: $node->url();


texts: Inside drop-down menu child menus are not working

texts:
I am using bootstrap sub-theme and created a drop-down menu and set it's menu levels they are working correctly but when i extend to child menus it's  not working.
I have searched Expand menu links down in a tree and Child navigation sidebar or drop-down navigation displaying child items but not found any solution.

Any Help?


texts: My implementation of template_preprocess_block() isn't working

texts:
My block has id=block-block-10, now i want to add a more link after the title.
This is my code in my theme's template.php.

function mytheme_preprocess_block(&$variables) {
  if($variables['block_id'] == 10){
    $variables['block']->subject='
test>
more';
  }
}

There is no more text on the block's title. What's wrong with my code?


texts: Get term plain text aliased url from tid

texts:
I realise that this is similar to other questions posted, but they all seem to involve using print l() to output a fully formed anchor.

What I need is just the uri, output in plain text to use directly in the node template. I nearly got there with the following, but end up with the unaliased version:

<?php
  if (isset($node->field_source_of_tid['und'][0]['tid']) && $node->field_source_of_tid['und'][0]['tid']) :
    $term=taxonomy_term_load($node->field_source_of_tid['und'][0]['tid']);
    $term_uri = taxonomy_term_uri($term);
    $output = $term_uri['path'];
endif; ?>

And I use the output as so:

<a href="<?php print render($output); ?>">A BUTTON </a>

Any ideas?

Thanks!


texts: Files attached to nodes are never deleted from server even after they're removed from the node (and that edit is saved), Drupal 7

texts:
I've noticed something strange on my site: after attaching a file to a node (via the regular file field), that file never gets deleted from the server.  I remove it from the node, save that change, but I can see the file is still on the server.

This makes replacing files very difficult, because when a user tries to attach a replacement, the file name has the "_0" or "_1" suffixed to it (since the original file is still on the server and that makes the name a duplicate).   That means that we would need to find all links to the file and edit each one to match the new file name/url.  It's a total mess.

I'm looking online and nobody seems to have this issue -- the files ought to be deleted from the server once they're removed from the node.

Any ideas why this may be happening in my case?  I'm not sure where to start looking.  Certainly the 'File system' configuration page has nothing of that nature as an option that may have been checked.  And the field options themselves seem to not have anything of that nature I may have inadvertently set.  Any other ideas?


texts: How to change the node/add modal form css

texts:
I'm using the drupal modal system to create popups to add content, Hello, I'm working in a D8 project.
The problem is that with the ajax the system add a width of 300px to the modal window, and I'd like to change it.

I don't see how to change this style, only try a diferent css with important attribute.

Any other way?


texts: How would I add a class with the same name as the header?

texts:
I'd like to add a class with the same name as the header, in order to keep similar header columns the same size. Basically, the code is generating multiple tables, some of which have the same header items, and some of which do not. All columns with the same header value will take the exact same styling.

$string .= theme('table', array('header' => array_values($headers[$group]), 'rows' => $results));

$string is '' at the beginning of this, and I want to add the class to the values in $header - so ideally it would look like this:

Header


texts: Add database value in views for entity type user

texts:
I want to extend the user profile with a rank (a decimal ranging from 500 - 2500), which needs to be updated on a regular basis (10 times per minute) for several users. (it is for http://achtungdiekurve.net/ ) I already implemented it with a seperate table, containing a rank field and implemented a table to show the rankings (http://achtungdiekurve.net/ranks ).

However, I want to use views to create this table. But I cant seem to alter the entity type user in such a way, that it shows Rank in the views forms. How to do this? My current code:

<?php
function achtung_entity_property_info_alter(&$info) {

  $info["user"]["properties"]["rank"] = array(
    "label" => t("Rank"),
    "description" => t("The rank of the user"),
    "type" => "decimal",
    "getter callback" => "achtung_get_entity_callback",
    "computed" => true,
    "entity views field" => true,
    "query callback" => "entity_property_query",
  );
  watchdog("ACHTUNG entity info alter", "
".print_r($info, true)."
");
  return $info;

}
function achtung_get_entity_callback($account, $options, $name, $entity_type) {
  watchdog("ACHTUNG entity info callback", "
".print_r($account, true)."
");
  return 2;
}
?>


texts: Hook_preprocess - disable CSS caching with drupal_add_css

texts:
I'm wondering how to disable css caching when you use the function drupal_add_css. In hook_preprocess I have some dynamic css loading with this function and by default it generates a cached version of the css file (f.e. style.css?ow65jm) and I couldn't find any information on how to disable this. It gives an issue with some third party applications how rebuild a page view (f.e. Hotjar) who expect a single version of an certain file.

I've checked the performance settings (admin/config/development/performance) and CSS and JS merge/compression is disabled.

Adding the CSS files directly into the tpl files can fixes this but can this also be accomplished with in the preprocess hook and with the drupal_add_css function.

Update - Added template.php and .tpl code:

template.php:

function mytheme_preprocess(&$vars, $hook) {
...
if (!(path_is_admin(current_path())) || (arg(0) == 'user' && arg(2) == 'edit')) {
      drupal_add_css('https://fonts.googleapis.com/css?family=Merriweather:700', array('type' => 'external'));
      drupal_add_css( $path_odisee . '/css/normalize.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'weight' => -10));
      drupal_add_css( $path_odisee . '/css/odisee.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'weight' => 0));
      drupal_add_css( $path_odisee . '/css/override.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'weight' => 0));
    }
...
}

html.tpl.php:

...
<head>
  <?php print $head; ?>
  <title><?php print $head_title; ?></title>
  <meta name="viewport" content="width=device-width,initial-scale=1">

  <?php print $styles; ?> <!-- here the preprocessed CSS gets loaded -->

</head>
...

Additional information:
The people over at Hotjar suggested to keep the cached versions of the css files on the server. Any suggestion on how to force this?


texts:
My Drupal commerce site supports multiple payment gateways. One of the payment types should be paying by invoice. That means if you select invoice payment type during checkout process you don't have to enter any "real" payment info (credit card data or something), but at end site should send you invoice (pdf document) with instructions how to pay your order.
I've installed Invoice module: https://www.drupal.org/project/commerce_invoice
And if I understood well I should use actions and rules to send email after checkout is complete. Is that true?
But what puzzles me most is that this module doesn't provide invoice payment gateway. So I don't know how to achieve that when user is selecting payment method "Pay by invoice" method appears? Should I use some dummy (test) payment gateway or? What payment gateway should be used for invoice payment?
An update:
What Rules event should I use to detect that checkout process is finished, so I can send invoice.
Also, what action should I select to send email that contains invoice (with link to PDF document or PDF document attached)?


texts: Keep only the last revision of content with multi-version module

texts:
We are using Drupal 8 with the multi-version module version 1.0.0-alpha12.

As part of our dev/test workflow, we SQL dump the production database and move it into dev and test environments. Recently this process has been becoming increasingly slow and after some investigation into the composition of the database, I notice we have ~8G of data in the node_revision__body table.

I would therefore like to prune content in the database to keep only the most recent revision when we are working in our dev and test environments.

How can I achieve this with Drupal 8 and the multi-version module? I have come across the Node Revision Delete module, but that has a version for Drupal 7.


texts: How can I use Drush to determine if a module is being used or not in a multisite architecture?

texts:
I have a multisite architecture that has over 30 sites.

In one specific site search_api_solr version 7.x-1.0RC5 is installed, and I can see that it's enabled and being used in the module list.

In the common sites/all/modules folder search_api_solr 7.x-1.0-rc2 is there. When I do drush pm-list | grep search I can see that it's listed but "Not Installed."

Does this mean that none of the 30+ sites is using this module and it's safe to delete it? Or is that command simply telling me that it's not being used by the default install?

If the latter, how can I use Drush to tell me what specific sites are making use of modules in the common sites/all/modules directory?

EDIT:

@greg_1_anderson

I tried your solution with:

drush @sites pm-info search_api_solr --field=status

On each line of the output after hitting y I get something like:

.appdrupal#mysite.example.com >> blahblah : some.description

looks like the above output is 3 columns. Possible values for that 'blahblah' column seem to be numerous (requires, required by, type, title, description, version, date, package, 'group', files.. etc, etc..) nothing to denote if it's enabled)

I can see a couple times in the 'blahblah' "status", but it's not singled out. Ultimately this creates 1000s of lines of output. I tried to add | grep status but it hanged (I gave it 120 seconds).

Drupal is 7.26 and Drush version is 5.9 - thoughts?


texts: AJAX HTTP error 200 when using Views Bulk Operations on Files

texts:
I am attempting to use VBO's "Lock Files" operation to prevent some files without file usage records from being randomly deleted (it happens). I am open to alternate means of doing this as well as a solution to this specific problem.

VBO has never worked great. Particularly the options to "select all on this page" or "select all on all pages" almost never show up. Every once in a while it will but there seems to be no rhyme or reason there.

Whether I select multiple files or a single file from the view preview results, when I attempt to execute the "lock file" operation, on the "confirm" step, I get a js alert box pop up with this error:

  An AJAX HTTP error occurred
  HTTP Result Code: 200
  Debugging information follows.
  Path: /admin/structure/views/ajax/preview/files_check/default
  StatusText:
  ResponseText:
  window.NREUM||(NREUM={}),__nr_require=function(e,t,n){function
  r(n){if(!t[n]){var o=t[n]={exports:{}};e[n][0].call(o.exports,function(t)
  {var o=e[n][1][t];return r(o||t)},0,0.exports)}return t[n].exports}
  if("function"==typeof__nr_require)return__nr_require;for(var o=0;o
  Performing Lock selected files on the selected items...

This does not appear to be the complete error, but since the error is in the alert box instead of the console there appears to be no way to access the full error.

After I clear the alert box I still have the confirm button and cancel link. When I click confirm I just get the error again. When I click cancel I return to my preview but now the "select all..." options are visible. All further attempts still generate the same error though.

This is the query output by my view

SELECT DISTINCT file_managed.fid AS fid, file_managed.timestamp AS file_managed_timestamp, file_managed.filename AS file_managed_filename, file_managed.uri AS file_managed_uri, file_usage.count AS file_usage_count
FROM
{file_managed} file_managed
LEFT JOIN {file_usage} file_usage ON file_managed.fid = file_usage.fid
ORDER BY file_usage_count ASC, file_managed_timestamp ASC
LIMIT 10 OFFSET 0

I have tried this by setting the advanced "Use Ajax" option to both yes and no with the same result.

Drupal (7) core and all modules are up to date.

I'd be happy to provide any additional information needed. Please advise.


texts: Drupal's "Add to Cart" field shows product variations instead of individual options

texts:
This is probably a very novice question, but I'm working on a website that uses Drupal Commerce. There is a field defined for the product display called: Product variations which is of the format Add to Cart form.

On most products, this field correctly shows a combination of size and color dropdowns, whereas for some products, it just puts all products variations in a drop down and shows that instead of the color/size combination.

Any idea what might be going wrong or how to debug this issue?

Wrong:

Correct:


texts: how to make an automatic download button?

texts:
I have a Content type with a file field. I want to add another field (download button) which when users click on that, they would be able to download the file (uploaded in file field), and show file field as a simple preview image or even hidden it.
Is there any module to do this(1:create a button with custom css through cck and 2: automatically link the file path to download button), or any other ways?


texts: How to display menu link language in List Link view of menu?

texts:
We have a menu, Main Menu. When we view List Links of that menu we can see all the menu links. However, we do not know which menu link is associated to what language.

What would it take to make the page also display the language on the List Links Display? WE tried to modify the menu.admin.inc file to include the language value that is not working.

Page of interest: admin/structure/menu/manage/main-menu


texts:
Have not touched Drupal for 3 years already and try to remember how to do the templates.

Banner node -- I checked the field name: field_data_field_banner and wanted to print every node banner image up to 4.

According to dump:
 ["field_banner"]=>
 array(1) {
["und"]=>
array(1) {
  [0]=>
  array(13) {
    ["fid"]=>
    string(1) "1"
    ["uid"]=>
    string(1) "1"
    ["filename"]=>
    string(37) "Golden_tabby_and_white_kitten_n01.jpg"
    ["uri"]=>
    string(46) "public://Golden_tabby_and_white_kitten_n01.jpg"
    ["filemime"]=>
    string(10) "image/jpeg"
    ["filesize"]=>
    string(5) "20388"
    ["status"]=>
    string(1) "1"
    ["timestamp"]=>
    string(10) "1426087127"
    ["rdf_mapping"]=>
    array(0) {
    }
    ["alt"]=>
    string(0) ""
    ["title"]=>
    string(0) ""
    ["width"]=>
    string(3) "737"
    ["height"]=>
    string(3) "300"
  }
}

}

  <?php if($node -> field_banner < 4){?>

<?php print $node -> field_banner['und'][0]['uri'];?>

  <?php }?>

It gave error:
    Notice: Undefined variable: node

Tried a few ways but I couldn't get the image appear in slide :(

Help appreciated. Thanks


texts:
Ok, so here's my problem. I feel it's really very simple and I am missing something. I have a Drupal 7 view which shows a certain type of content. Say it has a url mysite.com/article. What I want is, if the url is like mysite.com/article/me, it would load the articles posted by this current user. "me" will always be "me" and would not take any id/username.

Hope the problem is clear. Thanks


texts: I'm using an eCommerce module. In a 'view cart' node, there is a 'remove' button so users can remove items they no longer wish to purchase, however, instead of the 'remove' value on each button, I'd like to have a simple icon and no text, how would I go about making this change? I understand it would probably be a form alter function in the template.php file, but I'm not sure how to set it up.


texts: Custom formatter for a multi-valued field

texts:
I have a multi-valued image field and I'd like to use its delta value with the Custom Formatters module. What I want to do would be really simple with html+tokens if it were to work:

However, I don't see the option for the delta value available in the list of tokens available, and using that code would just end up with [node:field_image:0] and [node:field_image:1] being replaced as src=""

Could you please advice me on how to do this? I think I need to use php but I don't know how. Thank you very much!


texts: How do I get all the referenced taxonomy terms without the field name?

texts:
I have been looking into entityQuery but haven't seen what I am trying to do yet.

If I have a node object, is it possible to get all taxonomy terms referenced by the node object, regardless of the field they are in?

Most of what I have seen would be getting the terms from a specific field, but I won't have access to the field name. I just need to find all terms in a specific vocabulary that are referenced by the node. Thanks!


texts: Should I use Entity Views Attach module to solve my problem

texts:
I've check the question in this node: https://drupal.stackexchange.com/questions/5732/is-there-a-good-tutorial-for-entity-views-attach-module

And I see that maybe what is answered there is a partial solution to the issue I'm facing. To avoid writing I will paste the issues addresses I've been creating on my help search:

https://drupal.org/node/1928064
https://drupal.org/node/1929030
https://drupal.org/node/332001

Basically it's to send an argument from a view to another view, both displayed at the same time in the same page (one in block, the other in content). A further complication is that those views are contained in panels.

On the "block view", there is a list of let's say names (extracted from a content type) exposed as links which point to the "content view". This takes the argument (text of the link) from the clicked link of the "block view" as a filter to display some others fields from the same content type.


texts: Can blocks being exist and displayed without being stored in blocks table?

texts:
I'm wondering what could be the problem.

When I queried the homebox_default table , it showed bids with 1950
1387
1382
953
958
1916

but when queried in the blocks table for these blocks with these bids are not existant there was no blocks with those ids. But when I see the homebox/1 page it shows page with blocks. How is that possible?


texts:
I have installed the profile2 module and added some fields, but I can't find where are they shown. How do I display fields' values for a user?

I also can't change fields' values after creating a user.Fields are shown only in user registration page.


texts:
I am using Auto Assign Role Module to allow users to choose their role during registration. Block to choose role appears as first block, before the default fields (username, email and password).

Is there a way to move AAR block to the bottom, after the default fields?


texts: How to get a same result of Views with Random Sort Criteria

texts:
There is a View which it's Sort Criteria is Random.I have to use the following code to implement two different displays of one view.

print views_embed_view("library","block_0",$term->tid);
$views = views_get_view_result("library","block_0",$term->tid);
//some other codes that retrieve data from $views

The problem is, because the View is Random the above two lines return different results while I need to have one. How do I can solve this problem?


texts: How to re-enable content notifications for Notify?

texts:
I turned off content notifications for all users for Notify some time ago because it was sending duplicates. There was a checkbox somewhere that I unchecked. It is not in notification settings.

This is Drupal 6.


texts: How can I make SMTP plugin work with multiple languages?

texts:
I'm using the SMTP Authentication Support plugin for mail from my Drupal 8 server.

Sending mail from a webform works fine as long as the visitor is using the default language, which is English. It does not send when using any other language.

The message in the error log is not helpful:

  Error sending e-mail from email@site.com to email@site.com: SMTP Error: Could not connect to SMTP host.

This makes no sense to me. How can it not be connecting, when the same connection information is ok on English?

How can I resolve this? Here's what I've tried to do:

I've asked for support on SMTP's issues page, but have not received any response yet.
Set the language detection up two different ways: by domain or by URL. Same result on both.
Tried two different SMTP servers, with the same result on both.
Tried SSL and standard protocols for SMTP.


texts: Is it possible to programmatically add a path alias to a programmatically created node?

texts: I have created pre save hook in module which is populating my node by fetching information from various API's. However I can't get my mind around how to add node alias to newly created node. Is there any function or module or something (Drupal 7 had path_auto)? Or should I go with raw insert into url_alias? Might I shoot myself in the foot with such a drastic move?


texts:
I want to return distinct values based on a particular column - 'company_code'. How do I achieve this? My code is as below.

$query = \Drupal::database()->select('actuarial_bases', 'bases')
                    ->fields('bases', ['company_code','basis_id','mortality','commission','initial_expenses','recurring_expenses','date_saved','discount_rate'])
                    ->condition('approved_by',!"")
                    ->orderBy('date_saved', 'DESC')
                    ->distinct();


texts: Conflict with db_set_active and variable_get

texts:
I am running a drupal multi-site system, with shared code and seperated DB. Each individual multi-site represents one continent and can have different language versions.

What i want:
I am working on a module, that gathers all available languages on all multi-sites into one big continent/language map.

To query cross-multi-site data i use db_set_active([multisite]) and manually fetch some data via db_query().

foreach ($multisites as $multisite) {
  db_set_active($multisite['db']); //switch context
  $links = db_query(Select language from {languages} etc...)) // run query
  do_somthing_with_data($links) //work with data
  db_set_active(); //switch to default
}

This works pretty fine,
but there are already drupal-core functions in language.inc i want to use (e.g. language_negotiation_get_switch_links()).

foreach ($multisites as $multisite) {
  db_set_active($multisite['db']); //switch context
  $links = language_negotiation_get_switch_links(...,...) // run core-function
  db_set_active(); //switch to default
}

Here is my problem:
Several core functions use variable_set() and variable_get(). They are persistent and initialized on bootstrap.

When changing the active database with db_set_active(), incoming queries have the new context, but values fetched with variable_get() are inconsistent, because they store data from default database, filled on bootstrap.

In a nutshell:
I want to run core-functions on one multi-site with data from another multi-site. db_set_active() works fine, but data is inconsistent because variable_get() uses data, which is initialized on bootstrap.

Has anyone ever worked with this issue?

Kind regards
larry

Addition:

As I got deeper into development it became more and more complicated. I don't recommend the procedure of cross-multi-site-core-function-calling, because the initialization of core-functionality is triggered during bootstrap.

Here an example:

The multi-site you are browsing to does not need to initialize language.inc, because it has just one language-version. Further in code-progress you switch context to a multi-site with two or more languages but language.inc functionality is not available, because it was not initialized.


texts: Whenever I save any Node, I lose the ability to edit it?

texts:
Browse to Node Edit Page, ex. /node/44/edit
Click Save
Browse back to node edit page, it says "Access Denied"

Runnning drupal 7.16

and these modules:
addressfield      commerce_migrate_ubercart    emfield             jplayer         page_title     tap
admin_menu        commerce_moa                 entity              jquery_update   pathauto       taxonomy_menu
browscap          commerce_node_checkout       entityreference     libraries       phone          title
calendar          commerce_product_attributes  entity_translation  media           README.txt     token
calendar_block    commerce_shipping            fb_social           media_flickr    redirect       transliteration
captcha           commerce_views_display       features            media_youtube   references     tumblr_connect
cck               constant_contact             field_collection    menu_block      rules          views
ckeditor          contact_form_blocks          flickr              metatag         securepages    webform
cnr               ctools                       fp                  migrate         simplehtmldom  wysiwyg
commerce          date                         geofield            migrate_extras  site_map       wysiwyg_filter
commerce_authnet  devel                        geophp              mollom          strongarm
commerce_coupon   devel_themer                 google_analytics    nodehierarchy   styles
commerce_migrate  email                        interval            openlayers      superfish

This is so confusing, becuase I cant think of what I changed that would cause this.

This project is a drupal 6 to 7 upgrade with a switch from ubercart to commerce

Any help greatly appreciated and my head will thank u


texts: Provide a default image for image field programmatically at theme level

texts:
I have an image field on a node, which will not always be populated. In the case where the field is empty (no image), I want to alter the markup to display a random image which always exists in a specified directory of the files dir. The second part isn't a problem, but I am struggling with the alter part. I am trying to find the correct hook or theme function to test if the image field is empty and then render some markup in it's place. I am lead towards a theme function. Any ideas?

Thanks


texts:
I would like to add a
 containing only checkboxes. The output I want is similar to the following.

  1<input type="checbox" id="check1" name="check1">
  1<input type="checbox" id="check2" name="check2">
  1<input type="checbox" id="check3" name="check3">

<input type="text" id="text" name="text">

<input type="submit" value="submit">

In template.php I have THEME_form_alter() with the following code.

  $form['basic'] = array(
    '#prefix'=> '

',
    '#suffix'=> '

'
  );

  $form['basic']['keys']['check1'] = array(
    '#prefix' => '
Check1',
    '#suffix' => '
',
    '#type'=>'checkbox',
    '#value' =>'0',
    '#pre_render' => '',
    '#id' => 'check1',
    '#name' => 'check1'
  );

  $form['basic']['keys']['check2'] = array(
    '#prefix' => '
Check2',
    '#suffix' => '
',
    '#type'=> 'checkbox',
    '#value' =>'0',
    '#pre_render' => '',
    '#id' => 'check2',
    '#name' => 'check2'
  );

  $form['basic']['keys']['check3'] = array(
    '#prefix' => '
Check3',
    '#suffix' => '
',
    '#type'=> 'checkbox',
    '#value' => '0',
    '#pre_render' => '',
    '#id' => 'check3',
    '#name' => 'check3'
  );

  $form['basic']['keys']['text'] = array(
    '#prefix' => '
',
    '#suffix' => '
',
    '#type'=> 'textfield',
  );

How should I write THEME_form_alter() to be obtain the HTML output I want?


texts: What version is the CKEditor in the CKEditor module?

texts: I have installed the CKEditor module for Drupal 7 version 1.14. This version of the module comes with CKEditor already integrated with the module, so I am not sure how to find out exactly which version of the CKEditor this module comes with by default. I need to know this because when adding plugins from the CKEditor website only certain versions of the plugin are compatible with certain versions of the CKEditor. So how can I find this out? I have looked through the different module and JS files but I cannot find this information anywhere.


texts:
I used Name module to get the Full name of the User.I have created two views one with the all list of names and other profile info.If we click a name it will show up profile of that user.

I am passing full name as an argument in the URL to the second view (field_name: full).

I tried to add full name as argument in the second view but it does not have full name field it has been broken down into

field_name : given

field_name : family

Is there any way to get full name as an argument ??


texts:
I've been getting mixed messages and there is practically no solid up-to-date documentation, I just want to know the standard procedure for moving a locally developed Drupal 8 site to an online server.

Some say it's as easy as FTP'ing your files over and exporting your local database SQL code over and then connecting to the db via the settings.php, others say to put a fresh installation of Drupal 8 online and then move certain files over while exporting the database using the backup module and then importing it online, others still say I also need to export the local configuration and import it online, still others say I need to update the URL's in some parts of the SQL or configuration exports, etc.

I'm developing with the latest Drupal 8.4 with a custom theme in Windows 10 on XAMPP (I have drush) and migrating to a server subdirectory that my domain points to with php 5.6+ (no drush options online because there's no SSH access).

TLDR: What are the steps to move a locally developed Drupal 8.4 site and database to an online server and get it configured, up and running normally?


texts: How do I populate fields in content type not in feed when importing?

texts: I have a content type that contains a couple of required fields that do not have a mapping counterpart in the csv feed.  When I import the csv feed, the process fails because of the required fields.  What plugin can I use in a custom module to 'finish' the import by providing the values for the other fields?  Is this even possible?


texts:
I want to make my front page look like simple google search page.

Elements:

Large search box
Footer
Login/Register

I'm having hard time figuring out how to have only these 3 elements.How can i edit search box area and its position?


texts:
The route name of the current page is available in page.html.twig?
The page is generated by the default feedback form.


texts: Set maximum / disable custom block cache for anonymous users

texts:
I have a little issue regarding my custom block module. The module itself fetches weather data via json-request and the data is shown as a 4-day weather forecast to the user. As the weather should be actualized every day I want to set a "maximum cache time" or even disable caching for the whole block.
Right now I would have to flush the cash manually every day.

After a little bit of research to that topic I found out that using 'max-age' in the build() function would do the trick but it does not affect the caching for anonymous users at all.

Using \Drupal::service('page_cache_kill_switch')->trigger(); would disable the cache for a specific page or content-type but I don't want to disable the caching for a whole page at once.

So how can I trigger the caching for my custom-block? Or is there even a way to disable the caching for a certain part of the code e.g. the json-request in my case?


texts: how to deploy from dev to staging and production?

texts:
Hello so here is my question,
I have three environments for my drupal 7 installation Dev, Staging, Production, right now Dev has all the new code and well everything is setup there. The move of the code from Dev to Sta or Prod is quite simple as it is just code and can be done with a simple push. But what about the configuration on the DB? how do you move DB configuration from Dev to Sta and Prod? more specifically how do you sync the configuration from Dev to Sta or Prod? so the views, nodes and whatever modules you had enabled on Dev will show on Sta or Prod?

Tried features and well it moved the code (which i already know how) but the db configuration was not transferred/enabled in the other environment


texts: How do I deploy/manage similar sites from an unique profile, without dumps?

texts:
I do not like the "cloning website" solutions which implies dumping a database and importing this dump in another environment. This does not look like a real world way of deploying several instances of the same website (staging/prod/dev/etc).

With D7 we usually used custom profiles and used drush to install websites from these profiles (and maybe using features for later site synchronisations). This provided us with fresh installations, no test content, but sharing important settings. Common content synchronisation would be done with migrate, for example.

I tried to manage several D8 instances sharing the same install profiles. Where the final goal would be to share and sync site configurations. And every installation has a different site UUID.
I have no success in enforcing the system.site uuid config variable at install time (of course I can alter the value later, but it seems to me that this is too late, and all objects are already created with different UUIDs, which makes the first synchronisation a nightmare, where some default contents must be deleted, or default language crashing the sync because it cannot be removed, etc.).

To enforce this UUID I tried using a generated settings.php file with a $config['system.site']['uuid'] value inside, big fail (the setting was completely ignored, even after site installation).

I've also looked at configuration installer profile, which I do not completely understand, especially the way to mix this solution with another install profile.

So the question is, what is the best way of deploying fresh sites from an install profile:

without "cloning websites" and manipulating SQL dumps at site creation (like in what are cloned sites question ).
with a fresh clean install (without developers content garbage), using the exported configuration and code only
which can manage both install configuration defaults and later synchronisations


texts: Does backup and migrate include the users and login info?

texts:
I'm migrating from the test environment to the live environment, both of which have a separate set of users/logins/privileges.

How do I not overwrite this information when migrating from one site to another?


texts:
I have a custom module that hooks into a commerce extension module.

The function splits a payment for a product and splits it to beneficiaries who helped create the product.

I use user_referance module in a field collection field in the product content type to store the beneficiary users from the system. The drupal system log shows this when running through the function

Warning: array_flip(): Can only flip STRING and INTEGER values! in      EntityAPIController->load() (line 219 of /www/opigno/profiles/opigno_lms/modules/contrib/entity/includes/entity.controller.inc).

Drupals error back trace function showed the error came from this line

  if (!empty($item_id)){
      $split_pay = commerce_funds_object_to_array(entity_load('field_collection_item',
array($item_id)));
  }

The function does run through fine but I'd like to squash any bugs that are appearing, the $item_id array only contains the user_ids of beneficiary users so i don't really understand why a non integer value is being passed


texts: As VBO for Drupal 6 is outdated due to a security issue, is there an alternative to this module?


texts: subpath url alias does not seem to fire 404

texts:
I'm using subpath_alias, so /node/4/video alias is available too.
But now, and I'm not sure subpath_alias is involved, /node/4/foo does not fire 404 and instead it shows the page as if it was /node/4.

Any clue ?
TIA, Tom


texts: How fix an inverted execution order problem?

texts:
When the order of calling the implementation of a particular hook by different modules matter, you can change the weight of modules by tweaking system database table.

But it looks like I'm in a more difficult situation involving interaction of the field_group, and the clientside_validation modules with my custom module.

I use hook_field_group_build_pre_render_alter() provided by the field_group module to add some '#states' attributes to a field group form element.

The states I add change the '#required' attribute, besides other things. This form relies on a clientside_validation module suite to provide a JavaScript validation.

There is a brand-new module, clientside_validation_states which perfectly fits me, but I ran into the difficulties trying to make use of it. clientside_validation_states uses #after_build, which should be called after my code, but hook_field_group_build_pre_render_alter() is called in field_group by using a '#pre_render' FAPI attribute.

This together results in an inverted calling order. Do you have any idea on how to fix this?


texts: How to alter a views current pager label to node post date

texts:
I'm working on a website which features a daily updated "six word story" (a node for each day). I created a view to display the last node/story, with the option to scroll back one day at a time (using AJAX). The view has a full pager.

However, the pager is (of course) displaying "<< Previous ... 2 ... Next >>". Number 2 would mean "yesterday" (the first result is today's six word story, nr. 2 yesterdays and so on). What I want to do is alter the text (which now is just a number), so it would show the post date of the shown node/story.

I know that the labels can be altered, but there are only four labels (first, previous, next, last). It seems that there is no label in the pager plugin for the current page. Any ideas on how to alter the label without breaking the actual pager itself?


texts: View restricted to a specific taxonomy term

texts:
I have a custom content type called Property with taxonomy term fields set up for example for vocabularies Train Station, Style, and Area.

I would like to create a view showing only those Properties with a specific term within the taxonomy for example only the ones with the term London Bridge in the Train Station vocabulary.

I assumed this would be Filter Criteria in the view, however the only related option I can see is Content:Has taxonomy term which brings in all Properties that has Train Station - but I cant see how I can add the extra filter of only London Bridge within Train Station

Any ideas?


texts:
Can I associate an image field to a taxonomy term? I need to do this in my panel that lists the children terms (with images to make it look nice) of a parent term page. I have already added image field in vocabulary thus images for each terms.

I'm on D7.


texts:
I'm working my way around Drupal API with limited success.

I want to have a URL with a form in it, so that when I "GET" that URL I get the form (have that), when I input a wrong "code" into that form and POST that same URL I get the same form with an error message (have that too), but when I POST that same URL with the right "code" I get a different code, no longer displaying the previous form.

No redirects, all the requests (posts and gets) should be targeted to domain.com/entry

This is a code I have (simplified):

function entry_menu() {
    $items['entry'] = array(
        'page callback' => 'entry_handler',
        'access arguments' => array('access entry'),
        type => MENU_CALLBACK,
    );

    return $items;
}

function entry_handler() {
    return drupal_get_form('entry_daily_code');
}

function entry_daily_code($form, &$form_state) {
    $form['code'] = array(
        '#type' => 'textfield',
        '#title' => 'Code for Today',
    );

    form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Access',
    );

    return $form;
}

function entry_daily_code_submit($form, &$form_state) {
    if (isset($form_state['values']['code']) && $form_state['values'] == "1234") {
        drupal_set_message(t('Success'));
    }
    else {
        drupal_set_message(t('Fail'));
    }
}

I imagine that what I want to do should happen in "entry_handler".

It needs to know the status returned by the form, and to either return the form, or a different content, but I'm failing at that.

Made a diagram to illustrate my point, in case it wasn't coming across:

Thanks for any pointers in the right direction.


texts:
I asked this last time with 'Select Other', but I am still not understanding how to change custom element's type. In this scenario, I am attempting to build a Select type webform element. I am reusing the Webform Example attached to the webform module. But my issue is that I can not change it from an <input> to a <select> type.
Inside, \webform_example_element\src\Element\WebformExampleElement.php I have tried:
  public function getInfo() {
    $class = get_class($this);
    return [
      '#title' => $this->t('Facility'),
      '#type' => 'Select',
      '#input' => false,
    ...
   }

AND I have tried:
  public static function processWebformAssignedBy(&$element, FormStateInterface $form_state, &$complete_form) {
    $element['#tree'] = true;
    $element['#type'] = 'select';
    $element['#input'] = false;
    $element['#options'] = [
      '1' => 'One',
      '2' => 'Two',
    ];

Using X-Debug, when the page is loaded I get:
$element = {array} [48]
 #type = "select"
 #title = "current_facility"
 #multiple = false
 #access_create_roles = {array} [2]
 #access_update_roles = {array} [2]
 #access_view_roles = {array} [2]
 #webform = "generate_system_number_form_1_"
 #webform_id = "generate_system_number_form_1_--current_facility"
 #webform_key = "current_facility"
 #webform_parent_key = "net_new_process_information"
 #webform_parent_flexbox = false
 #webform_depth = {int} 1
 #webform_children = {array} [0]
 #webform_multiple = false
 #webform_composite = false
 #webform_parents = {array} [2]
 #admin_title = "current_facility"
 #webform_plugin_id = "facility"
 #webform_submission = "121"
 #access = true
 #webform_element = true
 #allowed_tags = {array} [78]
 #element_validate = {array} [1]
 #pre_render = {array} [1]
 #after_build = {array} [1]
 #_webform_access = true
 #_webform_states = {array} [0]
 #theme = "input__webform_example_element__webform_generate_system_number_form_1__form__current_facility"
 #theme_wrappers = {array} [1]
 #formdazzle = {array} [3]
 #process = {array} [3]
 #input = false
 #value_callback = {array} [2]
 #defaults_loaded = true
 #tree = true
 #parents = {array} [1]
 #array_parents = {array} [3]
 #weight = {float} 0.007
 #processed = false
 #required = false
 #attributes = {array} [1]
 #title_display = "before"
 #description_display = "after"
 #errors = null
 #id = "edit-current-facility"
 #name = "current_facility"
 #value = ""
 #options = {array} [2]

But after returning, I still get an <input> field. Any suggestions how to alter the input type to be select? Thank you


texts:
So, I have a hook_menu creating a page like category/page. I allow two parameters on this URL. It looks like this :

// Menu declaration
$items['category/page'] = ...

// Page argument
'page arguments' => array('myModule_form', 2, 3),

So, I can have URL like this category/page/param1/param2.

I want to have context that works on all the possible URL. So I tried multiple solutions for the path of the context : category/*, category/*/* and category*. But, in every case, the context only works for category/page. Just adding an arguments breaks it.

Any solution?


texts: Is displaying a working Field Widget Form on its own possible?

texts:
I'm interested in embedding a Field Widget Form out side the context of the whole node edit form.

I have displayed full forms in the past using drupal_get_form but that doesn't seem to apply for solitary Field Forms.

Is displaying a working Field Widget Form possible? What would be the best way to do so?

Both field widgets and "normal" forms seem very alike, so if this is not possible, what would be required to "change" a widget form into a normal form?

This question appears to be asking for something similar but I don't understand the answer.  That answer specifies using hook_field_widget_form_alter; what I don't understand is how to get the Field Form to be displayed not how to hook it once it is being created.


texts: Is this SQL query even possible in Drupal 7?

texts:
I'm trying to find a way to run this query in a custom drush command to dump chunks of data from the DB into CVS files.

The query works fine directly in the terminal but I was wondering how would you do it in code for Drupal 7? I guess I can transform a PHP array to a CVS file but wanted to know if Drupal has a way to write more complex queries like this :)

Big thanks in advance!

Query:

SELECT uid, name, mail INTO OUTFILE '/path/sqldumps/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM users
WHERE uid != 0


texts:
I was following topic. I can including image style in my custom module. But I have a problem. I can't reinstall module because of following error:

  Unable to install Module ABC, image.style.black_white already exists
  in active configuration.

Can I include an image style in custom module with file config and maybe reinstall module?


texts: Preprocessed var not being passed to twig template

texts:
I created a custom theme called wdocs as a sub theme of d8w3css. I made a template to override the menu template for the user account menu, calling it menu--account.html.twig. For my theme, I added the function wdocs_preprocess_menu__account() to my wdocs.theme file, and introduced a new variable with $variables['tollfree_number'] = '555-1212'; So far so good; in phpStorm I can set a breakpoint there are do see it is getting set in $variables. In my twig, I have some text, followed by {{ tollfree_number }}. The text gets displayed, but not the variable.
The problem is the twig calls a macro; I can access the var outside of the macro, but not within it. Googling suggested I pass context when calling the macro, so I changed the call to
{{ menus.menu_links(items, attributes, 0, menu_name, _context) }}

I also tried "context" (no underscore). And also tried dereferencing it with {{ _context['tollfree_number'] }}, but nothing seems to help. Where am I going wrong?


texts: Creating a view with relation between taxonomy term fields of two different content types

texts:
I have two content types - Page and Article, both having a field called "tag"(entity reference to taxonomy term) and both using the same vocabulary. I want to create a block "Linked Articles" and display it in "Pages". The block should contain a titles of all "linked" articles. With "linked" I mean articles which have the same tag(s) that current page has.

For example, I got pages:

Sport(tag="sport")
Music(tag="music")
Food(tag="food")

and articles:

Article about Rap Music(tag="music")
Article about Jazz(tag="music")
Article about Football(tag="sport")
Article about making a Pizza(tag="food")

The result:
When I open "Music" page, there is a block "Linked articles" containing "Article about Rap Music" and "Article about Jazz" and so on...


texts: How to implement click event on dynamically generating ?

texts:
I have a drop down select box. Through jquery on run time that drop then hides and the new drop down made which made from <ul> and <li> tags.

Now through firebug I notice that when the drop down is closed then there is one <li> and when I expand the drop down then in the firebug more <li> displayed.

So I want to implement the click event on these <li>.
I tried this code.

 $(document).ready(function() {
  alert('a');
  $('.fb li').each(function() {
      alert('li');
    $(this).click(function(event) {
           alert('hed');
        var fbpage = $(this).attr("rel");
        if(fbpage != 0) {
            window.open(''+fbpage+'', '_blank');
        }

    });
    });
    });

the alert('a') and alert('li') works but then that click event is not working.

Any idea about this? and if you does not understand my question then ask me I will explain it more.


texts: Use image from view as background image of div in page.tpl.php

texts:
I need to use the image resulting from a view as the background image to a div in my page.tpl.php.

I am able to render the page title with the view below it using:

    <?php print $title ?>

  <?php $views = views_embed_view('photos', 'block'); print render($views);?>

However, is there a way that I can pull the image from the view, and use it as the background image for container-inner?


texts: Problem with displaying field using Views

texts:
My goal is to use Search API so that I can create a custom search page using Views.  I want to add the "rating" widget (rate module), but there is no way to include it in the Search API fields. Thus, I tried to fix it by adding custom field to Search API index.

function rate_entity_property_info_alter(&$info) {
  $info['node']['properties']['widget'] = array(
    'label' => t('Rating widget'),
    'description' => t('Rating widget'),
    'getter callback' => 'display_widget',
  );
}
function display_widget($node) {
     print rate_generate_widget('1', 'node', $node->nid);
}

However, I am getting AJAX errors

and problems with displaying widgets.

Please can someone help me to solve this problem.

Thanks


texts:
Problem

I'm creating a search page for a module. On that page I have an exposed views filter block and I'd like to put it into a jQuery accordion.

In case it's relelvant: In the same sidebar below the filter block I have a series of facets which use the Facet API Collapsible Module.

At the moment I've put the script "facetaccordians.js" in mytheme/js/ and added it using the .info file.

What I've tried so far

Here is the .js file.

(function ($) {
        $(function() {
               $(document).ready(function(){
                    $(".views-exposed-form").accordion();
                });
            });
})(jQuery);

This selects the following horrible bit of HTML:

But the accordion doesn't work correctly. It doesn't open and close.

I tried adding in
Test
 into the tpl.php for views exposed forms to give this:

However it still doesn't work. And that will cause me a bunch of other problems. What's the correct way to put this block into an accordian? OR what am I doing wrong? Do I need to select a div above the current ones, do I need different HTML?

(I know about the Accordian Blocks module, but it doesn't work either. The open close also doesn't work)


texts:
Following what reported in the documentation for hook_views_query_alter(), I created a file named alterform.views.inc and put it into an enabled module called alterform. I added  the following code in alterform.views.inc.but it doesn't work.

function alterform_views_query_alter(&$view, &$query) {
  switch($view->name) {
    case 'myViewName':
      echo 'test test'; // test
      $query->orderby[0] = "FIELD(node.type, 'story', 'page', 'productTypeC', 'productTypeD') ASC";
      $query->orderby[1] = "node_title ASC";
      break;
  }
}

why doesn't it output "test test"? What's wrong with my code?

there is still no output of test and views. what's wrong with my code? thank you


texts: Extend db query in CKEditor Link User module

texts:
The CKEditor Link User module has essentially the functionality I need, but it requires editors to know users by their 'name' field in the users table.  I wanted to extend the query to join with the field_data_field_full_name table so that editors could type full names to populate suggestions.  The original code:

<?php

/**
 * Implementation of hook_ckeditor_link_TYPE_autocomplete().
 */
function ckeditor_link_user_ckeditor_link_user_autocomplete($string) {
  $matches = array();

  $result = db_select('users')
    ->fields('users', array('uid', 'name'))
    ->condition('name', '%'. db_like($string) .'%', 'LIKE')
    ->range(0, 10)
    // ->addTag('user_access'); // Make a proper access hook
    ->execute();

  foreach ($result as $user) {
    $matches['user/'. $user->uid] = t('User: @name', array('@name' => $user->name));
  }

  return $matches;
}

...

My attempt (edited after SO thoughtfully pointed me here):

<?php

/**
 * Implementation of hook_ckeditor_link_TYPE_autocomplete().
 */
function ckeditor_link_user_ckeditor_link_user_autocomplete($string) {
  $matches = array();

  $result = db_select('users', 'u')
  $result->join('field_data_field_full_name', 'ft', 'ft.entity_id = u.uid')
    ->fields('u', array('uid'))
    ->fields('ft', array('field_full_name_value'))
    ->condition('field_full_name_value', '%'. db_like($string) .'%', 'LIKE')
    ->range(0, 10)
    // ->addTag('user_access'); // Make a proper access hook
    ->execute();

  foreach ($result as $user) {
    $matches['user/'. $user->uid] = t('User: @name', array('@name' => $user->field_full_name_value));
  }

  return $matches;
}

...

In the CKEditor Link pop-up, I get a "An AJAX HTTP error occurred.
HTTP Result Code: 500 Debugging information follows. Path: /ckeditor_link/autocomplete StatusText: Internal Server Error..." Nothing is showing up in the error log.  I have set Devel to show SQL queries, but I don't see the Ajax query from autocomplete anywhere.


texts:
While I have been able to use the LDAP authentication hook
(hook_ldap_authentication_allowuser_results_alter) to perform additional authentication,
I have not been able to use what I thought was the LDAP authorization hook
(hook_ldap_authorization_maps_alter, defined in the LDAP authorization module, file ldap_authorization.api.php) - the hook never gets executed.

The purpose is to assign user roles to newly created, LDAP-authenticated accounts (therefore I need a Drupal ID). We can't currently use LDAP-Drupal user role mappings because our LDAP does not contain the necessary information to determine the role; instead we need to tap a different database to determine this, and I was hoping that there would a hook somewhere during account creation.


texts:
I have set up a View to show a list of stories, and then set up an attachment to my View that puts the first 4 stories at the top of the View styled differently. I need those 4 to only show on the first page of items. Every other page will show the normal styling without the top 4. I have created a custom module using the following code. However, now every item is showing on one page. I have set number of items for the pager in the main view to 10 with an offset of 4, and in the attachment it is set to 4. Any suggestions?

<?php
/**
 * Implements hook_views_pre_build().
 */
function custom_stories_views_pre_build(&$views) {
  if($views->name == 'stories' && $views->current_display == 'block_1') {
    // if 'attachment_1' is not defined, we assume it is the first page.
    if (empty($_GET['attachment_1'])) {
      // The offset number y should be equal to the number of items on
      // attachment. If we want to keep the total n items on list, the
      // number of items on main display should be (n - y).
      $item_num = $views->get_items_per_page() - $views->get_offset();
      $views->set_items_per_page($item_num);
    }
    else {
      // Remove attachment for other pages.
      $views->is_attachment = TRUE;
      // We don't need to handle the offset anymore.
      $views->set_offset(0);
    }
  }
}


texts: How can I make an order generated through Services invoke hooks or checkout complete?

texts:
I am stuck at integrating a Drupal Commerce store with Services.

I setup a REST server. In several steps I can login, create a user, create user shipping/billing profiles, create an order, add line-items to that order. This works fine, even a correct total gets calculated. I then need a bunch of rules and some hooks to get triggered to make invoicing happen and to send out emails. This fails. I tried to trigger this by changing the order status. Maybe I haven't done it right.

Drupal 7 Modules I use:

Services
Commerce Services
Services Entity

How can I make a D7 Drupal Commerce order generated through Services invoke hooks and rules? To make it simpler: How can I invoke the checkout complete process through services?


texts: Is there any easy way to set the default author for a node being edited to the current author if it is currently anonymous?

texts:
The site I am working on has a lot of Anonymous nodes because it is a migration from a system that didn't have a proper user system.  Users can claim their articles by going in and editing the node and changing the system author, but I'd like that to happen by default whenever someone (preferably someone who is not the administrator) edits a node that has the anonymous author.  I'm sure it must be imminently doable through some form alter or form preprocess hook, but I don't quite get the drupal form system yet.  Solutions and pointers to good sources of information both welcome.

UPDATE I refined this question here: How can I set a default node owner for anonymous nodes on the node edit form?


texts: Can I access more information (user inputs) using delta index?

texts:
I am working on an edit form of a content type, which contains several related inline_entity_form, let's say ief1 and ief2. When I fill and submit ief1 and come to ief2, I need to access the input on ief1 to pre-populate some fields of ief2.

I have used hook_inline_entity_form_entity_form_alter() and it return delta indexes of the submitted items of ief1.

How can I access the data I have entered to ief1, before the whole form submission?


texts: How do I get commerce_message to send order fullfilment message?

texts:
I have installed commerce_message and cloned the 'send order email'. It gets fired, but no 'message' gets saved in field_data_field_message_rendered_body and no message gets sent.

The rule does get triggered. Turning on 'log all warnings and errors, sending it to the 'system log' and doing drush ws --full --tail I find that the rule is being run.

Rule Commerce order message: admin order e-mail  fires. [edit]
0 ms Rule Commerce order message: admin order e-mail  fires.
2.046 ms Evaluating the action entity_create. [edit]
2.478 ms Added the provided variable entity_created of type message [edit]
2.93 ms Evaluating the action data_set. [edit]
3.254 ms Evaluating the action entity_save. [edit]
3.334 ms Saved entity_created of type message.
21.324 ms Evaluating the action message_notify_process. [edit]
195.957 ms Rule Commerce order message: admin order e-mail  has fired.

The rule is

{ "commerce_message_commerce_message_admin_order_e_mail_" : {
"LABEL" : "Commerce order message: admin order e-mail ",
"PLUGIN" : "reaction rule",
"WEIGHT" : "3",
"OWNER" : "rules",
"TAGS" : [ "Commerce Checkout" ],
"REQUIRES" : [ "rules", "message_notify", "commerce_checkout" ],
"ON" : { "commerce_checkout_complete" : [] },
"DO" : [
  { "entity_create" : {
      "USING" : {
        "type" : "message",
        "param_type" : "commerce_order_order_confirmation",
        "param_user" : [ "commerce-order:owner" ]
      },
      "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
    }
  },
  { "data_set" : {
      "data" : [ "entity-created:message-commerce-order" ],
      "value" : [ "commerce-order" ]
    }
  },
  { "entity_save" : { "data" : [ "entity-created" ], "immediate" : 1 } },
  { "message_notify_process" : {
      "message" : [ "entity-created" ],
      "save_on_fail" : "0",
      "save_on_success" : "0",
      "mail" : "[site:mail]"
    }
  }
]
}
}

A clone of the default rule I get with commerce message.

Nothing happens as a result though. I would like to send the shop owners a note that the order has been checked out and they should do something with it. Ideally with some order details in the message.

The only complications I can think of is that we have mailmime, mimemail htmlmail (for other modules) and messaging_htmlmail.

I am getting the 'account creation' email.


texts: changing user profile path doesn't really work

texts:
I'm new in Drupal and have only been touching this for the past two weeks.

I have read several stuff and managed to change the user path from www.example.com/users/[user:name] to www.example.com/[user:name] following this thread.

However, when I view other person's profile page, that whole page information is still mine. For example I logged in as Tamia, wanted to view Jack's profile page.
What I see is the URL really changed to www.example.com/jack-white but username, cover pictures, everything else other than URL and metatags still showing Tamia's.

I'm using Drupal Commons 3 and sadly they don't have documentation for many things.

I tried to view what $vars has in template_preprocess_page and couldn't see much information to change information pointing to Jack instead of Tamia.

Could anyone point where am I missing, please?
Thank you in advance.


texts:
Thanks to Drupal 8 new field storage architecture, we can read everywhere that we can use other database than Sql, for example MongoDb, to store fields data.

I have a custom entity with some custom fields which will have to store a lot of (small) rows in database. I want to use the Drupal Entity, as recommended, (fieldable, etc) to store my data, instead of using a custom table like I did before with Drupal 7.

I ask myself if it's possible to use another database storage than Sql ; like MongoDb for my specific entity. I read some example for Drupal 7 but I'm not sure how to do with Drupal 8. There is Mongodb module, about more or less ported to Drupal 8 but it's not very clear.

Thanks for your comments and your help.


texts:
I'm new to Drupal and a little bit confused.

I want to make entity_types translatable by using the i18n module. Content types are already perfectly translatable, but I couldn't find out how to duplicate that. I managed to use the hook_i18n_string_info() to kind of register entity_type to the translation module this way:

$groups['entity_type'] = array(
  'title' => t('Entity Type'),
  'description' => t('Translatable entity types'),
  'format' => FALSE,
  'list' => TRUE,
);

When I do this, under "Administration -> Configuration -> Regional and Language -> Translate Interface -> Overview" I now see the column "Entity Type" with "n/a" at the target language and "0/0" at the default language.

After switching to the tab "translate", under "Limit search to" I can select "Entity Type", but nothing is found (the message "No strings available." is displayed).

After switching to the tab "strings", I can select "Entity Tape", but after clicking on "refresh strings" it says "Cannot refresh strings for Entity Type." (5/5 items were processed, I suppose these are the standard entity types?!).

What I tried so far but without any effect was the hook_i18n_object_info():

$info['entity_type'] = array(
  'title' => t('Entity Type'),
  'class' => 'EntityType',
  'key' => 'id',
  'base path' => 'admin/structure/entity_type/edit',
  'placeholders' => array(
    '%entity_type' => 'name',
  ),
  'edit path' => 'admin/structure/entity-type/%entity_type/edit',
  'translate tab' => 'admin/structure/entity-type/%entity_type/translate',
  'string translation' => array(
    'textgroup' => 'entity_type',
    'type' => 'type',
    'properties' => array(
      'label' => t('Label'),
    ),
    'translate path' => 'admin/structure/entity-type/%entity_type/translate',
  ),
);

I did not find anything useful about this topic but this link: http://hojtsy.hu/blog/2011-jun-01/challenges-satisfy-translation-needs-drupal-and-how-do-you-code-it-now

I frequently emptied the cache with "drush cc all" and used "drush fra" also.

Thanks in advance!


texts: How can i move a secondary level Tab to the parent Tabs

texts: I use the Profile2 module and i get in the user edit view the secondary tabs with the extra profile information. How can i move it to the parent tabs and hide the child tabs: "Edit | Info".


texts: Show active taxonomy term as title of product category view

texts:
Commerce kickstart comes with a view named Collection products that shows: a Collection of products (Product display).
In the relationship's tab of this view there are 2 relationships:
1. Product category field_product_category
2. Belongs to Collection field_collection.
The contextual filter is set to: Indexed Node: Product category (field_product_category) and the path to this page is product_category/%.
There is a menu block showing above this view that comes from the same view showing all the category terms as links.
When you click them, you see that the view shows correctly all the products referring to that term.
My problem is that the term that is active (e.g. url: category/beef) doesn't show as a title right above the view or in the block.
How can I achieve that?


texts:
When I click 'reply' button on the comment, a new comment form open in new Windows; but subject box does not contain 're:' or like that and my reply saves as a new comment.

How can I repair my comment system?

Regards.


texts: How can I hide specific user from dropdown list of users

texts:
Could you please help me with one little question. I'm using Drupal module Support Ticketing System.

When the support ticket is created user can choose from dropdown form for whom this ticket is assigned. Usually it's a list of Drupal site users.

How can I hide a specific user from this list (admin for example)?


texts:
Which is the best way to attach a collection of nodes to another node?

I'm creating a meal and ingredients nodes. I want to assign multiple ingredients to a meal and I'd like to do it programatically via modules ( content types )

Which is the best way to achieve this? Can you point me to the right direction ( links, etc...)

Thanks


texts:
I have an exposed views form, am geolocating in javascript and setting the co-ordinates in the exposed form.

This form submits properly when I click on the 'apply' button but does not when I use javascript to submit the form. The page refreshes, but the values have not been changed.

The form is standard FAPI. It is not a views-ajax form although I would like to move to ajax at some point in the future when I sort out the problems with gmaps + ajax.

Both of the following fail.

jQuery('#edit-submit-studio-locations').click();
jQuery('#views-exposed-form-studio-locations-page').submit();

The full code is in github.


texts: Deleting the files associated with my node is VERY slow

texts:
I've got a node which has around 50 files associated with it. The files are stored on Rackspace Cloud Files. Interacting with Cloud Files was very slow, but I've fixed that now and the actual delete operations are running very quickly now. However, there is sometimes a gap of 3-5 seconds between each attempt to delete a file. I added some logging to the unlink() method so I could track how fast the requests were happening.. here is an abbreviation snippet of the log:

[11:55:31 2012] starting to delete rcf://videos/thumbnails/1702/thumbnail-1702_0001.png
[11:55:31 2012] deletion complete

[11:55:36 2012] starting to delete rcf://videos/thumbnails/1702/thumbnail-1702_0002.png
[11:55:36 2012] deletion complete

[11:55:40 2012] starting to delete rcf://videos/thumbnails/1702/thumbnail-1702_0003.png
[11:55:40 2012] deletion complete

So, each delete operation is taking essentially no time, but in between each call to unlink() there is 4-5 seconds. This continues for the remaining files, so it takes SOOO long to delete a node and I'm in danger of the php process being killed for running too long.

Why would drupal be so slow in between file deletes? What might cause this? Where can I look to determine what is taking so long?


texts:
I've had experience creating product catalogues in Drupal 7, but this is my first time using Drupal 8.

I have some categories defined as a taxonomy, and I simply want to create category pages that show the products in that category, with a friendly URL, e.g.:

/products/my-category-name

I'm not expecting anyone to explain the full process, but I'm hoping someone has a link to a decent guide/tutorial as so far hours of Googling hasn't uncovered anything.

The official Commerce documentation goes into making search pages and using facades and filters, but I don't need anything that complicated.


texts: How can we create a search form to display a specific node

texts:
I need to create a result publishing system in drupal.

there must be a search page to enter the student register number.

when the user enter the register number it should take it to a single specific node.

here the register number is a nodeid

so when a user enter the node id and hit show button, it should display that specific node.

which method is best.

i think with views we can do this.

but how

thanks


texts:
I have created various menus, via the menu structure->menu page in Drupal for various pages in my site.  I want to have some, if not all, of these menu links to open in a new page. You can not add target="_blank" to the path in the menu screen and I don't want to add a new module right now.

I am trying this:

Drupal.behaviors.externalMenu = function (context) {
  if (jQuery().attr) {
$(document).ready(function(){
  $('.page-node-166 a', context).attr('target', '_blank');
});
}}

My Steps: created a new js file, added the above code, went into my themes .info file, referenced this js file in the scripts section, refreshed, a few times, nothing works.  Links still open in current window.

What should be happening in this code snippet is, find this class[page-node-166], which is the page, then for any link on that page, open it in new window.  My first time attempting this so I don't know if I am missing a step.

How can I have menu links open in new window in drupal 7?

=====================

Update:


texts: Drupal site being hit with non-sensical requests from redirected page

texts:
For about a month now, our website has been being bombarded with odd page requests (that I am seeing in dblog).  I'm thinking it might have something to do with a redirect that we've set up, but we're not sure.  We have two domains, let's say www.example.com and www.otherexample.com.  The default page for example.com goes to example.com/drupal, and otherexample.com (being just a catchy name for a certain department) directs back to example.com/drupal/specificdept.  The requests coming in look like someone is attempting to get to pages that exist on the main example.com site, but they're somehow injecting drupal pages onto the end of where otherexample.com redirects.  There is no referrer given, and the requests come from several dozen IPs.

In the dblog I'll have entries like this:

  Page Not Found: www.example.com/drupal/specificdept/robots.txt

  Page Not Found: www.example.com/drupal/specificdept/favicon.ico

  Page Not Found: www.example.com/drupal/specificdept/drupal/node/260

  Page Not Found: www.example.com/drupal/specificdept/drupal/otherdept/info

If I try to navigate to www.otherexample.com/test1, it takes me into example.com/drupal/specificdept/test1, tells me it doesn't exist, and shows no referrer just as the other requests do.  This may be more of a DNS/redirect handling question, but is there a way to prevent someone from doing a crawl on the otherexample domain?  If not, is there a way that regardless of what additional url directories they enter, it will take them back to otherexample.com/specificdept?


texts: Should we use drupal_exit() after drupal_goto()?

texts:
I think, drupal_goto() breaks the execution so next lines of code won't execute after drupal_goto(), Am I right? Somebody recommended me to use drupal_exit() on the next line of the drupal_goto().

Is it necessary? Will the code after drupal_goto() execute ?

Please guide me.


texts: Can't save settings after copying site to new server

texts:
I just recently copied a Drupal 7 site from one server to another, everything looks like it works fine except that I cannot save any settings.

Here are some other symptoms:

I can't disable or enable modules
Overlay doesn't work
Once I log out, I can't log back in
When trying to log back in with the wrong criteria, I don't get a message about the user/pass being wrong
admin_toolbar doesn't work (except immediately after clearing cache via drush)
Status report doesn't show anything being wrong

I've got varnish running on the server and I'm not quite sure if that would have anything to do with it.


texts: How to hide a block based on content type?

texts: I have a custom content type where when loaded, I want to HIDE (no show) a regions block. Been looking around trying to find the answer and have come up short. Ideally, I'd want to do it in a preprocess or something, not within a template. Tried accomplishing it with Context, but appears that only allows you to add blocks to regions, not remove them. Fairly new to Drupal, so bare with me.


texts:
I'm looking for a content and data migration module.

Which are commonly used?


texts: Custom Apache Solr search per usertype (Profile2 Module)?

texts:
I have a site that enables you to register either as a "Care giver" or a "Patient". The patient has a different profile (Profile2 module) with options such as the type of care they need, the amount of money they can pay a care giver, etc.

The care giver profile has a work profile (much like a resume).

What I want to accomplish:

Create a custom "Search patients" search for the care givers
Create a custom "Search care givers" search for the patients.

How do I limit apachesolr to a profile2 search?


texts: How do I override a view template in my theme folder properly?

texts:
I do not know if I am something missing, but I have a View in Drupal 8 and wanted to make a Template override in my theme, where I would print-out the image URL of one field and set it as "background-image" via inline CSS.

So I turned on theme debugging to see the template suggestions and picked views-view-field.html.twig, copied the file to my theme, renamed it to match the suggestion, cleared the cache and it looks like the template override is working.

But all the variables I am trying to print-out are blank, even after clearing the cache the field just disappeared. When I try to dump() or kint() any variable written in the file (view, field, row, output) it prints "null" or completelly nothing.

What am I doing wrong?

I am sure template override works, because when I type regular text in a file it gets printed out, but all the variables are somehow missing and I can not print anything out of them.


texts: hook_form_alter or overriding the routing and UserLoginForm class

texts:
I am trying to add another mechanism for login into Drupal (adding an SSO function which would validate based on some criteria that a third party system will provide to Drupal).

I am trying to decide whether using hook_form_alter() (like I would in Drupal 7) is the more "Drupal 8" way or if altering the routing (shown below) so that it goes towards my custom login class that extends UserLoginForm would be a better option. I am guessing that the second approach is considered the "proper" way to do things.

Routing:

user.login:
  path: '/user/login'
  defaults:
    _form: '\Drupal\user\Form\UserLoginForm'
    _title: 'Log in'
  requirements:
    _user_is_logged_in: 'FALSE'
  options:
    _maintenance_access: TRUE

Class I would be extending in my own custom class:

class UserLoginForm extends FormBase {

}

So my real question is this - if I need to override the login mechanism (including both the SSO functionality as well as standard Drupal authentication if the SSO login fails), what is the "proper" method to do this?


texts: Probable database character encoding error with chinese multilingual translation

texts:
I am doing translation of a site's content from English to Chinese but upon saving the translation for a node(I previously did a few blocks) I get the error below. My search led me to questions like configuring drupal to use unicode characters but I just need another perspective to see if this is a different type of problem (because I already translated blocks and menus with the chinese characters) and how would I solve it.

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value:
'\xF4\x8F\xB0\x80\xE5\x8D...' for column 'field_overview_value' at row 1:
INSERT INTO {field_data_field_overview} (entity_type, entity_id, revision_id,
bundle, delta, language, field_overview_value, field_overview_format) VALUES
(:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2,
:db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5,
:db_insert_placeholder_6, :db_insert_placeholder_7); Array (
[:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 1547
[:db_insert_placeholder_2] => 7588 [:db_insert_placeholder_3] => product
[:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und
[:db_insert_placeholder_6] =>

 业内最可靠的视频服务器平台

作为视频服务器和存储系统的市场领导品牌,
SpectrumTM 是一 体化制作和播出系统以及完全基于文件的工作流程的理想平 台。
模块化的系统架构可以保证最大的稳定性和灵活性,使 得全球的制作人和电视专业人员都选用
Spectrum 来实现高效 的无带化工作流程。这个系统可以完全胜任于下列范围的工 作:

 从模拟到数字的设备改造,完全遵从国家标准

 从磁带到硬盘播出的改造,升操作效率

 从标清到高清的升级,升广播质量

 从单频道播出升级到多频道播出,遵从市场需
求

整合了广播视频技术领域的专家与信息技术方面的最佳实 践,Spectrum 供了最具
性价比,开放和灵活的视频服务 器,满足播出环境的严苛需求。 ￼￼￼￼ ￼
 &nbsp;

 主要特点

 独立的可扩展通道、存储、带宽并且保证冗余,智能、高 性价比架构。

在已有系统中添加新的组件即可实现高清或者 3D 播出, 确保完全的投资保护。

 在传送、
演播室制作、新闻和体育集锦、分布式播出工作 流程中是最好的基于文件的解决方案。

 可以从几百种播出应用中自由选择,基于开放标准和开放 API。

&nbsp;

 CNN - Aquisition, Playout and Storage Case Study

&nbsp;

 NAB 2013 Enter...the Spectrum!

[:db_insert_placeholder_7] => full_html ) in
field_sql_storage_field_storage_write() (line 451 of
 /var/www/html/modules/field/modules/field_sql_storage/field_sql_storage.module).


texts:
I am using a site-alias with Drush 7.0-dev and I can download modules but I can't update the code. I keep getting the following error:

Command pm-updatecode needs a higher bootstrap level to run - you    [error]
will need to invoke drush from a more functional Drupal environment
to run this command.
The drush command 'pm-updatecode' could not be executed.             [error]
Drush was not able to start (bootstrap) the Drupal database.         [error]

However, I am able to use dl to download modules to correct folder. Any advice on this?


texts: how to create user view with last login zero or never logged in

texts:
I am trying to create user view for those user who never logged in. For this i need a filter as last login is equal to zero.
Any body knows how to select filter as last login is zero.

When i used Operator equal to zero it shows a message
Invalid date format.


texts: CCK Date field not showing stored values in node edit form

texts:
After moving a Drupal 6.x site to a new server, I've found that a CCK date field being used by multiple content types is not displaying the values that are stored in the database for the field OR the default value as defined under content management and date field when creating a new node. The field is just blank. For stored nodes, the values are still there when viewing the node, they just disappear when editing it.

I've found two similar issues, but both relate to multilingual support in Drupal 7:
 1. Why some fields values are getting empty when editing a node?
 2. https://www.drupal.org/node/1146056

ANSWER: I upgraded the Date API module to 6.x-2.10 and the problem was fixed.


texts: Entity Reference Views - Contextual Filters - Administrator override

texts:
I have an Entity reference field View with contextual filter with Logged in user ID . The result of this view could be seen by the user only if he/she added some data. That is fine.

I would like to use the same Entity reference field View, so that administrator can view all the results without any restriction.

How can we achieve this.
Thanks for the help.


texts: How can I upgrade ONLY Drupal core with composer?

texts:
I knew that Drush make files were being phased out, but I kept using them, because in my opinion Composer isn't the best package manager in the known universe.  It updates too much or too little, has uninformative error messages,
and takes a lot more ram than necessary.  Don't get me wrong, I still used composer, but not for Drupal core updates, because those are more important and sometimes security releases.

But, in 8.4, Drush 9 is required, and in Drush 9 make files don't work at all.

My concern is this: I have some wildcards in my composer.json similar to the ones mentioned in this issue: https://www.drupal.org/node/2609568 which tell composer where to find my modules' composer.json files.  Yet, when I run

composer update drupal/core --with-dependencies

Whether or not I run it --with-dependencies, it will always go into the merge-plugin include paths and update all of those packages as well.  Now, if my site is out in production, I would like an easy way to update core and core's vendor files WITHOUT updating a bunch of contrib modules' libraries which I do not care about.  What if core releases a security update?  I want to be able to conveniently update core and only core quickly.  With Drush make, this was simple.

Has anyone figured out a way to do this with composer?


texts: How do I let users cancel their account with JWT / JSON:API?

texts:
I am making an Ionic app with Drupal as the backend.  Users log in via JWT.  I'm using JSON:API to send data to Ionic.  Now I want to allow users to cancel their accounts in the app (by JSON:API) instead of forcing them to log into the Drupal website and cancel there.
How can I do that?


texts: I want to re-order the default fields on registration form

texts:
I want to change the order of the default fields on the user registration form like E-mail adress, password ect ...

I have no idea how to order these. (I'm a noob at Drupal by the way)


texts: Fatal Error when trying to log in DRUPAL

texts:
My Drupal 7 website is throwing 500 internal server error, when I try to log in as Admin.

I checked the apache error log it throws below error

 PHP Fatal error:  require_once(): Failed opening required '/*****/******/sites/all/modules/context/context_ui/export_ui/context.inc' (include_path='.:/usr/share/pear:/usr/share/php') in /******/******/sites/all/modules/ctools/includes/plugins.inc on line 480, referer: http://*******/user

What could be the problem ?

Thanks


texts: How to attach a single node multiple times to an entity (e.g. badges)?

texts:
For an experimental Drupal 7 site, I would like attach a single node to another entity (this might be users, other nodes or even organic groups). The reasoning is fairly simple, say I have several users active and they can gain badges for activity just like in any stackexchange platform. Each badge is represented by a single node. Now, how could a user get the same badge multiple times?

Using entityreference, I can attach the same reference multiple times, but I am struggling with the output, it will show the same badge multiple times instead of only badge name and a counter. Is there already a module for that I haven't found yet? Can you think of a better way to do it?

Badges might not be the best example as you normally wouldn't lose any. Think of a trading card game might be better, as you can have the same card multiple times and trade it with another user. So, in the end I would need a way to add and remove the references. But this will be custom code, I guess.

EDIT (in answer to Webdrips' comment):
As said in the very beginning, it's just an experiment so far, we are trying to use Drupal in unconventional ways in order to explore the full capacity of Drupal as a framework.

So, I came up with a better example to illustrate what I would like to achieve: let's say I am building a browser game. Game users will be normal Drupal user entities. An user may have several normal fields like health (number), name (text) and gender (list). Additionally, this user can collect items where each individual item type can be found multiple times.

Several players can be in a clan (organic group). This group has a central storage. So, each individual player of that group can place an item in the central storage.

Technically, I need a relation between user and item (for each item type) which also holds the number of items (e.g. Player1 has 5 nails). If he places 2 nails in the central storage, I need to change the relation between user and item (e.g. Player1 now has 3 nails) as well as the relation between organic group and item (e.g. Group1 has 2 nails).

So I am actually looking for a way to connect an item node (e.g. nails) to other entities (users, organic groups, ...) along with an additional value (item count).

I hope this renders my problem/question in an easier-to-understand way.

I've come across the User Points module and for keeping track of game points in my example this might be the right way to go, but imho it's not suited for the item thing.


texts: Theming a node edit Form - Move Author Information to another positon

texts:
I am theming the DRUPAL 7 NODE EDIT FORM following the instructions in the post.

Everything is working fine.

However, I want to move the "Authoring Information" from the bottom of the page to another position on my node. How do I do that?

I thought I would be able to use this:

<?php print drupal_render($form['author']); ?>

But it does not seem to work.


texts: Panels page variant that targets a single node

texts: I am a little new to Panels, but I am using it to manage layouts for different content types and it is working out really well. However I want to be able to create a page variant that will only target a single node. Is there any way to do this based on the node's id?


texts:
I'm creating a website with a Project content type. In that content type there are common fields and a few group fields. Group fields are fields that need to stay together and can be added multiple times. So in my Group fields there will be a date field and a text field that can be added multiple times.

Do I need to create a new content type or taxanomy type for this or is there a module for Drupal 8 that provides this behaviour.


texts:
I'm using the Flag Lists module to manage user wish lists. I need to add additional fields to the lists such as "body"
I go to /admin/structure/flags/manage/fl_template/fields add the required fields, save, rebuild flag lists, flush caches and attempt to edit existing flag lists or create new ones and I still only see the "title template."


texts:
I have set up quicktabs programmatically - all working fine. Code is as follows:

    $tabs['overview'] = array(
        'title' => 'Title of tab',
        'contents' => $content,
        'weight' => 2,
    );

.. etc

    $qt_options = array(
        'style' => 'nostyle',
        'ajax' => FALSE,
        'default_tab'=> 'overview',
    );

    $qt_name = 'project-tabs';
    $qt_project = quicktabs_build_quicktabs($qt_name,$qt_options,$tabs_project);

Issue: I need to add a rel='nofollow' to the quicktabs.  Are there any attributes option I can pass to the $tabs array? Similar to using the l() function?  I've looked and tried a few things, but nothing seems to work.


texts: Webforms - Customise PDF format using entity print , Dompdf and PDF attachment field

texts:
I am using entity Print module and Dompdf as the PDF engine.
Added the PDF attachment field to my webform.Need to customise the PDF display using twig template.
Currently when I add my HTML = Twig variable View mode , the PDF does not show in the format.
Is there a way to add my custom HTML structure and display the PDF in desired style


texts:
I'm getting a 403 error everytime I try to log in with the user #1.

What can I do to get access again?

I have already tried to:

clear all cashes (via Drush)
set the time in both the server and Drupal's timezone, to be sure it isn't a cookie expiration problem