texts:
I'm attempting to calculate an estimated shipping date on products with a turn-around time. Using a variety of fields on separate entities I've been able to get about 75% if the way. I run into a problem when attempting to perform the final calculation on my rule component. For some reason my calculated variable is not available on Input value 2 of the calculation when enabling data selection.

This is what my component looks like:

+ Set a data value:
  Parameter: Data: [order:field-due-date], Value: [site:current-date]
+ Add a variable:
  Parameter: Type: Date, Value: now
  Provides variables: Shipping Date (shipping_date)
+ Loop:
  Parameter: List: [order:commerce-line-items]
  List item: Current Line Items (line_item_list)
    + Apply an interval to a date:
      Parameter: Interval number: [product-display:field..., Interval period: Days, Date: [site:current-date]
      Provides variables: Line Item Date (line_item_date)

At this point I try to add an action "Calculate a value" to the loop; like this:

+ Input Value 1
  Data selector (Select data of the types Decimal number, Date.)
  -- line-item-date --
+ Operator
  Value
  -- max --
+ Input Value 2
  Data selector (Select data of the type Duration.)
  -- shipping-date --

I calculate this in order to overwrite the shipping date with the highest "line-item-date" in order to display an estimated shipping date based on the product with the longest turn-around time.

Here's my problem: the "shipping-date" variable is not available in "Input Value 2". I don't understand why the "select data of type" is "Duration" and not "Decimal number, Date"; although I assume that's where the problem is.


texts: hook_user_login, hook_user_logout not firing

texts:
I created a custom module because I want to execute some actions when a users logs in / out.

function mymodule_user_login(&$edit, $account) {
  $url = 'https://www.some_url';
  $additionalHeaders = '';

  $process = curl_init($url);
  curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
  curl_setopt($process, CURLOPT_HEADER, 1);
  curl_setopt($process, CURLOPT_USERPWD, $user.":". $password);
  curl_setopt($process, CURLOPT_TIMEOUT, 30);
  curl_setopt($process, CURLOPT_POST, 1);
  curl_setopt($process, CURLOPT_POSTFIELDS, $data);
  curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($process, CURLOPT_SSL_VERIFYPEER, FALSE);

  curl_close($process);
}

function mymodule_user_logout($account) {
  $url = 'https://www.some_url';
  $additionalHeaders = '';

  $process = curl_init($url);
  curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
  curl_setopt($process, CURLOPT_HEADER, 1);
  curl_setopt($process, CURLOPT_USERPWD, $user.":". $password);
  curl_setopt($process, CURLOPT_TIMEOUT, 30);
  curl_setopt($process, CURLOPT_POST, 1);
  curl_setopt($process, CURLOPT_POSTFIELDS, $data);
  curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($process, CURLOPT_SSL_VERIFYPEER, FALSE);

  curl_close($process);
}

I tested the code before to put it in the hook implementations, and it works.

Does anyone have the same problem?


texts: Use Injected CacheBackedInterface to invalidate certain bin

texts:
I've got a content type called SERVICE (I write it all capitalized to prevent mixture with drupal service) which admin can introduce different SERVICE using this type, it is expected that these SERVICES be shown in main menu automatically, so I provided a menu plugin deriver which fetches the list of all published SERVICES
The problem is that event of inserting, editing or deleting of a service, does not change the menu as it is cached, so I write a service (not the content type this time) called ServiceEventListner which implements EventSubscriberInterface (provided by Hook Event Dispatcher Module) there I used to rebuild cache on insert, delete and update of SERVICE
using the code:
\Drupal::cache('menu')->invalidateAll();
\Drupal::service('plugin.manager.menu.link')->rebuild();
\Drupal::cache('block')->invalidateAll();

I was able to rebuild cache and menu but for a best practice I decided to inject the cache service rather than calling it directly so I passed CacheBackendInterface as a parameter to my service, but I can't handle to invalidate menu and block bin
The problem is when I inject CacheBackendInterface into my service it has no method to select certain bin and only has invalidate($cid) ,invalidateAll() and invalidateMultiple($cids) methods.
how can I select a certain bin in this case and invalidate all it's corresponding items?
mymoule.services.yml is as follows:
mymodule.node_service_update_listener:
class: Drupal\radis_request_customizer\Service\ServiceEventListner
arguments:
  - '@keyvalue'
  - '@entity_type.manager'
  - '@language_manager'
  - '@messenger'
  - '@cache.entity' <- the injected cache service
tags:
  - { name: event_subscriber }

and this is my construct method:
public function __construct(KeyValueFactory $keyValue, EntityTypeManager $entityService, LanguageManager $language, Messenger $messenger, CacheBackendInterface $cache) {
  $this->cacheStore = $keyValue;
  $this->entityService = $entityService;
  $this->myLanguageManager = $language;
  $this->myMessenger = $messenger;
  $this->myCache = $cache;
}

and finally this is my update method in service:
function updateMenu(EntityInsertEvent $event) {
  if ($event->getEntity()->getEntityTypeId() == 'node' and $event->getEntity()
    ->bundle() == 'service') {
    //TODO: CLEAR CACHE AND REBUILD MENU
    $this->myCache->invalidate('block'); //myCache is the injected CacheBackedInterface
  }
}

should I inject cache differently?


texts: which hook is effective for setting custom breadcrumbs?

texts:
I have a theme which sets breadcrumbs like this:

function mytheme_process_node(&$variables) {
    (....)
    drupal_set_breadcrumb($my_breadcrumbs_array);
}

This gets overwritten later by something else. I need a specific taxonomy value of the displayed node to set the breadcrumb, that's why I am using this hook. How to do it effectively? Perhaps there is a hook which is performed later and still has access to the node object?


texts: Is there any way to tell when a user's password was changed?

texts:
A user tried to log on today and discovered that his password had mysteriously been changed. All I can assume is that he left his computer unattended and someone changed it.

Is there any way to tell when this happened, so as to narrow down who might have done it? I suspect the answer is "no" - I don't see a watchdog entry, and in /var/log/mysql all there is is an error log, not a log of queries.

Is there another place where DB queries might be logged or is there somewhere else in Drupal I could check?


texts: Generate database deltas for insert/update queries

texts:
This is my first question here so kindly bear with me. I am a beginner to drupal and I wanted to know where the fields for content types are stored in the drupal database. For eg.

I have a content type post. I added a custom field to this content type called test_field. Now I want the database entries for this.

I need to apply these changes to an external database for which I have to generate the insert/update queries for them. I have already checked the field_config and field_config_instance and run the insert script on the external database for these two tables but still the custom fields won't reflect there. Is there any other table apart from these two which I need to look into?

Also
Is there any automated way or method to generate scripts for all the new inserts/updates in drupal for content, content types, taxonomy etc? Or is it even possible to do so? Tried googling it a lot but not getting a satisfactory answer. Thanks.


texts:
My page is starting from 0,and I want to start with1.
As follows:

Can implemented in Drupal?


texts:
I need to capture the entity_id when the entity is saved. The ID will process and insert in a custom field. I use hook_entity_presave(), but when is a new entity the ID is void.
Is there any way to capture the ID?

/**
 * Implements hook_entity_presave().
 */
function MY_MODULE_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
  $entity_type = $entity->getEntityType()->id();
  if(($entity_type === 'node' || $entity_type === 'taxonomy_term')) {
    $entity->field_custom_token->value = _process_token($entity->id()); // if entity is new, the ID is Null :(
  }
}


texts: Open a specific View node with a link in an image

texts:
I'm stumped. I'm not even sure how to ask the right questions to search out an answer.

What I have is a View of User Account images in a gallery. So far so good. I have another view of all User Account fields data presented as a node. So far so good there as well.

I want to click on the User Image in the gallery and go directly to that User's node in the other view.

The problem is not with attaching a URL to an image, but enabling sequential URLs to call the correct View node.

I feel like I'm missing some organizational overview understanding here. Maybe it's simple and I'm a doof.

Thanks for any insight.


texts:
In the node.tpl, how do i just get the $author profile page url?

with the $submitted, it prints out other things, all i need is just something like this:

$author

I've also used $name, but this only gives the name without a link.

I would also like to get the link to the current user's profile. Again, just need the username with their profile url only.


texts:
I'm using Drupal 7 + Ubercart 3 and am trying to run a piece of code just before the user adds a product in cart. hook_uc_add_to_cart seems to be the right function to use for it. So I'm trying to utilize it using the following syntax in template.php file of my template

function tbw_uc_add_to_cart($nid, $qty, $data){die('here: ' . $qty);}

where tbw is my template name. I've flushed all caches but the above code does not work as it doesn't die() when I add a product to cart. I suspect the problem is that this hook can't be implemented in a template because the documentation only talks about using it inside a module, i.e., Some modules need to be able to hook into the process of adding items to a cart....
Can anybody please shed some light on why it is not working and guide me in the right direction. Thanks.


texts: Show block only in user own page and for administrator role users

texts:
What I'm trying to achieve:

User can see block only on his own "user/[uid]/my-page" - he cant see that block on other users my-page.
Users who belong to administrator role can see user block on user own page.

Right now my code shows block for user himself and also to administrator role users BUT for administrator role users it shows block on every page - not only in "my-page".

How to modify code to show block only in "my-page" also for administrator role users?

Here is the code:

<?php
global $user;
if (in_array('administrator', ($user->roles))) {
return TRUE;
}
if (arg(0) == 'user' && $user->uid == arg(1) && arg(2) == "my-page" ) {
return TRUE;
}
else {
return FALSE;
}
?>

I used this code as a base: https://drupal.org/node/134433


texts: Login menu which I added in main menu still displaying even after logged-in

texts:
I have used login (user/login) as menu item in the main menu. While I am logged out, it displays login menu link properly.

When I am logged in, still displays me login as a menu item. But I dont want to be displayed or instead  'logout' over their.

I tried adding logout(user/logout) as seperate menu, but still no luck it shows as a separate menu item. Any suggestions?

Thanks in advance.


texts: Javascript not working in body field. Using Full HTML

texts:
I have created a basic page. Inserted the following tripAdvisor your rating widget code in that which contains some javascript. Used Full HTML formatting. But instead of displaying the rating widget it's just displaying the TripAdvisor logo. How can we insert javascript in body?

Edit:
I have tested the same code on another Drupal 8 Website and it's working without any issue in that.

The site on which the code is not working was upgraded to Drupal 8 from Drupal 7 and it's also configured on cloudflare. I tried to put cloudflare on development mode and also disabled the AdvAgg module but thats still not working.

Is there any settings in Drupal 8 which can disable javascripts scripts in Body field?


texts:
I was wondering if there is any good documentation out there on building second level tabs using the menu system. Here is some of the menu code in my module:

  $items['admin/settings/cvminterviews'] = array(
    'title' => 'Interview Scheduler',
    'description' => 'Overview',
    'file' => 'cvminterviews_admin_overview.inc.php',
    'page callback' => 'cvminterviews_overview_page',
    'access arguments' => array('administer cvminterviews'),
  );

  $items['admin/settings/cvminterviews/overview'] = array(
    'title' => 'Overview',
    'description' => 'Overview',
    'file' => 'cvminterviews_admin_overview.inc.php',
    'page callback' => 'cvminterviews_overview_page',
    'access arguments' => array('administer cvminterviews'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10
  );

  $items['admin/settings/cvminterviews/interviewers'] = array(
    'title' => 'Interviewers',
    'description' => 'Interviewers',
    'file' => 'cvminterviews_admin_interviewers.inc.php',
    'page callback' => 'cvminterviews_interviewers_overview_page',
    'access arguments' => array('administer cvminterviews'),
    'type' => MENU_LOCAL_TASK,
  );

  $items['admin/settings/cvminterviews/interviewers/import'] = array(
    'title' => 'Import Interviewers',
    'description' => 'Import Interviewers',
    'file' => 'cvminterviews_admin_interviewers_import.inc.php',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('cvminterviews_interviewers_import_form'),
    'access arguments' => array('administer cvminterviews'),
    'type' => MENU_LOCAL_TASK,
  );

I would like to have

  admin/settings/cvminterviews/interviewers/import

Be a secondary tab to:

  admin/settings/cvminterviews/interviewers

but the above code doesn't seem to do anything with it. Any thoughts?


texts:
is there currently a module that allows a user to bookmark a bunch of nodes and name them? E.g. create a bookmark of each movie and name the list, "comedy".

I'm guessing using the flag module would be the best bet but i'm not sure how to store attributes to flags and how to create separate flags.


texts: Getting the error "No active batch." when running any batch

texts:
I am getting this error when running any batch on the site:

  No active batch.

I thought this may have been a server issue, so I tried it locally, but I got the same error. I tried deleting all the records in the batch table, but I also got the same result.

The only thing I can think of is that perhaps the web server is down. Why would that effect batches that do not connect to their servers?


texts: Restriction on specific content types for admin content page filter

texts:
I need help with removing a content type from admin/content page's content type filter in D8.

Let's say I have content type1, content type2 and content type3.

I want to have an exposed filter in admin/content page for content type1 and content type3.

Thanks in advance.


texts:
How to find a menu item pointing to the specific node?

On node creation I want to create a main_menu link for the node.
With menu_rules it is relatively easy. The problem arises when the parent element can differ.

main_menu
Groups
-[GROUPS]
--[GROUP_CONTENT]

main_menu
...
Groups
-A
--a1
--a2
-B
--b1
-C
...

In the above case adding a new group D is easy - I simply add a menu item to 'Groups', but what if I would like to add a3?
I know the name of A and I know what it is linking to (a node representing a group) but I don't know its randomly generated menu ID (for example [menu-1082]).

How do I find that Id?


texts: How do I download/open a pdf file directly by clicking on lable/link

texts:
I have created a view that displays in a bulletin format, which works fine. My challenge is when I click on the bulletin which has a pdf attachment, I want it to immediately download/open the attached pdf file. Currently it takes me to  second screen(see attached) which has a pdf attachment. I would like to get pdf attachment downloaded immediately when I click on the bulletin, National Arts Festival Grahamstown 27 June to 7 July 2013 from the first screen(see attached).

I have tried to use file force drupal module but seems not to be doing the trick.

Herewith an attachments.


texts:
I use the Display Suite module and I enabled the Display Suite Format module. I use a code field to display a node/edit link, with the following code:

  if (node_access('update', $entity)) {
    print l(t('Modifier'), 'node/' . $entity->nid . '/edit?nid=' . [node:field-construction-fdr-ref:nid]);
  }
?>

The resulting URL is http://localhost/node/11430/edit%3Fnid%3D11419, leading to a Page not found error. I wish to get http://localhost/node/11430/edit?nid=11419.

I tried / before ? and =; I tried &_#63; for ? and &_#61; for =.

How can I get the URL I need?


texts: Prefix of drupal: in front of certain dependencies and what does it mean?

texts:
I saw certain modules list their dependencies with a prefix of drupal:, while other don't.

What's the difference between:

name: Core
type: module
core: 8.x
dependencies:
  - block

And

name: Core
type: module
core: 8.x
dependencies:
  - drupal:block

Notice the extra prefix drupal: in front of block.


texts: How to concatenate a string in a WHERE clause of an SQL query?

texts:
I'm trying to execute the following query but when I append the 'n.nid = "node/" + ua.source' condition I'm getting an error page:

        $query = db_select('node', 'n')->extend('PagerDefault');
        $query->join('url_alias', 'ua', 'n.nid = "node/" + ua.source');
        $nids = $query
            ->fields('n', array('nid', 'sticky', 'created'))
            ->condition('type', 'news')
            ->condition('status', 1)
            ->orderBy('sticky', 'DESC')
            ->orderBy('created', 'DESC')
            ->limit(3)
            ->addTag('node_access')
            ->execute()
            ->fetchCol();

Any suggestions to resolve this?


texts:
http://www.wmfs.net/blackcountrylevel3plan

I have the Isotope working with Lightbox2, however the Lightbox is just displaying a blank space and not the image.

I am trying different things to troubleshoot the problem, different configurations in Drupal, putting the JS in the header and footer, there are no significant JS errors in Web Inspector.

Any help is gratefully appreciated.

Ant


texts:
I develop sites on my server then move them when ready. I just started using IMCE and everything works well other than the image path. For instance:

The path shows /test/sites/default/files/images/test.png however I want /sites/default/files/images/test.png so when I move the site I don't have to redo all the images.

I set the rewrite in the .hataccess file and I set the base url in settings.php. Is there something else I need to set?


texts:
I have created a view table
It has editable fields with dependencies

If status = "rejected", the remarks textbox is visible

If status = "waiting for approval", the remarks textbox is invisible

In the first row, the dependencies work fine.
But for the following rows, the dependencies are not working.

Any solution for this problem?


texts: Weird activites in my site. Is my site hacked?

texts:
Since long time I have been noticing some weird activity going on on my website.

For example:

The includes folder was deleted
CSS files were modified
Node edit access was given to anonymous users

I was thinking it could be human error by my team, but I can confirm they are not doing anything as such because they are just updating the content without touching the site configuration.

I see these users which we never created:

martinm14vxbyycdniot/fallsatj@hotmail.com
qhzcedrichjergsj/obscenehail72mbb@seznam.cz

They show as blocked users and I don't see any content created by them. I searched for the email ids and found they are marked as spammers but dont know what it is. These things are really worrying me. Does anyone know what might be going on?

Is my website hacked?

Update:

few minutes after posting this (and after deleting above users) this user is crated

qhzcedrichjergsj/obscenehail72mbb@seznam.cz


texts: How to add a css class to the nodes in the front page according to taxonomy of each node in drupal 7?

texts:
in the front page, I have displayed multiple nodes (article) in the teaser view, each article has taxonomy.

I want to theme each node teaser according to the taxonomy it has, I think it can be done in the theme_preprocess_html(&$variables, $hook), for example

function theme_preprocess_html(&$variables, $hook) {
  if ($variables['is_front']) {

    // something here, but I don't know what to do
  }
}

the first step is how to find all the nodes in the frontpage, the second is to get the taxonomy of each node, the third is to add the specific css class to each node according to the taxonomy of each node

Does any have suggestions?


texts:
I know there is a question hook_update_N not running but I checked its answers and it didn't help. I'm just learning developing modules for Drupal so maybe it's something really stupid but I have no idea...

My hook (in testModule4.install):

function testModule4_update_7001() {

$schema['testModule4_table'] = array(
    'description' => 'TODO: Description',
    'fields' => array(
        'main_id' => array(
            'description' => 'TODO: Description.',
            'type' => 'serial',
            'not null' => TRUE,
        ),
        'settings' => array(
            'description' => 'TODO: Description',
            'type' => 'text',
            'not null' => FALSE,
        ),
        'uid' => array(
            'description' => 'TODO: Description',
            'type' => 'int',
            'not null' => FALSE,
        ),
        'created' => array(
            'description' => 'TODO: Description',
            'type' => 'int',
            'not null' => FALSE,
        ),
        'changed' => array(
            'description' => 'TODO: Description',
            'type' => 'int',
            'not null' => FALSE,
        ),
    ),
    'primary key' => array('main_id'),
);

db_create_table('testModule4_table', $schema['testModule4_table']);

}

My module is working just fine. The schema_version of module in database is 0 but update.php just cannot see it. What can be the cause of that? :/ I was trying clearing cache and reenabling a module but without success. I just don't know where to search for source of the problem. If you need more data, just comment :/ .

Edit:

I created simple module:

testModule.module:

<?php

function testModule_myform($delta = "") {

    $form['something'] = array(
        '#type' => 'markup',
        '#markup' => 'Something',
    );
    return $form;
}

/**
 * Implements hook_menu();
 */

function testModule_menu() {
    $items["test/test"] = array(
        'title' => 'testModule',
        'description' => 'TODO: Description',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('testModule_myform'),
        'access callback' => TRUE,

    );
    return $items;
}

testModule.info:

name = testModule
description = Test module for Drupal experiments.
package = CustomTest
core = 7.x

testModule.install:

function testModule_update_7001() {
    drupal_set_message('It works!');
    print 'Show something!';
}

And it still ignores this hook... Is it officially a Drupal bug and I need to reinstall the whole Drupal? >_<


texts: Is there a way with Drupal to transfer money between users? Im making a skill sharing website, so users can buy and sell their skills. Thanks


texts: A better way to insert preformatted snippets into content/wysiwyg?

texts:
Is there a way to insert pre-formatted objects (like a standardized sign-up form) in line in content via wysiwyg (a'la the fantastic wysiwyg-templates module), but encapsulated and protected...

I actually love that w-t can insert snippets, and will continue to use it, marketing likes to insert the same search form they always use and then change 2 words to test if that drives conversions.  For what it does, w-t is perfect.

HOWEVER...

Having done that, I now want to pop in content in exactly the same method, except LOCKED so it can't be edited, but so I can still SEE it, and potentially move it around the page as though it were an image.

I'm not expecting too much for response, but if I end up really needing it I'd rather hear what other ideas are out there than build something myself that has already been done.

(background to be posted in a comment below for context)


texts: system_cron() eats all ram and runs forever

texts:
Client doesn't ran Cron for >6 months. So in database, we had large tables. I have cleared  tables accesslog, cache_*, watchdog, flood manually in MySQL.

After that, running Cron runs forever. Especially system_cron(). What part of that function can cause this? It seems that probably mysql is eating RAM, but I'm not sure.

system_cron() touches following tables - cache_* (empty), flood(empty), batch(1 row), queue(159 rows), file_managed(18,163 rows).

Maybe something is wrong with file_managed?


texts:
In Drupal 6, I was able to use a Row Style Fields template and create variables to arrange and print later i.e.:

foreach ($fields as $id => $field) {
  if ($field->label == "Phone") {
    $f_phone = $field->content;
  }
}
print "
${f_phone}
\n";

Then I was able to use the variable $f_phone in other places in the template.  This does not work in Drupal 7.  I am instead getting variable not found errors.

How would I do this in D7?


texts: I am facing issue while posting on twitter using publish_away module?

texts:
I am getting the following message while submitting the message.

  There was an error 401 from Twitter. Visit Twitter HTTP Status Codes page to understand what is going wrong.

I don't find where I am wrong? Anything specific I am missing in twitter setting?

I have set all the tokens correctly. Attaching screenshot below :


texts: Assigning (adding) an entity reference when an Order process is completed

texts:
In Drupal 8, I am needing to know how to assign/add an entity reference of an e-book to an multivalue entity reference field of the user when an order with the e-book is placed. This will allow the user to then access only the e-books attached to his user account.

What hook do I use? how do I know if there is a product in the order that have field_ebook=true? Then how do add it to the list of entity references?


texts: Implementing IP recognition and price conversion (2 parts)

texts:
The commerce (kickstart) site has default prices in USD. Site should convert the price to local currency for international visitors, based off IP or other means.

Example:

Widget Price - $2 (USD).

Australians see: A$2.15

Canadians see: C$2.18

Japanese see: ¥204.70

So the functions needed are

Detect country from IP
Lookup visitor's currency
Lookup conversion rate from USD
Convert + format price
Display wherever price field is called.

There doesn't seem to be a single module to do this (I wish there is!) and bits and pieces of advice here and there which involve rules etc, which I'm not familiar with.

I hope I can find a guru here who can show the way. Thanks!


texts:
So I created a view listing all the users. I implement a search form with autosubmit function.

The autosubmit works with an ajax script.

Into my page view, I changed a few things in Jquery like this (main.js) :

$(document).ready(function(){
    //code for others pages.....
});

$(document).ajaxComplete(function(){
   $('h2').text('filters');
});

But when I filter my list of users, the ajax script is loading and after that, Jquery changes do not appear due to ajax load.

Do you know a trick to keep Jquery changes when ajax script is loading ?

Thanks for your help !


texts:
How do I move a site to a new server?

I have a backup file for the database content and all the files. I uploaded it using cPanel to the new server, imported the database, and updated the username and password as well.

For some reason, the website is just showing this message.

  The website encountered an unexpected error. Please try again later.

The content of the error log provided by my hosting provider is the following.

How can I fix this?


texts:
I am working on a custom module that has a search form with an advanced search. The search will display results for a specific content type (digital documents).

The possible search options are:

Query
Language
Subject Area
Categories
Tags

I've set up the module to build the advanced search form based on the widget of the field on the content type. So for example, the language widget is set to checkboxes so the module creates checkboxes on the advanced search form. This works great and allows the user to modify how the advanced search form works.

Currently after submit, I store all of my search values into the session. This works great. The form and search results are output in a block, there is no page output. This allows the user to manage the URL through Drupal rather than the module.

The latest request from the client is for the ability to link directly to a subject area and category. Something like /documents/subject_area or documents/category. Since the module is so flexible and I want it to be possible for the user to link to any combination of options I need to build the URL is such a way that the user can do that.

Obviously I would like to avoid a giant URL mess and would like clean looking URL's. But how do I accomplish this? Any suggestions?

Thanks in advance!


texts:
I have more than 270 pages in my website.

There are some Content Creators, Content Editors, Reviewers and Publisher.
I have assigned each user a different role.
Each user can view, edit and publish each others' pages.

I wanted to create something like;
When user logged in with his user name and password, first he can see only his own created/assigned content pages when he clicks on content tab.

How to show only user assigned contents in his dashboard?


texts:
I am using Drupal 7. I want to rebuild a part of form when a button is clicked. My form looks like this:

$form['me'] = array(
    '#type' => 'fieldset',
    '#value' => t('name'),
    '#prefix' => '
',
    '#suffix' => '
'
);

It contains various text fields and a submit button. The submit button looks like

$form['me']['save'] = array(
    '#type' => 'submit',
    '#validate' => array('save_validate'),
    '#submit' => array('save_submit'),
    '#ajax' => array(
        'wrapper' => 'me-wrapper',
        'callback' => 'me_ajax_callback'
    ),
);

in the save_submit function I set $form_state['rebuild] = true;

in ajax callback function

function me_ajax_callback($form, $form_state) {
    return $form['me'];
}

Now, what happens is first time when I click submit, the ajax returns data and replaces the wrapper. But, 2nd time when I do so, I get a POST Internal Server Error 500.

Looking around the Form API, I set $form_state['no_cache']=true; in submit handler and that prevents the POST error but still the AJAX response is empty.

It works fine if, I reload the page. So, in short, the first time I hit submit I get an AJAX response. On the second time, the response is blank.


texts:
I'm trying to get views slideshow to run on a Drupal 8 site. I've followed this tutorial and have downloaded the required libraries. I've set up the view, and it shows up fine on a page when it's included, however it will not cycle.

I checked my inspector window and found I was getting errors each time that the slide tried to advance:

  Uncaught TypeError: $(...).cycle is not a function

jquery.cycle is one of the required libraries that I installed. So I switched off the javascript aggregation to make sure jquery.cycle was being loaded in. It is, but it looks like it's corrupted:

I tried to delete jquery.cycle.all.js and reinstall, but it seems to be doing the same thing. It also only seems to do this when the cache-busting bit is added on the end (/libraries/jquery.cycle/jquery.cycle.all.js?v=3.0.3 is bad, but /libraries/jquery.cycle/jquery.cycle.all.js loads perfectly fine)

Any help would be greatly appreciated.


texts:
I am trying to create a custom service and call it from a controller that is being used on a route.
I use simple code, so I think I am missing something

The membership service:
https://gist.github.com/betz/6e0cb7ce2712793711d4c9ed99a3a697

Controller:
https://gist.github.com/betz/a9aa9db636cd9b9bffea3b4e255fb1df

services file:
https://gist.github.com/betz/25aeb579c265bfba83a0e891aa883bf8

routing file:
https://gist.github.com/betz/577a411a8ede77ecc0be614044ec1a44

The error I get:

  RuntimeException: Controller
  "Drupal\hsbxl_members\Controller\Test::test()" requires that you
  provide a value for the "$container" argument (because there is no
  default value or because there is a non optional argument after this
  one). in Drupal\Core\Controller\ControllerResolver->doGetArguments()
  (line 165 of
  /var/www/drupalvm/web/core/lib/Drupal/Core/Controller/ControllerResolver.php).

So it seems the ContainerInterface $container is missing when the controller is being initiated. But how do i do this? Confused.

Cheers!
Tom


texts: Suggestions for settings.php - Local dev, Development server, Live server

texts:
Basically, one of the greatest questions of all time: What are some ways you're using settings.php in your development/staging workflow?

Right now, I have my settings.php file set up like the following, and I base my development on the server's $HOST directive—meaning I can work on dev.example.com for the development (shared) server, local.example.com for my local computer (and other dev's local code checkouts), and www.example.com (or just example.com) for the live site.

(This code is in the 'Database settings' section of settings.php):

$host = $_SERVER['HTTP_HOST'];
$base_url = 'http://'.$host;
$cookie_domain = $host;

switch($host) {
  case 'example.com': # Production server
    $db_url = 'mysqli://prod_sql_user:password@127.0.0.1/prod_db';
    $update_free_access = FALSE;
    $conf = array (
      // Set production config options here...
      'example_setting' => 0,
    );
    break;

  case 'dev.example.com': # Development server
    $db_url = 'mysqli://dev_sql_user:password@127.0.0.1/dev_db';
    $update_free_access = FALSE;
    $conf = array (
      // Set production config options here...
      'example_setting' => 0,
    );
    break;

  case 'local.example.com': # Local server
    $db_url = 'mysqli://local_sql_user:password@127.0.0.1/local_db';
    $update_free_access = FALSE;
    $conf = array (
      // Set production config options here...
      'example_setting' => 0,
      // Turn off most core caching.
      'cache_inc' => 'includes/cache.inc',
      'cache' => CACHE_DISABLED,
    );
    break;

}
?>

This works pretty well for most purposes, but it means we have a lot of extraneous code sitting around in our shared settings.php file... is there a better way?


texts:
My question is about drupal7 and infinite scroll module.
When I click on a button more news is loaded and html changes like this:

    Load More

My browser makes ajax request and receive some response:

view_name:blog
view_display_id:page
view_args:
view_path:about/media
view_base_path:about/media
view_dom_id:a2acec59ca7b252cfd911b770bc558bc
pager_element:0
page:2

I need to change page on frontend. How can I find where is this parameters set? OR can I change him on front end. I assume there is some hidden div related to this parameter, but I don't know how to find it.


texts:
I have a REST EXPORT view getting fields values of a node. I want to override the labels of these fields in the response returned.
For example:- the returned response like this

[
    {
        "question_title": "How are you?",
}
]

I want the response like this

[
    {
        "questionTitle": "How are you?",
}
]

I tried to create label from the view but it doesn't affect.


texts:
How can I access node property which name starts with # in twig template?

I have content type with field Category and I need to access value of that field inside of twig template?

Using dump(content.field_category[0]) I get this

array (size=5)
  '#type' => string 'link' (length=4)
  '#title' => string 'Example' (length=5)

How to access #title ?

Thank you.


texts: Why will drupal not recognize my configuration?

texts:
I am trying to import configuration from one site to another.  I have copied the directory full of config files from an older site to my new site.  When I try to run Drush cim, the files all show up as they will be created.  However, after answering yes to the prompt I get
This import is empty and if applied would delete all of your configuration, so has been rejected. in Drupal\Core\Config\ConfigImporter->validate() (line 756 of
/home/vagrant/code/indigo-signs-pantheon/web/core/lib/Drupal/Core/Config/ConfigImporter.php).
The import failed due for the following reasons:                                                                                [error]
This import is empty and if applied would delete all of your configuration, so has been rejected

I found this question and tried changing the UUID like suggested, but it didnt change anything I still get the same error.
Any suggestions


texts:
Whenever I try to clone one of my sites, I get this error:

  Drush command terminated abnormally due to an unrecoverable error.
  Error: Cannot redeclare entity_features_get_controller() (previously declared in /data/disk/dd/distro/005/drupal-7.41.1-prod/sites/www.firstsite.com/modules/entity/entity.features.inc:11) in /data/disk/dd/distro/005/drupal-7.41.1-prod/sites/www.clonesite.com/modules/entity/entity.features.inc, line 19

Could you tell me what the reason could be?


texts: How Update item on the second page in WebForm wizard

texts:
I am starting to work with webform in drupal 8 and I need to show values on the second page of the webform wizard, I have reviewed several solutions but I cannot do it. I tried using $ form_state-> setValue

function webform_certificadoemail_webform_element_alter(array &$element, FormStateInterface $form_state, array $context) {

  if ($form_state->get('current_page') == 'preview') {

    $value_entered = $form_state->getValue('nombre');
    drupal_set_message('Valor del nombre en el preview =:'.$value_entered);

     $form_state->setValue('valor','This value is .......'); // This not work
  }
}


texts: How do I include taxo description in a View's no argument summary?

texts:
I've got a view with an argument based on taxo terms that shows a summary list when no argument is present. Now I need the list of terms to include a description for each one. Clearly the logical way to get this is to include the taxo description under each term, but I don't see how to do this. Drupal 6, views 2.

I'd be willing to take a stab at writing a Views plugin to get this functionality, but I don't really know where to start. I do have some idea how to get the taxo description through code, but now how to integrate that into a Views no argument option. Any suggestions?


texts: How to redirect anonymous users to a login page?

texts: I have several type of nodes for content that is contributed by authenticated users. I would like the links to be visible to anonymous users but if they click the link to have it redirect them to the user log in page and if at all possible have the destination send them to the node creation page? I can use either a custom module or rules. How do I do this? Also, how do I have the flag links do this too?


texts:
I have a the following query:

function background_audio_file_query($path) {
  $result = db_query("SELECT uri
    FROM `file_managed`
    WHERE `filemime` = 'audio/mpeg'
    LIMIT 1 , 30",
    array(':uri'=>$path))->fetch();

return $result;
}

How can I pass this to a Drupal variable?  I am assuming variable_set() but I am having trouble with the syntax.  Could anyone lend a hand?


texts: Switching to mobile theme while cache is enabled

texts:
I have a Drupal7 website using a modified Zen subtheme that looks ugly on mobile devices and i want some kind of utility to create a separate mobile theme .
I tried to use differents modules like Mobile Switch,Mobile Detect ,Mobile Tools & Theme Key but unfortunatley they don't support Drupal Default Cache .
Is there any way or method or another module to resolve this problem.
Thank you very much


texts: PDO Exception Error - How to resolve this?

texts: After integrating Google Custom search in Drupal 7, I am getting this error page. What should I do to resolve this error?


texts: Why are some CKEditor configurations working and not others?

texts:
I am using CKEditor 4 in Drupal 7 using the CKEditor module. I have the following configuration at /admin/config/content/ckeditor/edit/[profile]:

config.stylesCombo_stylesSet = 'my_styles:/sites/all/libraries/ckeditor-styles.js';
config.stylesSet = 'my_styles:/sites/all/libraries/ckeditor-styles.js';
config.fillEmptyBlocks = false; // Prevent filler nodes
config.language_list = [ "en:English", "es:Spanish", "zh:Chinese", "ar:Arabic:rtl", "fil:Filipino", "fr:French", "ja:Japanese", "ko:Korean", "ru:Russian", "th:Thai", "vi:Vietnamese" ];
CKEDITOR.on('instanceReady', function(ev) {
  ev.editor.on('paste', function(evt) {
    evt.data.dataValue = evt.data.dataValue.replace(/&nbsp;/g,' ');
     evt.data.dataValue = evt.data.dataValue.replace(/<p> *<\/p>/g,'');
    console.log(evt.data.dataValue);
  }, null, null, 9);
});

The fillEmptyBlocks configuration is working. Extra returns are removed on save and on paste from Word.

However, the dropdown for the language icon only contains the CKEditor default of Arabic, French, and Spanish, not the list of 11 languages that I've supplied.

And pasting A[tab]B[tab]C[tab]D[tab]E from Word, which converts the tabs to a series of non-breaking spaces, retains the non-breaking spaces.

Any ideas why these configurations are being overlooked and how to make them work?


texts:
How can I get the parent items of a menu item for a view?
I added a Global: null argument in the view and I need to get the parent items of this view. The view is set to belong to a menu in admin/build/menu-customize/primary-links.

I tried these in the argument to examine the parent items:
$menuParent = menu_get_active_trail();
dsm($menuParent);

However, it's not resulting in the output I hoped. I tried to look for a right function in http://api.drupal.org/api/drupal/includes--menu.inc/group/menu/6 but I get confused with all these functions: menu_tree, menu_tree_data, menu_get_ancestors etc.

I am using Drupal 6.


texts:
I've got multiple web forms that email their submissions. I need to break it out into fields and keep it clean.

Say, on my webform, I've got a field named zip_code. How can I print that in a token, with no label?

Thank you.

EDIT: I want to use the built-it (but not documented) functionality


texts: Panelizer content missing on module update

texts:
I'm in the process of migrating a client's Drupal 8 installation to the preferred composer structure (outside of docroot), but having a single issue causing a full stop. They use Panelizer for most pages, and most layouts are Flexible (flexible_layout). The issue is that anything that uses the Flexible layout seems unable to see any blocks. Other layouts are fine. The Flexible layout itself seems intact, all rows/regions are where they should be and labeled properly, just missing the blocks. The blocks are still there, as reverting the change fixes the problem.
Current (working) setup.

Drupal 8.9.7
Panelizer 8.x-4.1
Panels 8.x-4.3
Ctools 8.x-3.0
Composer inside docroot, but not for modules, only core.

Steps I've tried:

Migrate composer to outside docroot, use composer for all modules,
pinned at current versions.
Migrate composer as above, also update Drupal to 8.9.11 (before 12
came out).
Migrate composer as above, let all modules update as needed, also update Drupal to 8.9.11 (before 12 came out).
Only update panelizer/panels/ctools. Tried going up one release each,
and going fully current.

Every step always ends up with the empty Content page for a Flexible layout. Everything else all seems to work fine. Reverting any step gets it working fine again.
When the Content page is empty, the front end of the node is blank except for anything not part of the panelized page (header/footer/template renderings/etc).
I think this is specifically in panelizer, but can't be sure. It also happens when just doing the composer migration and keeping the versions the same...
Question: Does anybody know what could cause the disappearing blocks?
I have no contact with the original developers, and am not very familiar with the inner workings of Drupal.


texts:
Got some weird issues with stage file proxy and generating thumbnails:

When stage file proxy is enabled i can download all the files from remote server but i cannot generate any image styles.
When i disable stage file proxy i can generate image styles but no remote files are displaying (even though all of them should be downloaded in any case when the module is enabled, right?)

Just wondering if anyone has ideas as i'm going crazy with this, thanks!


texts: Rename a taxonomy vocabulary during migration

texts:
I'm working on a custom migration for taxonomy vocabulary and I was wondering if there is a way to rename a vocabulary during migration?
my d7 vocabulary name is staff and I wanted to be migrated to d8 as departments


texts:
I put this code in Rules Action PHP Evaluation. What I want is getting the field_price's value, changing it for negative and returning it for Rule. With this I will be able to charge points because in Rules (Drupal 7) it is impossible to put "-" before data-selector (in this case, field_price's value) and make it negative to charge these points instead of adding them.

<?php
if (arg(0) == 'node') {
   $nid = arg(1);
}
   $node = node_load($nid);
   $value = $node->field_price['und'][0]['value'];
   return $value;
?>


texts:
I have a hook_user_load function where I am loading some extra user info into the $users array.  I am having trouble storing the info in a static array and would appreciate it if someone could let me know what is wrong in the following function:

function mymodule_user_load ($users) {

    static $my_users = array();

    foreach ($users as $uid => $account) {
        // Only handle authenticated users.
        if ($uid > 0) {

            // Have we loaded this user before?
            if (isset($my_users[$uid])) {
                $users[$uid]->info = $my_users[$uid];
            }
            else {
                //Call another function to load user info
                $my_users[$uid] = load_user_info($uid);
                $users[$uid]->info = $my_users[$uid];
            }
        }
    }
}

Basically, the variable $my_users on the first time I load the user profile page, will be an empty array and I have to call the load_user_info() function to fill the array with the info.  If I refresh the user profile page again, this function will run a second time, and the following if (isset($my_users[$uid])) code should evaluate to true and so it won't have to go to the else statement and run the load_user_info() function again.  However, it is not working.  Basically, each time hook_user_load runs, the $my_users variable is empty, meaning it is getting initialized each time.  Isn't a static variable supposed to be only initialized once?

Would appreciate any help on this.  Thanks.


texts: Is there a module that displays a field only when a condition is met?

texts:
I am looking a module that will only display some fields if a condition is met. Basically only administrators or editors should be able to see those fields in the display. In editing mode it should be alright as only editors have the right to view those fields.

I have checked the documenation for  Conditional Fields module and Field Conditional States which enable this but they do it based on field contents, but I want run if a PHP condition is met. Are there any other similar modules which implement this?


texts: Views Contextual Filter by taxonomy in field collection

texts:
I have a Drupal 7 project I'm working on that's got me stumped.
I'm building a site where the node (Decals) are applicable to models and years (This decal is correct for this model of this year).
Each product my be applicable multiple models and multiple years.

I created a content type that has a field collection of model and years that can have unlimited values. So far so good.

Where i'm stuck is i want to have a related decals block at the bottom, that would suggest additional decals based not the models and years that listed in the field collection.
I've creating a view of nodes that has a relationship to the field collection, but I can't figure out how to limit the results to only the models & years associated to the node.

Any suggestions would be greatly appreciated.


texts:
I am going to alter the form of add content type form and for that I used the hook_form_FORM_ID_alter()

Here is my code which implement in the module file, but it is not working.

function hc_listings_menu()
{
    $items = array();
    $items['node/add/home-care-popular-search-region']=array(
        'title' => 'Create Home Care Popular Search Region',
        'page callback' => 'drupal_get_form',
        'page arguments'=> array('home_care_popular_search_region_node_form',''),
        'type'=>MENU_NORMAL_ITEM,
    );
    return $items;
}
function hc_listing_home_care_popular_search_region_node_form_alter(&$form, &$form_state, $form_id)
{

    $state_list=['ffff','gggg'];
    $region_list=['1','2','3','4'];
    $form['home_care_popular_search_region']=array(
        '#type' => 'textfield',
        '#default_value' => '',
        '#title' => t('Homeeee Care Popular Search Region'),
        '#description' => t('Home Care Popular Search Region'),
        '#required' => TRUE,

    );
    $form['hc_popular_state']=array(
        '#type' => 'select',
        '#default_value' => $state_list,
        '#title' => t('Popular State'),
        '#description' => t('Home Care Popular State'),
        '#required' => TRUE,
    );
    $form['hc_popular_regions']=array(
        '#type' => 'select',
        '#default_value' => $region_list,
        '#title' => t('Popular Search Region'),
        '#description' => t('Home Care Popular Search Region'),
        '#required' => TRUE,
    );

}

Note: content type is => home_care_popular_search_region

module is => hc_listing

Should I have to remove the details in hook_menu regarding the altering?


texts: How do I get a custom script to run when using hook_cron in my custom module?

texts:
I am brand new to module development, fresh off the D7 tutorial boat. What I want to do cannot be that hard.

I have created my first module called get_weather, with get_weather.info and get_weather.module properly installed and drupal recognized.

I created another simple script that has one function, which I want to run when cron runs. 'update_weather' the ONLY thing this does is return the temperature for that time and store it in the database.

There is nothing to display, there are no blocks to render. However, this does not work:

function get_weather_cron() { update_weather(); }

What's going on here? I get no errors, but nothing happens at all? How do I get my module to run my custom function when cron runs?

Note that my custom function works fine if I run it from a script outside of a Drupal module environment.

Here is code based on comments feedback:

include('weather.php');
function get_weather_cron(){
    watchdog('get_weather_debug', 'Cron function triggered');
    update_weather();
}

Also here is update_weather, which is included in the weather.php include file:

function update_weather() {
    $page['weather'] = scrape_weather();
    //insert into db code here;
}

Again, when I simply run this php normally outside of the drupal enviroment, everything works fine. All I want to do is run this same script when cron runs so this is done automatically. No function in my entire library for this functionality has anything to do with Drupal. I am simply trying to activate it by using cron.


texts: Why are the edit/delete/reply links missing in the Comment module?

texts:
I'm using 8.6.0 core's Comment module. I can add comments, but I can't edit or delete them. I also can't reply to anyone else's.

Permissions have been set that all authenticated roles can edit. I'm even an admin and nothing.

I even looked at the comment.html.twig template. I don't see any of those links. The only link showing is {{ permalink }}. The variables also don't supply any of the links I require.

I looked around and can't find anything related to Drupal 8.


texts: ajax issue for form element on hook_form_alter in drupal 7

texts:
function clicktell_form_alter(&$form, &$form_state, $form_id) {
  //print_r($form);
  if($form_id == 'create_rental_node_form') {
    $form['tax_form'] = array(
      '#type' => 'markup',
      '#prefix' => '
',
      '#suffix' => '
',

    );
    // Add Term button
    $form['test_btn'] = array(
      '#type' => 'button',
      '#value' => t('Add term'),
      '#name' => 'addform',
      '#limit_validation_errors' => array(),
      //'#limit_validation_errors' => array(),
      '#ajax' => array(
        'wrapper' => 'tax-form',
        'callback' => 'clicktell_addterm_form',
        'method' => 'replace', // this is important without this if else condition for ajax will not work.
        'effect' => 'fade',
      )
    );

    $form['#validate'] = array();
    //$form['actions']['submit']['#ajax'] = array();

//  $form['actions']['submit']['#submit'] = array(
//    'callback' => 'clicktell_node_create_callback',
//  );

    return $form;
  }

}
function clicktell_addterm_form(&$form, &$form_state) {
  // not being specific with return form value for example
    //print_r($form_state);exit;
  $form['test_btn']['#value'] = 'New value';;
  return $form;
}`enter code here`

Ajax is not working. every time pages refreshes don't know how to use ajax in form alter. please help me.


texts: Passing a node field as a contextual filter to a view pane

texts:
I am trying to pass an contextual filter to a views content pane from a field in my node and have followed the procedure described in this question without success. I see that the OP of that question eventually resorted to a PHP contextual filter as well.

The only difference is that I am using Panelizer rather than Panels. My field is called field_organization_contact_recor. My view works if I test it with legal values for that field in the views UI and gives the correct results in the preview.

I have chosen "from context" and checked that I am passing the correct field in the "Argument input" settings for the views pane. I checked by using firebug to check the field name of the selected option was correct. I get "no results" for my view.

I have also tried setting it up as "Input on pane config". If I do that and pass in a hard-coded value in the pane settings I also get the correct view results in my panels page. On that settings popup there is a prompt "You may use keywords for substitutions." What is the required format of these keywords to pass a field value? I have tried the format shown on the list of built-in contexts on the contexts tab "%node:field_organization_contact_recor". This format doesn't work in my case.

Additional info: This field is CiviCRM contact reference field. Perhaps there is a particular hook that this field type doesn't implement?


texts:
Is there any good way to let users create custom node lists? I'm using Drupal 6.

I've found the Flag Lists module, but it has not been fully released, yet.

Any idea would be helpful.


texts:
I am trying to insert tag url and page title in breadcrumb path. With page title everything is Ok, however I can't find any info how to get tags, or how to generate url for them. I think I am getting tag how I am supposed to, but this returns object of Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem without id (?). So How could I gennerate Url from this object?

function theme_preprocess_breadcrumb(&$vars) {
  $node = \Drupal::request()->attributes->get('node');
  $title = $node->getTitle();

  $tag = $node->field_tags->first();

  $vars['breadcrumb'][] = [
      'text' => $title
  ];
}


texts:
Please is there a Drupal module that allows users to share images with each other privately? I know the Private Message module  allows users to send messages privately to each other. Thats fine, but i need users to also send images to each other privately in addition to messages.

Thank you.


texts: Views Group By how to display only group headers with COUNT of rows

texts:
I would like my view to display just one field and additionally group by this field. So, I set the following:

checked "Use Aggregation" in Advanced settings
added the field to FIELDS section
in FORMAT section set the Format->Settings to group by this field
in FIELDS section, in Field->Aggregation chose "Group fields
together"

As a result, I get the following output, assuming the field contains color values:

Blue
  Blue
  Blue
Red
  Red
  Red
  Red
Green
  Green

How to prevent displaying rows and only display group headers together with the COUNT of rows? Like this:

Blue (2)
Red (3)
Green (1)


texts: List nodes with Views 2 module, despite nodes having restricted permissions

texts:
My nodes have individual Access Control permissions.

I need anonymous users to be able to see a View (giving them a preview essentially) of these nodes, but currently they don't have access.

Is there an easy way to override the permissions just for this View, and show the nodes anyway? Searching for a solution lists a workaround which only works in Views 3.


texts: How to change boostrap seach button class from btn-default to btn-primary?

texts:
I'd like to change the class from btn-default to btn-primary like says in here: http://getbootstrap.com/css/#buttons

<!-- Standard button -->
<button type="button" class="btn btn-default">Default</button>

<!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
<button type="button" class="btn btn-primary">Primary</button>


texts:
Symfony's getQueryString method doesn't return modified query parameters.  So how should someone go about getting a modified query parameter string?

Example code:

   $request = \Drupal::request();
   $parameter_bag = $request->query;
   $parameter_bag->remove('destination');

   $query = \Drupal::request()->getQueryString();
   $query_array_modified = $parameter_bag->all();

$query in this instance will return the destination query parameter even though it was removed from the ParameterBag.  $query_array_modified in this instance will not return the destination query parameter ... as expected.

PS - Feel free to replace \Drupal::request(); with Symfony's request object in example code below if you are using Symfony.


texts: Drupal adds some page content after closing HTML tag

texts:
There was a broken node which wasn't showing on my site (and in admin panel) and it was breaking node access rebuilding. I've identified it and removed it via the database, but now drupal started adding some other page content to the end of the page.

It looks like this: https://gyazo.com/9cf7477a1f1c111d6c44d62c5a620384

And the HTML code for a page has the following: https://gyazo.com/fa2bd8cd0fc057f397a14cf12287a205

And it is added to EVERY page, even AJAX answers.
It seems that I've broken some internal relations, what can I use to identify and fix broken content relations?


texts: Handling shared content without multisite?

texts: Are there any good solutions out there for this? We have a couple of sites that share content (news, events, etc.) and they are not part of a multisite and we don't plan to make them a multisite. We need people to be able to edit them on each different site.


texts: views_get_view is returning some outdated version of the view

texts:
When I created some_view, its Items Per Page was limited to 10. Naturally, views_get_view('some_view') was resulting in 10 nodes.

I have since changed some_view's Items Per Page to unlimited, and cleared all caches. However, views_get_view('some_view') still results in just 10 nodes.

The preview of some_view shows more than 10 nodes, so the view works as expected. It has only the Default display mode.

Although clearing all caches should have cleared any view caches (right?), I also tried views_get_view('some_view', TRUE), which is supposed to ignore the cache. To no avail.

So, where could the view returned by views_get_view be coming from?


texts: I am looking to export webform submissions to cck instead of typing each submission in Drupal 6?

texts:
I have close to 150 submissions on my webform but had to change to content type midway , is there a simple way to export those submissions to a cck content type and map those fields instead of typing each one out.

Thank you


texts: How to set up Authcache module with Varnish and ESI?

texts:
I am trying to set up Drupal 7 with Authcache beta 2 and Varnish 3.0 but I can't get the ESI blocks working. Varnish it self seems to work well.

I am using the example.vcl from sites/all/modules/authcache/modules/authcache_varnish/ but on the Authcache ESI status debug page I get the following messages:

ERROR: Request Header   HTTP header X-Authcache-Do-ESI is not on primary request.
Please make sure that the reverse proxy software (varnish) is configured according to the requirements of authcache_esi / authcache_varnish.

OK  ESI Tag Tag successfully substituted by reverse proxy.

ERROR: ESI Subrequest Header    HTTP header X-Authcache is not on ESI subrequest.
Please make sure that the reverse proxy software (varnish) is configured according to the requirements of authcache.

The second problem is that even if I configure some blocks on the blocks setting page to load via ESI and AJAX, this block do not show up at admin/config/system/authcache/p13n and admin/config/system/authcache/p13n/frontcontroller.

There for it does not surprise that watchdog gives the error message (for each block):

Failed to find url generator for route frag/block/block-25

EDIT: My setting.php is set up as follows:

$conf['reverse_proxy'] = TRUE;
$conf['reverse_proxy_addresses'] = array('127.0.0.1');
/**
 * Add Varnish as the page cache handler.
 */
$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/authcache/authcache.cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/authcache/modules/authcache_builtin/authcache_builtin.cache.inc';
$conf['cache_class_cache_page'] = 'VarnishCache';
// Drupal 7 does not cache pages when we invoke hooks during bootstrap.
// This needs to be disabled.
$conf['page_cache_invoke_hooks'] = FALSE;

I didn't find any documentations so what am I supposed to do?


texts: How can I add a class to #markup output?

texts:
I'm using this code to add a cancel button to my form.  The link is generated through #markup:

  $form['actions']['cancel'] = array(
    '#markup' => l(t('Cancel'), $destination),
    '#weight' => 20,
  );

I'd like to add a class, cancel, to the link.  I tried adding this line:

'#attributes' => array('class' => array('cancel')),

but the class is not added.  I'm guessing because #attributes cannot modify #markup?  How can I add the class in this case?


texts: How do I call child node elements from a parent node?

texts:
Let's say I have two content types. A content type for parent node and a content type for child node. I need to render selected child nodes in the parent node.

How can I achieve this using Twig? In Drupal 7, I have created a view and access them from PHP code. How can I do this in Drupal 8?


texts: What are the ways/strategies to maintain Drupal sites a over period of 10-15 years?

texts:
We have started using Drupal as a PHP programming framework (and not just as a CMS). As result, we have many projects running on Drupal (6 or 7).

Typically, after 2-3 years a project gets over and no further development is done on that project. Then, we put that project into a maintenance or dormant mode.

The problem is that at the end of a project, there is hardly any money left for actively maintaining (e.g updating modules/core for security fixes) that project for over a period of say 10 years. And, there is no way that we can ask for maintenance money for a project (this is a sad fact).

So, we were brainstorming what would be the way to maintain Drupal sites securely for say a period of at least 10 years.

Some ideas were:

Convert entire Drupal site into bunch of static pages using some tool (I suspect this might break lot of interactive functionality in Drupal)
Lock down write access to MySQL database
Run dormant Drupal based sites in a Virtual Machine
Block all input fields on a Drupal site including login functionality (i.e make all content publicly accessible)

I also expect that in a period of 10 years following things might happen:

A server's hardware might be upgraded
A new PHP version might be installed
A new MySQL database might be installed
A server's OS might not be supported by a vendor for security updates
Certain Drupal modules may not be supported or may get deprecated by an other module
In the worst case, the required PHP or MySQL versions itself may not be supported by the community

What are the ways/strategies to securely maintain (i.e. keep them running) dormant Drupal sites for a very long period?


texts: What TOC module would work for a mixed Panelized setup?

texts:
I have gone through the "comparison of TOC modules" severally, but haven't managed to get something that works. So Ill just ask for those that might be in the know, I use panels, for about seven different content types. The fields inside of some of the content types include a horrible field type called Multifield, which seems to be giving me more grief than anticipated.

My question:
Is there a way to render Table of contents using views, and generating all the needed formatting and linking? Alternatively, is there a known TOC module that works with Panels, and Multifiels / large text field / leaflet maps content? I just want to pick all H2 tags in a panelized page and generate a toc at the top.


texts: How to make an "Add more logins" similar to Stackoverflow?

texts:
I am using OpenID Selector module to integrate OpenID logins to my website; the same service used by Stackoverflow for login/registration. However, how can I add an option to "Add more logins" like Stackoverflow? I am open to suggestions also.

The idea is to prevent duplicate users. I am using D7.

See attached image.

Also kind of tweaks are welcome.


texts: Question regarding hook_user_presave() and setting roles

texts:
When a new user is created, either via admin or by normal user registration, I need to assign a custom role to that user.  It works fine, but I'm not convinced I've checked the user status enough.

In my hook_user_presave() implementation, I check to make sure the administration role isn't set, and uid isn't 1.  To set my role:

if ($account->uid == 1 || array_search('administrator', $account->roles))
        return;

$account->roles[] = 'my_custom_role';

I only want to do this if it is a brand new user being created/inserted.  The documentation says hook_user_presave() is called if the user is being updated.  What is the best way to check if this is a brand new user creation?  Would uid be set to 0?


texts: How can I reduce the granularity of login time ago in Views (from minutes to days)?

texts:
I have a view of users which displays fields, one of which is User: Last login.  I set the Date format to Time ago (with "ago" appended). By default, this returns values like:

1 hour 5 minutes ago
7 hours 23 minutes ago
3 days 17 hours ago

I am sorting the view by User: Last login as well, and for this I have set the Granularity to Day.  For a number of reasons, I would like to prevent users from seeing precisely how long ago another user logged in if that user logged in within the last 24 hours.  So instead, I would like to return values like:

1 hour 5 minutes ago-> Today
7 hours 23 minutes ago-> Today
3 days 17 hours ago-> 3 days ago

Is it possible to do something like this as a custom Date format in Views?


texts:
i'm on drupal 7, using a premium theme "fundedvisual" and i'm trying to do some templates on a sub theme called "fundedvisual_subtheme".

I'm a noob in this, so maybe i did something wrong...

I have Profil2 module with 2 different profil types here the system names : "investor" and "project_creator".

i followed the answer of jeff_shamley in this post : Profile2 Template for edit page

i created a template.php file in "/sites/all/themes/fundedvisual_subtheme/" with this in it :

function fundedvisual_subtheme_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'user_profile_form') {
if ($form['#user_category'] === 'investor') {
  $form['#theme'] = 'profile2_investor_edit_form';
} else if ($form['#user_category'] === 'project_creator') {
  $form['#theme'] = 'profile2_project_creator_edit_form';
} else if ($form['#user_category'] === 'main') {
  $form['#theme'] = 'profile2_main_edit_form';
}
  }
}

function fundedvisual_subtheme_theme() {
  return array(
'profile2_investor_edit_form' => array(
  'arguments' => array(
    'form' => NULL,
  ),
  'template' => 'profile2-investor-edit',
  'render element' => 'form',
),
'profile2_project_creator_edit_form' => array(
  'arguments' => array(
    'form' => NULL,
  ),
  'template' => 'profile2-project_creator-edit',
  'render element' => 'form'
),
'profile2_main_edit_form' => array(
  'arguments' => array(
    'form' => NULL,
  ),
  'template' => 'profile2-main-edit',
  'render element' => 'form',
),
  );
}

Then i made 3 files in "/sites/all/themes/fundedvisual_subtheme/templates" :

profile2-investor-edit.tpl.php
profile2-project_creator-edit.tpl.php
profile2-main-edit.tpl.php

with this in it :

<?php echo "pouet" ?>

Then i cleared the cache a million time :'D

Annnnnnnd nothing show up except the default system profile :/

Did i forget something ?
Thx in advance !

Edit : i wonder if i can just embed these forms pages in views it would be nice, instead of creating templates with that i could just modify my style.css

Edit2 : one of my comments : to be more precise i have a general page called "my account" and in it i have the header menu on the top, below an image with a title, below another menu bar and below the content of each "button" from that menu bar.
Each time i click on a button from my menu i want to keep that template, so if i click on "profile" in my menu bar, it should be exactly the same except the title and the content. Is that possible ?


texts: Redirecting a page after form submission

texts: If I have a module that is creating a page, after form submission for that page, how would I redirect? Is there a function to do this in Drupal? I imagine that I would put the redirect command inside my function that executes after form submission, correct?


texts: Form won't submit properly on the front page

texts:
I have placed a form on the front page of my Drupal 6 site using drupal_get_form('mymodule_form'). I have not done anything different than usual, and I have implemented a validation handler called mymodule_form_validate().

The form displays properly, and posts to '/', as it should. I have put a form_set_error() into the validation handler to test that it is working. The validation handler is never hit when the form is submitted.

However, if I use drupal_get_form() to put the form on an internal page, it works as it should.

What is going on here? Is there something that is preventing forms from being used on the front page of a Drupal site?


texts: "Display" checkbox to show/hide media reference field items?

texts:
Background
In Drupal 7, a file field does have a "Display" checkbox per field item, to show / hide the respective file.
In a Drupal 8 migration project, we are migrating such fields as multiple-value media reference fields.
Problem
Unfortunately, these fields don't have the "Display" checkbox. Instead, this checkbox is now on the file field in the media entity. But at least in theory, one media entity can be referenced from different nodes, and each could require a distinct setting for show / hide.
Question
Is there any solution to add such a checkbox to a media reference field?
Solutions considered so far
I could extend the reference field type, adding another column. Seems like a lot of effort, so I would first want to look for existing solutions.
I could also use paragraphs, where the paragraph item would have a file field and a checkbox field. However, in the edit form this would look quite cluttered compared to the nice table in D7. And it would still require custom code to control the show / hide behavior.


texts: Get prefix and suffix from a Number field

texts:
So here is my issue;

I got a price in a Number (decimal) field in a node, I need to process this number in some ways depending on users interactions then send it back (via an ajax request) as an integer, but also formatted with proper currency sign which is stored in the fields prefix/suffix settings.

I should mention that this should also work with translations of the price and its prefix/suffixes.

I get the price now this way;

$node = \Drupal::entityTypeManager()->getStorage('node')->load($node_id);
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
$translated_node = $node->getTranslation($language);
$price = $translated_node->get('field_price')->getValue()[0]['value'];`

So now I want to constuct a formated variable with the translated prefix/suffix depending on which language is curretly selected.


texts: (hook_menu_alter) override the same path twice

texts:
I have created a custom module which implements the hook_menu_alter in order to override those two paths and to add my own access control logic:

$items['taxonomy/term/%taxonomy_term/edit']['access callback']

$items['taxonomy/term/%taxonomy_term/edit']['access arguments']

Looking for an out of the box solution I found this module vppr which overrides the exact same paths adding its own logic.

The point is that if I have both modules enabled - vppr module and my custom module -  the ['access callback'] from my custom module is never fired. If I disable the vppr module my module is working fine.

Is that possible, two different modules can't override the same path or I'm missing something, and why the ['access callback'] from the contrid module is executed over mine?

thanks!


texts:
I would like to add a new section to my Omega sub-theme but I can't seem to find any documentation on how to do this.

By default there are only 3 sections: Header section, Content section & Footer section.

I would like to add another section to those 3 in order to assign different zones & regions to it.

Thanks


texts: Drupal 8: How to create accordion View with table inside?

texts:
I'm trying to generate a accordion grouped by year. I have used Accordion module for this. It is giving accordion which is fine but I want data inside accordion in tabular format. For ex:

Table header is getting repeated in accordion. I want a single header for table. How to achieve this?

@EDIT

How to modify views.accordion-view.html.twig file so that row.content organized itself in tabular format as described in above image.

{#
/**
 * @file
 * Theme override to display a views_accordion set of rows.
 *
 * Available variables:
 * - title: The title of this group of rows. May be empty.
 * - rows: A list of the view's row items.
 *   - attributes: The row's HTML attributes.
 *   - content: The row's content.
 * - view: The view object.
 * - default_row_class: A flag indicating whether default classes should be
 *   used on rows.
 *
 * @see template_preprocess_views_accordion_view()
 */
#}
{% if title %}

{{ title }}

{% endif %}
{% for row in rows %}
  {%
    set row_classes = [
      default_row_class ? 'views-row',
    ]
  %}
  {# A div wrapping the row content is required for the accordion to work #}

    {{ row.content }}

{% endfor %}


texts:
I am trying to render a template in Drupal 8. In Drupal 7, I would create a theme with hook_theme, make a templates directory in my module, drop the template file in and I could display it with theme(). How do I do the eqivilent with Drupal 8? I tried the following, but it errors out:

In twitter_pull.module

/**
 *  Implements hook_theme().
 */
function twitter_pull_theme($existing, $type, $theme, $path) {
  return array(
    'twitter_pull_tweet_listing' => array(
      'variables' => array(
        'description' => array(),
      ),
      'template' => 'templates/twitter_pull_tweet_listing',
    ),
  );
}

Inside twitter_pull/templates: the twitter_pull_tweet_listing.html.twig

Inside my block:

$tweet_template = array('#theme' => 'twitter_pull_tweet_listing', '#attributes' => array('params' => $params));
$output = drupal_render($tweet_template, array('params' => $params));
print $output;

I get the following error in my logs:

User error: "content" is an invalid render array key in Drupal\Core\Render\Element::children() (line 89 of C:\xampp\htdocs\drupal\core\lib\Drupal\Core\Render\Element.php).

EDIT:
Another error:

Twig_Error_Loader: Unable to find template "modules/custom/twitter_pull/templates/templates/twitter_pull_tweet_listing.html.twig" (looked into: C:\xampp\htdocs\drupal). in Twig_Loader_Filesystem->findTemplate() (line 202 of C:\xampp\htdocs\drupal\core\vendor\twig\twig\lib\Twig\Loader\Filesystem.php).

I imagine this error is happening because I'm not using namespaces and autoloading correctly. Where do I put my template file? Based on the error message, I even tried to put it at C:\xampp\htdocs\drupal\templates\ but it still did not work.


texts: How do I show user created node in user profile page with edit mode?

texts:
I have a content type 'child'. And I have give the permission to authenticated user to create child node. Its working fine.
But I need to show current user created node in user profile page with edit mode so user can easily updated own created node.
For this I have created views but I am not getting any option to show a created node as a edit form.


texts:
I have recently moved a site from a localhost to a VPS. I have managed to make the public and private files writable; however, I am not sure where to find the temporary folder and how to change the permissions. I keep getting this message:

  The specified file temporary://file3Hl91E could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.

I am using Virtualmin, Drupal 7, and a Debian server. My current temporary directory is /tmp.


texts:
i have some Problems with the OR Condition in the WHERE part. Here is my function:

public static function loademails(array $entry ) {
  $select = db_select('users_field_data', 'b');
  $select->fields('b', ['mail']);
  $select->leftJoin('tc', 'tc', 'tc.uid = b.uid');

  foreach ($entry as $field => $value) {
    if($value=="1")
        $select->orConditionGroup()->condition($field, $value);
  }

  //echo $select;
  drupal_set_message('select: '. $select,'warning');
  return $select->execute()->fetchAll();
}

With

$select->condition($field, $value);

it is working i got WHERE a=1 AND b=0, but i need an a=1 OR b=0. Also

 $group = $select->orConditionGroup();
 foreach
   if
     $group->condition($field, $value);

return an empty $group

how do i get an sql statement with where and or ?


texts: How to create an entity_autocomplete field to accept multiple values?

texts:
I have created an autocomplete field like this as an entity reference field to my content type.
$form['node'] = [
  '#type' => 'entity_autocomplete',
  '#title' => $this->t('node'),
  '#target_type' => 'node',
  "#cardinality" => -1,
  '#selection_settings' => [
    'target_bundles' => ['content_type'],
  ],
];

My question is how to make it a multi value field? So that I can select multiple entities using the add another item button?
I know #tags => TRUE will make it  multivalued but that will be a comma separated just like tags. I want it like when there is add another item button just like when we add it using the field_ui.


texts: Why do I get the "Maximum function nesting level of 100 reached" error?

texts:
On all Drupal 8 beta sites, I have this error:

  Maximum function nesting level of '100' reached

Is this a problem with Drupal 8 or my server? How can I fix this error?


texts: Views Pager with ajax not working on any theme

texts:
Views pager with Ajax loading is not working on any theme.. I tried Bartik, Seven, garland Themes .. also tried to disable all modules but still not working.

I also tried enable/disable ajax in my view, Update Views modules and Drupal to latest versions.

Views still has ajax overlay when adding fields or filter criteria  .. the problem is only in pager.

How can I solve this?


texts:
I'm working on wrapping my mind around decoupled Drupal 8 while using an AngularJS app for the frontend. What I am trying to do is to allow a user to authenticate with my D8 site using their username and password, and then provide them with an OAuth token which will allow them to continue to make requests.

What is the correct flow in order to allow this type of authentication?
Is this the correct way to go about things? From what I understand basic auth isn't nearly as secure as OAuth, so I'd rather stay away from that.

I've been messing around with the simple_oath module and jDrupal, but they don't seem like they are quite "there" yet. Any suggestions?

Part of the problem I'm having, is figuring out where the OAuth modules end, and where my module needs to begin.

[Edit] I've heard conflicting things about cookie/session authentication. My end goal is to turn this into an app. Does cookie/session storage work with a mobile environment?

Thanks!


texts: Using drush when database and web server are separate

texts:
I am having trouble using drush on server setups where the web (111.11.11.1) and database (222.22.22.2) servers are separate.

drush sql-connect

gives me the correct output of

mysql --user=mysite_user --password=abcdef12345 --database=mysite --host=222.22.22.2

If i type this into the console of the web server it connects me to the mysql on the database server correctly, however...

Running

drush cc all --debug

results in the following messages

Executing: mysql --defaults-extra-file=/tmp/drush_j4KBOf --database=mysite --host=222.22.22.2 --silent  < /tmp/drush_xpMPoI
  ERROR 1045 (28000): Access denied for user 'root'@'111.11.11.1' (using password: YES)

It looks like drush is trying to connect using a different set of credentials and failing, i cannot find any my.conf where db credentials are hardcoded.


texts: How to insert a View inside other View as the last row of the parent View?

texts:
I need  to insert a View inside other View as the last row of the parent View.

I know I can create a Attachtment but this will be shown before or after the rows of the parent view. I need it to be inserted as the last row of the parent view

Let's say the parent view lists "basic pages" nodes and the inserted view lists "articles" nodes.

Then the results of what I need would be: 6 rows: the first five rows will be "basic pages" and the last one will an "article".

Is there any way to get this?


texts:
The server my site is on cannot use curl, wget or lynx to call the external cron address (eg http://example.com/cron/cron_key)

Is it possible to use php to 'run' the cron from inside the server.

I'm was thinking something like php -f /home/docroot/core/Drupal/Cron.php with a query string for the cron key, but I notice there isn't a query string as in Drupal 7.

I cannot use Drush since it's not installed on the prod servers.

I also cannot use a third party external cron service.

Any ideas?


texts: save base64 images alogside entity creation

texts:
I need to save and edit entities via services like {user, nodes, products ...etc}

the problem comes with images posted form mobile apps encoded base64.

I saved the file and stored the object in session to be used in hook_services_request_postprocess_alter to be added to the entity saved by loading it again and  assign the value to the field

// in preprocess
$_SESSION['file'] = file_save_data(base64_decode($args[0]['image']),'public://test.png');

// in postprocess
$product = entity_load('commerce_product', array($result->product_id));
$wrapper = entity_metadata_wrapper('commerce_product', $product);

//$wrapper->field_field_user_avatar->file->set($_SESSION['file']);
//$wrapper->field_field_user_avatar['und'][0]['value']=(array)$_SESSION['file'];
//$wrapper->save();
entity_save('commerce_product', $product);

what missing here I have tried many answers either adding the file object to the field when creating the field nor entity saving


texts: How can i list all display suite layout templates used

texts:
Is there a way to list all display suite templates that are currently being used in the various view modes?

To clarify: I have many content types, and many view modes, AND many custom made ds layouts. It's becomes a big mix and i would like to get an overview which ds layouts are being used by which view mode / content type.


texts: Simplenews test newsletter send by smtp: how to avoid?

texts:
I'm sending my newsletters by Drupal Simplenews + smtp-module.

When sending the mailing the smtp-provider puts it in a queue and that causes a delay from maximum 15 minutes. That's ok.

The problem is that the test newsletter is also send by de smtp-service and arrives with 15' minutes delay. Not very handy when we're preparing a mailing.

Does someone knows a method to avoid that the testmail is send by smtp but by the localhost?


texts: How do I make a rule that deletes a node when it hasn't been viewed for "X" amount of time?

texts:
Im on d7. I what to delete nodes that are no longer "pertinent" on my site. I figure the best way to do tho would be with rules scheduler, but if anyone has any other suggestions, I would be open to them.
Thanks


texts: Getting empty error message when install Drupal using Windows server 2012

texts:
I'm attempting to set up a Drupal 8.3.6 site on Windows Server 2012. I have been following this guide: http://www.drupalonwindows.com/en/blog/installing-drupal-8-windows

I'm at the point of running the Drupal installation, but am running into a road block at the Database configuration step. When attempting to save my database settings, it takes a very long time to attempt to save, and then I get an error message that simply says "Failed to connect to your database server. The server reports the following message: ." Just a blank error message.

Some info about my configuration:

I'm using SQL Server Express and maintaining it with SSMS 2017
My SQL Server setup uses Windows authentication and I am logged in as the Administrator account when working with it (I am not sure if this is different from the credentials Drupal tries to use)
Windows Firewall on my server is configured to allow connections to port 1433 as well as to sqlserver.exe
According to SQL Server Configuration Manager, SQL Server is running (SQL Server Agent and SQL Server Browser cannot be started however)
I created a database called "drupal" in MSSQL owned by the Administrator account, however I get the same error whether or not I specify this database name in the "Database name" field or if I define a new one. I am leaving the username/password blank as instructed by the installation page.
In the comments section of the install guide, one of the maintainers of the sqlsrv drivers says to use the 8.x-1.x branch if not purchasing Phpmssql, so these are the drivers I am using.
My server has 2 IP addresses, and the IP address of my Drupal site is different from the primary IP address of my server (my primary IP is used for a different site). My bindings in IIS are correct and I'm accessing the site via its designated IP. I feel like this is causing the problem with a connection issue, however if I change the host under "Advanced Options" from "localhost" to my server IP, the problem still persists.
Before using 8.x-1.x drivers, I was trying 8.x-2.x and getting the error message "The PhpMssql library is not available.", so maybe it's not an IP connection issue?

I feel like I've missed something in my configuration, but can't tell what that is from the install guide. Can anyone please shed some insight?


texts: What should I name my overriding render-function?

texts:
I'm just starting out with drupal and need some custom html for an intricate menu system. My plan is to override the html-generating functions in template.php.

My theme name is "Drupal subtheme" and the navbar I would like to target has the machine name "menu-usm-navbar-small". What should I name the functions that overrides the default html-printouts?

I think I have tried every possible combination of these. Some examples of what I've tried:

function drupal_subtheme_menu_link($variables) {
    return "foo";
}

function drupal_subtheme__menu_usm_navbar_small($variables) {
    return "foo";
}


texts: How to assign ImageCache setting to an imagefield in content type

texts:
For a self-created node type called 'Event' I added an image field.
Got all the modules going ImageCache, Imagefield, IamgeAPI, ….
under sitebuilding>ImageCache I made a setting called 'agenda-full-node-thumbnail' (agenda is dutch for calendar by the way)
I intended to assign this setting to the image field in Node type 'Event' and succeeded. But now I forgot how I did this.

The problem now is, since I put the site online, my pictures fail to reside in the directory /sites/default/files/imagecache/agenda-full-node-thumbnail and hence giving me a broken image link on my webpage.

Maybe I need to rename the path since I put it online, but can't figure out how I went about making this Imagecache setting and making it work for my Node type to begin with. And that's where I've been stuck for a couple of hours and it's driving me completely nuts.


texts: How do I add a span class to form item title in register form?

texts:
'#title' => t('I have read and agree to the') . " terms of service",

How do I add a span class to the whole title, so It would end up like so:

 I have read and agree to the terms of service


texts: CK Content Injector enabling is disabled

texts: I just installed CK Content Injector module but I cant not enable it since the checkbox is disabled. it shows missing libraries but the node.php is present in the template folder


texts: Enable View Library tab for Media module

texts: The screen shot for the Media module  description shows the View Library tab. On my content type I can only see the first 3 tabs Uploads, Web and Library. The final tab "View Library" is not available. This site consists of 1000's of images thus such a tab is very useful. Let me know what is the way to enable this.


texts:
I have a content type that users can vote on so I need that content type to keep tally of the votes.

I'm assuming I need to allow the public to edit that content type but, unsure how to go about doing so.

I on the daily basis use web services on other projects and would just POST the data to the entry on click of a button or something. Is it a similar way just POST a change to the content type via ajax in drupal?

Sorry if this is a dumb question, majority of my skills are in front-end dev not server side so any help is appreciated.


texts: Setting link field in menu content item as not required

texts:
I am trying to make a field not required in drupal 8 through hook form alter in the following way, which does not seem to work:

function mymodule_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if ($form_id == "menu_link_content_menu_link_content_form") {
    $form['link']['#required'] = FALSE;
  }
}


texts:
Is it possible to divide two columns using the the query builder?

Like: $query -> fields('A', array('valsA') / 'B', array('valsB'));


texts: Panel content page not displaying correctly after restoring backup on different server

texts:
I recently had to restore a backup to a new server, and many things seem to be working fine, but others are not. For example The panes page which is suppose to show links neatly on the page in a dropdown menu is displaying them messily around the page. My pixture reloaded theme is also not working correctly.It doesn't seem to have the css styling.

Here is a picture of what it looks like:


texts:
In my view I have a long text field. There's h1 tag on every entity that I want to remove (and content within h1). Does anyone know a way to do this?

Basically I want this :

Title

Content

To become this:

Content


texts:
How can i present groups on my group-list page similar to this site -
http://www.popsugar.com/community/groups . i want there to be a picture, group title, short description of the group and total number of members.

further, how can i go about giving groups an option to have profile picture? I presume i'll have to use views but am not sure how. i am using drupal 7 and zen sub theme.


texts: Add textfield as option for checkbox 'other' entry

texts:
I am creating a form using the Drupal 6 Form API and I have a set of checkboxes. One of the options is "Other."

Is there a way to have one of these options be a fillable field? How would I define that in the options array.

Thinking something like:

[] Option A
[] Option B
[] Other ___________

Any ideas?


texts:
I have follow this tutorial to make a modal:
http://www.mediacurrent.com/blog/loading-and-rendering-modal-forms-drupal-8

But when the submitModalFormAjax method is called I want redirect the user to a specific page:

/**
 * AJAX callback handler that displays any errors or a success message.
 */
public function submitModalFormAjax(array $form, FormStateInterface $form_state) {
  $response = new AjaxResponse();

  // If there are any form errors, re-display the form.
  if ($form_state->hasAnyErrors()) {
    $response->addCommand(new ReplaceCommand('#modal_example_form', $form));
  }
  else {
    // <<<--- redirect to homepage
    // $response->addCommand(new OpenModalDialogCommand("Success!", 'The modal form has been submitted.', ['width' => 800]));
  }

  return $response;
}

How can I do it?


texts:
I'm trying to figure out how to set the SameSite cookie attribute for Drupal 8 session cookies, but I can't find a solution.

I thought SessionConfiguration might give me enough options, but it seems not.

Where can I perform such magic?


texts: "Access Denied" to the Admin on Old and New Install

texts:
There was an access denied issue that I could not get past with my current test drupal install. I installed another drupal instance with a new db and still get this access denied error trying to get into the Admin area. This is not a cpanel, it is a server that is being setup for me.

Does anyone have ideas I can work through to get this resolved?

Does the admin have any special permissions that it needs to "chmod" etc... areas of the drupal site?

Thanks


texts: Allows users to pass from flat to threaded view for forum comments

texts:
We've migrated a site from Drupal 5 to Drupal 7, and we were unable to figure out how to allow user to change between flat and threaded view for the forum comments. This was possible in Drupal 5, but in Drupal 7 it's only possible to change the default display mode per content type (as an administrator option).

Is there a way to allow this for the users?


texts: How can I filter for "happening either now or in the future"?

texts:
I want to have an exposed filter for noticeboard items that chooses between "current & upcoming" and "past".

I'm using the composite views filter module to allow different filtering based on what is selected.

"Past" is easy - anything where the start date is before "today".

"Current & upcoming" is tricky.

"Current" by itself would be anything where the start date is before or equal to "today", and the end date is after or equal to "today".

"Upcoming" by itself would be anything where the start date is greater than or equal to "today".

I can't figure out a way to merge the two without having to duplicate all the other filters.


texts: Adaptive theme css which stylesheet to use?

texts:
In the adaptive theme in the sass folder and it has following files, I understand about some stylesheets and for what purpose they are. But I am confuse about global.base.scss, global.style.scss, responsive.desktop.scss, responsive.custom.scss and print.scss. Now which one shall I use specific purpose.

e.g. global.base.scss and global.style.scss, both has html and body now if we want to use font-size: 62.5% in root for using rem as unit so in which html shall I have to put?


texts:
Is there a way to disable translations from Title field in each content type.

In the /admin/config/regional/content-language, when I remove translations from Title fields it gives Fatal error:  Maximum execution time of 120 seconds exceeded. No matter what time I give in the ini file this always happens. Is there a way to correct this? Or is there a way to remove Title fields translation without going to content-language


texts: How to convert existing taxonomy terms (to ucwords) with Termcase module?

texts:
I'm using the Termcase module to make all the taxonomy terms ucwords in a specific vocabulary.

It also has the option: Convert the existing terms in this vocabulary immediately

It works for making the term UPPERCASE, lowercase but doesn't work for ucwords although it has the ucwords (propercase) option (first character of each word uppercase).

And if needed this is the related code part in termcase.module:

case TERMCASE_PROPERCASE;
  $words = explode(' ', $original_string);
  foreach ($words as $key => $word) {
    $words[$key] = drupal_ucfirst($word);
  }
  $converted_string = implode(' ', $words);
  break;

What should I do to make all the existing terms ucwords?