texts: How to Control Core Performance Cache Expire Time Of Day

texts:
Wondering if there is a way to control the time of day that core performance caching will expire and run cache clear all via cron.

I'd like to change my minimum lifetime setting as low as possible and use Expire or Cache Actions and/or Views Content Cache to get away from bulk cache clears on my site... which are causing WAY too much excess mySQL load.
But I want this master cache clear to happen in the middle of the night, just after the daily backup.


texts: DB query for tabular results of all a db table's info

texts:
I'm really having a hard time getting my head around the DB abstraction layer.

I've got a simple 2 column table and I'd like to output the values in the at table to a template.
I've seen plain php/mysqla  like this:

$result = db_query_range('SELECT age, savingvalues FROM {savingvalues} 21, 65);
while($row = mysql_fetch_array($result))
{
echo $row['age'] . " " . $row['factor'];
echo "<br />";
}

and it's something like this I'd like to emulate, even if I have to strongarm it a bit, can anyone please help me figure this out? I'm in drupal 6

Thanks!

Steph


texts: How to add where clause to custom Drupal view

texts:
I am fetching data from two table to my view using View API. How can I add where clause to my view?

My actual SQL query is like:

select field1,field2,field3,t2field4 from table1,table2 where t2field=field1

I come across hook_view_alter() but I dont know how to implement that.
Can I use any filter handler in my views.inc file?


texts:
I'm getting these errors on my available updates page:

  Notice: Undefined index: reason in theme_update_report() (line 86 of
  D:\Sites\technology2\modules\update\update.report.inc). Notice:
  Undefined index: in theme_update_report() (line 137 of
  D:\Sites\technology2\modules\update\update.report.inc). Warning:
  date_timezone_set() expects parameter 1 to be DateTime, boolean given
  in format_date() (line 2040 of
  D:\Sites\technology2\includes\common.inc). Warning: date_format()
  expects parameter 1 to be DateTime, boolean given in format_date()
  (line 2050 of D:\Sites\technology2\includes\common.inc).

I'm not sure where to look for an answer to these errors. I've tried setting my time zone, but that didn't change anything. Thanks in advance!


texts: What configures Drupal to send emails on the create or update of an unpublished content?

texts:
My Drupal installation attempts to send emails to a number of users whenever I create or update content but do not publish it. But because sending email is not configured errors are generated.

I don't know what configuration item I could have deliberately or accidentally set to cause that. Is there any setting or module that could cause that?

I don't think I have configured any Rules or Workflow settings to send emails, and it only occurs when the item is unpublished


texts:
I have to add a script section to the head section on the website.  I am modifying the html.html.twig file like this:

<!DOCTYPE html>
<html {{ html_attributes }}>
  <head>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
        (adsbygoogle = window.adsbygoogle || []).push({
            google_ad_client: "ca-pub-6243578269823283",
            enable_page_level_ads: true
        });
    </script>
    <head-placeholder token="{{ placeholder_token|raw }}">
    <title>{{ head_title|safe_join(' | ') }}</title>
    <css-placeholder token="{{ placeholder_token|raw }}">
    <js-placeholder token="{{ placeholder_token|raw }}">--
  </head>
  <body{{ attributes.addClass(body_classes) }}>
    <a href="#main-content" class="visually-hidden focusable skip-link">
      {{ 'Skip to main content'|t }}
    </a>
    {{ page_top }}
    {{ page }}
    {{ page_bottom }}
    <js-bottom-placeholder token="{{ placeholder_token|raw }}">
  </body>
</html>`

This seems to not work. Google responded and said I still have to connect my site to Adsense for verification. How do I do this? I have the Adsense module installed but I can't use it until I have an account. This script is for verification so that I can have an account with my website.


texts: How do I link to a local/internal file in Drupal 7?

texts:
Is there a way to get and display a local file's path in Drupal 7?

We have very large files on intranet, so I would like to instead display the file locations.

The ideal scenario would be to browse & select a file. Then instead of uploading the file drupal would save the file path i.e. x://projects/shared/example.mov


texts:
I am attempting to set up a list of articles that will display like so

2014
January
February

2013
January
Feb

I've set up my view, but once I use the YYYY contextual filter, it simply sorts it

2014
2013

And I cannot get the months to display. Any suggestions would be greatly appreciated

When I print the array the [url] returns /posts-by-date/2014

I am trying to have the array return posts-by-date/2014/[month]


texts: Why does core Search fail to index the word "HEERF"?

texts:
The word HEERF is contained within the body/content of the node, but when I search for the word is is not found.  Searching on "Federal" or "Cares" returns the page in the result set.
Content contains "FEDERAL HEERF, CARES Act, 2020 Fall Schedule, Health & Safety, Covid-19, Coronavirus, reopening, Sanitation and Cleaning, Campus Dining, social distancing" etc.
Drupal Version: 8.8.6


texts: How to convert Drupal 6 profile taxonomy value to array?

texts:
In Drupal 6, Profile module stores taxonomy values for users with this format:

a:3:{s:17:"Local Development";s:17:"Local Development";s:35:"Environmental Policy and Management";s:35:"Environmental Policy and Management";s:22:"Environmental Research";s:22:"Environmental Research";}

Is there a way to programmatically convert that to an array using PHP and/or Drupal 7 functions?

This is the array I would like to obtain:

Local Development
Environmental Policy and Management
Environmental Research


texts: So I have an access to the site as 'content' manager (at least it says content in the username field when im into dupal panel). And they asked me to change the menu a bit. But all I can do is making a limited amount of actions by default (like adding a page or a product info, etc.). There's no link to edit block or menu. As I consumed there're different types of access cos as I've seen in documentation the real administrative panel is quite functional. Am I right? So I asked for the FTP access and I got it but all I can do is changing some style rules in css and injector-css. So as I understand I can change html only in the real admin panel, right? Can I do something without that panel just having an access to FTP? And if yes, where I can find it in root folder? Thanks in advance!


texts: how to create a new node of a content type when a new node created of another content type?

texts:
my problem is :
I have a content type called job posting, every job post will associated with a test set that every candidate should write to get qualified for that job i.e., when I create a node of job posting content type another node of type test has to be automatically created.

what is the best approach towards it. It thought to try actions, but it is won't help me in any way. could any body suggest me a way to do it.


texts: Remove referenced entity if event date has passed

texts:
I have an organic group that can support events created by users (all users, not only group members).

In my event node there's a block that shows supporting ogs(Referencing entity) and in my og group node another block showing supported events(Referenced entity).

Og group admins can select which events to support using a select box.

I did this using Entity Reference and Everything works fine.

The question is: how can i automaticaly remove the supported events (the referenced entity) from the og group block and from the select box data when the event date has passed.

I try using rules but with no luck, this is my first project with Drupal, just started using the platform a week ago.
Thank you.


texts: JavaScript placement issue in tinyMce with custom theme

texts:
Just created a custom theme, everything works perfectly, but the buttons inside the tinyMce editor like bold, copy, paste doesn't show in the text area when the

<?php print $scripts; ?>

is placed at the bottom of the page (I mean before </body> tag)

It works perfectly when js files are placed at head. Is there any way I can follow best practices and place javaScripts at footer and also make the tinyMce buttons appear.


texts: How to get Media image values (alt and title) in Views?

texts:
I want to edit the Media library module View to show the images Alt and Title field value, but it is not in the available fields (only "Thumbnail(alt)" which prints the image).

All available relationships also do not give alt or title.

It seems the Image settings fields are not available in views?


texts:
I found an example on the Internet: Transform CCK field to body content.

function riddle_nodeapi(&$node, $op, $teaser, $page) {
  if ($node->type == "historia") {
    switch ($op) {
      case 'view':
        if ($node->field_svar[0]['value'] != "" AND $page == 1) {
          $svar = '<form><fieldset class="collapsible collapsed">
            <legend>Svar</legend>
            <div>'.$node->field_svar[0]['value'].'</div>
            </fieldset></form>';

          $node->content['riddle'] = array(
            '#value' => $svar,
            '#weight' => 0,
          );

          if (is_array($node->content['field_svar'])) {
            unset($node->content['field_svar']);
          }
        }

        break;
    }
  }
}

I don't know what the purpose of the following code is. Why should I use it?

 if (is_array($node->content['field_svar'])) {
   unset($node->content['field_svar']);
 }

What's the use of the hook_nodeapi() arguments $a3 and a4?
If in the case of a view operation, I set the $a3 to true or 1, will the body only effect on the node teaser? Am I right?


texts:
Currently I'm retrieving values from entityform_wrapper and checking if the field exists (fields aren't required and fail if don't exist)

Is there a better way than going through each field like this?

if (isset()) {
   $edu_completed = $entityform_wrapper->field_education_completed->value();
}
if (isset()) {
   $edu_hs_name = $entityform_wrapper->field_high_school_info->field_edu_hs_name->value();
}
if (isset()) {
   $edu_hs_city = $entityform_wrapper->field_high_school_info->field_edu_hs_city->value();
}


texts: How to associate an image node with taxonomy term?

texts:
I know this is going to be a very easy answer, but I've been trying to build on someone else's code and am frustrated as hell. I need to link an image type node with a taxonomy term (or a couple terms) for categorizing them. The table is term_node and I just need to know how this table is populated, and how I can link a node (nid) with a term (tid).

When I go to mysite.com/categories/tags/tag_name I can view image nodes linked with that taxonomy term, but there was never a good interface built to add them and I'm not sure how they where added before. His code is a mess. I believe he may have used the Image Assist module, but I'm not sure.

I thought I should just be able to set the taxonomy when adding an image, but there is no such option when adding or editing the node.


texts:
I have a view with two page displays both of which share (defaults) an exposed filter block. I've set the exposed filters to show as a block on both displays. I think used the standard block UI to display the proper filter block on the proper URL for each page display.

However, now just the correct filter block shows twice on each of these two pages.

Cache extremely cleared.


texts: What is causing the replacement of my HTML tags with paragraph tags?

texts:
I have not experienced this issue before, and I'm struggling to identify the cause. Basically, the default node field 'body' is not rendering correctly - the html is being rewritten, removing most tags and replacing them with p tags. For example:

H1 test

H2 test

I have checked the formatting of the field, it's set to default, 1 field per node etc - the normal settings as far as I can see.

With this project, I have had to use some third party modules that have been provided to me - these look like they have originated in Drupal 6, as one of the depencies is the CCK module, which I believe is not normally required in 7.

Any ideas what is causing the above?


texts: How can I programmatically distinguish if a block is enabled or disabled from block layout?

texts: I have 2 custom blocks. I have added both this in regions of block layout. But when i disabled the block from layout. I must identify it from code or api that the particular block is disabled. How to know that?


texts: How do I set the language code for rendering in entity_view()?

texts:
I'm trying to render entities using a Search API callback with entity_view().

I want to register entities of type user in the full view mode as if viewed from the Japanese language.  Here is my code:

// Explicitly set language to Japanese.
$render = entity_view('user', array(entity_id($type, $item) => $item), 'full', 'ja');

However, the output is still in English.

When I visit a user page rendered using the full view mode with a Japanese language user account, the page is displayed correctly.

So what am I doing wrong?


texts: Site reloads after it has been accessed initially

texts:
I've noticed an issue on Drupal 7 site, when user, of any role including anonymous, access site initially, page loads and then refreshes (reloads). When user continue navigating through site, there are no reloads. It happens regardless what was first link accessed (be it frontend or backend).

This reloading happens again, when some time passes, don't know what time spawn it is or trigger, but lets say "Another day".

Has someone got into similar trouble and knows what causes it?


texts: How to delete a node/nodes created by a user with rules?

texts:
How would I delete a users content automatically when a certain rule triggers?

The content is of a certain content type.


texts: How to correctly handle date formats that needs i18n

texts:
Suppose you have a date format that looks like this: "Some text Y-m-d other text H:i". Please ignore that the text needs some escaping.

What is the correct way of outputting this in a i18n friendly way?
I see that format_date attempts to do some sort of translation work, but I don't understand entirely what.

My best guess:

implode(' ', array(
  t('Some text'),
  format_date($timestamp, NULL, 'Y-m-d'),
  t('other text'),
  format_date($timestamp, NULL, 'H:i'),
);`

Is this the correct/best way?


texts: Is there any way one can display date pickers as filter for a drupal 6 view?


texts: How to implement block values in drop down list?

texts: I have created block and I have written PHP code to display the results but I want to populate these results in drop down list. I want to know how to implement block results in drop down list. Is there any particular module for this? or We have implement this through custom module?


texts: Query and print out random nodes in drupal

texts:
How to query random nodes in Drupal 6 without views?

I can print out last nodes but random nodes are the problem.


texts: Can you create new users without entering email, then prompt user upon first login?

texts:
I want the site administrator to be able to create a user, submitting only a username and a dummy password.

This information would then be 'manually' sent by the administrator to the user, whom upon their first login, is forced to enter a verification email and change their password.

How can this be done through modules or otherwise?


texts:
I get the following error after uploading a file (using FileField in CCK):
Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute() (line 2171 of /srv/bindings/ee146cfb80a24c269f208052b67f5634/code/includes/database/database.inc).

Any hints on how to fix? The file module 7.30 is used.


texts: Menu links duplicated on node/%node/edit pages

texts:
I've a strange problem.
I've a multilingual site with many menus configures as "Translate and localize".

Everything works, every menu link has his language, but ONLY when I go to a node/%nid/edit page the system prints all links, on both language (on every language)

This behaviour there is on every theme. I've i18n modules enabled.

What's wrong?


texts:
I am using hook_init to check if a variable is set, and then redirect if not...

function quickstart_init() {
  if (variable_get('quickstart_admin', 0) != 1 && $_SERVER['REQUEST_URI'] != '/welcome/admin') {
    drupal_goto('welcome/admin');
  }
}

This works for logged out users, but when you are logged in, it redirects - but the whole page displays twice!

I have traced this down to admin menu, as the second version of the page only appears once that JS runs. Does anyone know if admin_menu bootstraps onload? In which case, probably run hook_init again?

Anyway, main question....

What can i do to only run this once, is there something other than hook init that would work?


texts: How do I turn off the trimming of comments?

texts:
In D8, I'm just wanting the comments that follow the content on a node page to appear in a normal fashion, but the comment list that appears displays a trimmed comment.

The markup itself contains trimmed text:

Please make results of this

and I note that the comment is contained in a h3 tag and the content tag is empty.

I've checked the comments type display settings for article, the content display settings for the comments, which is set to show a comment list (no other options), and see nothing set to trim.

Here is some additional information that might be useful:

Comment bodies ARE displayed IF the comment is a reply to another comment.
If the comment is NOT a reply to another comment, the meta shows (author, date, etc.) but no body, even though the comments do have body text in comment__comment_body.

The twig entry that is used in either case seems kosher to me:

  {#{% if title %}#}
    {#{{ title_prefix }}#}
    {#
{{ title }}
#}
    {#{{ title_suffix }}#}
  {#{% endif %}#}

    {{ content.comment_body }}


texts: For multilingual sites, where are translated variables for the non-default language stored?

texts:
I'm managing deployment using the Features module.

Using Strongarm, I have added the site_403 (access denied page) variable to my feature.  However, this only contains the value for the default language (in my case, English).  I also have "translated" this URL into Japanese using the i18n Variable translation submodule, but I cannot find where this translated site_403 variable is stored in order to add it to my feature.

How can I add translated variables (via the i18n module) to a feature?


texts:
I have a form with the following input field:

<input type="file" name="photo_files[]" />

I would like to save each of this files using file_save_upload and then change their status to permanent via file_save. It seems file_save_upload only takes a name and NOT an array. How can I accomplish this?


texts: Reason for adding .value to access node id?

texts: I was trying to access node id in twig. After debugging for a while I found that node.nid was holding the value I wanted. However, when I tried to render using that variable it didn't print anything. After struggling for while I found that I need to append .value in the end which obviously worked. But I am not sure reason behind using .value. Can someone tell me when and where should we use such?


texts:
In my theme I need to print the breadcrumbs using two different UL class names so they can be styled differently. For mobile device the breadcrumbs appear at the top with the UL

For large device the breadcrumbs appear in the left sidebar with the UL

They both also have different LI an A class names. But I only have one template file to work with called breadcrumb.html.twig, and its themed for the topnav.

In my top region I print out the breadcrumbs with this and it the style looks good:

{{ drupal_block('breadcrumbs') }}

And for the sidebar I print out the breadcrumb again using this:

{{ drupal_block('breadcrumbs') }}

But Its using the same style as the first nav. How can I theme it differently using different class names? Can I create a theme preprocess hook and use 2 templates. breadcrumb-1.html.twig and breadcrumb-2.html.twig. THen print it like this {{ drupal_block('breadcrumbs-1') }} and {{ drupal_block('breadcrumbs-2') }}

I edited this because its not clear what I want. I mainly want to know if I can created and use two different templates for breadcrumb.html.twig. In Twig debug FILE NAME SUGGESTIONS, it does not give any suggestions for this template which means I can only use one in my theme. I think what I will do is add two different ul class names in my template then print the breadcrumb in each one,  then add style by targeting the two different ul class names.


texts: Is there a way to clear the cache without dropping tables?

texts:
I am new to Drupal and realized that when we clear cache in Drupal 'drush cr'. It executes drop db commands.

This is a very big security issue in our company because granting drop privileges to a mysql user on a production server would be dangerous

What would be an alternate solution?

  In Connection.php line 686:
  SQLSTATE[42000]: Syntax error or access violation: 1142 DROP command denied to user 'xxxxx'@'100.100.100.100' for table 'webprofiler': TRUNCATE {webprofiler}; Array()

  In Statement.php line 59:
  SQLSTATE[42000]: Syntax error or access violation: 1142 DROP command denied to user 'xxxxx'@'100.100.100.100' for table 'webprofiler'

Correction

drush cr is not dropping tables. MySQL Truncate requires the DROP privilege as of MySQL 5.1.16. (Before 5.1.16, it requires the DELETE privilege).
http://dev.mysql.com/doc/refman/5.1/en/truncate-table.htm

So this means when drush cr is run you need a user with drop privileges.


texts: I have a date field (field_date) and on the right of this field I have to display the day of the week


texts: Add popup within the ckeditor dialog box?

texts:
Here is the scenario. I had added a custom plugin in ckeditor. The plugin provide a button on the editor menu and when we click on that button ckeditor dialog box opens up with a text field and and a link attached to it. Now, when I click on the link a form with some list items should pop up using CTOOLS and when I select any items it's value should be placed in the dialog box text field.

I had created the dialog box but now when I try to click on the link it redirects me to another page instead of opens up another pop up block.


texts:
Below is the code in my module. I want to do an ajax posting to path test_call. But when am doing that am getting a 404 error message.

<?php

function callback_permission() {
  return array(
    'access simple page' => array(
      'title' => t('Access callback'),
      'description' => t('Allow users to access callback'),
    )
  );
}

function callback_menu() {

   $items = array();
   $items['test_call'] = array(

    'page callback' => 'callback_test',
    'access arguments' => array('access simple page'),
    'type' => MENU_CALLBACK,
  );

  return $items;
}

function callback_test()
{

 return "success";

}

I am


texts:
I recently inherited a Drupal 7 (7.39) site using an old version of Omega 4 (beta7) and a custom subtheme. All was well until this morning, when cron got stuck. It unstuck itself before I could start work, but now Drupal no longer recognizes the Omega base theme, so classes and other theme variables are not inserted properly, and the display is a mess.

To clarify,

I have cleared all caches from admin_menu and Devel many times (we are on shared hosting and there is no shell/Drush access).
There are no unusual errors or warnings on the status report or watchdog.
There have been no configuration changes within Drupal or on the server, which is running PHP 5.5.29 and Percona 5.6.28.
There are no Omega- or other theme-related modules installed except CiviCRM Theme, which I have disabled to no effect.
The files are all still present in /sites/all/themes/omega and /sites/all/themes/oursubtheme , and completely untouched as far as I can tell (no changes in file sizes or date stamps for as far back as we have snapshots).
As it's shared hosting, all files are owned by the account user with permissions set to 775. Again, this is not something that has changed.
the subthemes (both Ohm, the bundled subtheme, and our custom one) show up on the /admin/appearance screen just fine, but Omega itself does not.
I can get to the settings screens for the subthemes, e.g. /admin/appearance/settings/ohm, just fine. But browsing /admin/appearance/settings/omega returns an Access Denied error.
But Drupal must know that Omega is installed, because when I look at /admin/reports/updates or /admin/appearance/update, it shows up on the list of themes with updates available.
The pending updates for Omega are not security-related, so I don't think that it is a situation where it is being disabled or disallowed by a security mechanism

Naturally, the timing could not be worse for this to happen to the client, so I would appreciate any ideas as to what could cause Drupal to "lose" a theme like this, or how we might jog its memory.


texts:
When I'm managing a display for an entity and select a field formatter, some formatters have options available (see screenshot 1).
However, when I use that same field formatter in Views, there's no way to set my options.  How can I set my options?

This works.

This doesn't have a way to select options.


texts: Can't clean URL from custom query parameters

texts:
I have a client whose company has different branches. The data are retrieved from a DB (not the Drupal one).
For example, the url mydrupalsite.com/branch?branchID=1 should lead to mydrupalsite.com/branch/1, mydrupalsite.com/branch?branchID=23 to mydrupalsite.com/branch/23.
I have created a page for the branches, at which the content will change slightly and dynamically, according to the branch we choose.
 I've tried using InboundPathProcessorInterface(), OutboundPathProcessorInterface() and PathProcessorAlias(), but I can't get rid of the query ?branchID=23, so I only get mydrupalsite.com/branch/23?branchID=23.

Is there any way to achieve that?


texts: Add extra values to "next submission value"

texts:
Each time a webform is submitted it create a submission value i.e. 30 and when this is passed to the notification email it looks like:

http://localhost/sitename/admin/structure/webform/manage/contact/submission/30

What I want it to do is to have the ability to create a unique/random ID to that URL i.e.

http://localhost/sitename/admin/structure/webform/manage/contact/submission/30-abcd81091010

What I want to do is link the client to the submitted webform, but anyone could access any submitted webform just by changing the number in the URL.

Anyone able to help?


texts:
I have noticed one thing in all core files: all DB related operations are not in try-catch block.

So please suggest me whether it's good practice to put SELECT, UPDATE, INSERT query in try catch block.


texts: How to let users subscribe and be notified (email) when certain type of content or taxonomy is created?

texts:
I would like to notify users (by email) whenever a content type or taxonomy term they subscribed to is submitted.

I thought Rules may play a role in this but can't figure out how to let them subscribe to the content type/taxonomy term

Any ideas are welcome

I'm using Drupal 7


texts: Can't import configs on server due to some entities

texts:
So when i try to manually import configs (/admin/config/development/configuration) i get these messages:

Entities exist of type Media and Media type Image. These entities need to be deleted before importing.
Entities exist of type Media and Media type File. These entities need to be deleted before importing.
Entities exist of type Content and Content type Media tester. These entities need to be deleted before importing.

Core is 8.6.1

Anyone know how to solve this?
Btw this is prod, so deleting content is a no go.


texts: embed photo album hosted on flickr.com using flickr module not showing photo album

texts:
I am attempting to use the Flickr module  flickr-8.x-1.0-alpha2 along with Flickr API and Colorbox module to display a album of recent photos from  Flickr.com.

I have setup the API keys. and added flickr setings in Text formats and editors, but the it doesnt producing any output for the photoset.

However its working for single  [flickr-photo:id=3711935987].
and when i tried with [flickr-photoset:id=72157626766436507] for photo album its not working .
 giving error in the Flickr module Notice: Undefined index: in Drupal\flickr\Service\Photos->photoGetSize();

does i miss any settings ?


texts: Unserialize error in Drupal Commons 3 for unathenticated pages

texts:
I've having the darnedest time finding a solution to the following error that is seen on my login screen to Drupal Commons 3 running on Drupal 7.22.

Notice: unserialize(): Error at offset 52 of 77 bytes in registration_entity_settings() (line 863 of /var/www/html/profiles/commons/modules/contrib/registration/registration.module).

We are additionally using FBOauth. Outside of that this is a new install.

To try to disect the issue a bit more I added the following right above the unserialize call.

 859     if ($result) {
 860         print '<pre>';
 861         print_r($result);
 862         print '</pre>';
 863         $result['settings'] = unserialize($result['settings']);
 864     }
 865   }

This dumps what is in $result['settings']. I thought perhaps a value was incorrectly serialized in the first place, but I cannot see what the issue might be. The output dump...

Array
(
    [entity_id] => 5
    [entity_type] => node
    [capacity] => 0
    [status] => 1
    [send_reminder] => 0
    [reminder_date] =>
    [reminder_template] =>
    [open] =>
    [close] =>
    [settings] => a:2:{s:12:"from_address";s:17:"admin@example.com";s:22:"multiple_slots";i:0;}
)

This error disappears once I'm logged in. This is a sandbox/development box.


texts: How to retrieve Apache Solr's current search filters?

texts:
I'm using Apache Solr Search, Search API and Facet API.

Is there a way to retrieve the current search filters being used when using Apache Solr on Drupal?

For example: I have a website using facets which reference a taxonomy called colours.  In this facet, there's a list of colours - if I select Green, this generates an Apache Solr search - using green as the filter.

www.example-website.com/?f[0]=field_colour%3A2712.......etc

When the Solr search is created - I guess, I could grab the term id 2712 from the URL using GET - but there must be a cleaner way.

Any ideas?


texts: Search api solr create a custom search link

texts:
I try to create a custom search link like this :

l(t('See our Job Ads'), 'search', array('query' => array('f[0]' => 'is_recruiter_nid:' . $nid )));

when i click on the link nothing get filtered.
P.S : i have added the filter 'is_recruiter_nid' in code using the hook_search_api_solr_documents_alter() Something like:

function MYMODULE_search_api_solr_documents_alter(array &$documents, SearchApiIndex $index, array $items) {
  foreach ($documents as $document) {
     ...
     $document->setField('is_recruiter_nid', $recruiter->nid);
  }
}

How I can do this? Is there any example ?

Thanks for your help.


texts: Drupal 6: Allow external site to authenticate via Drupal

texts:
How would I allow a simple PHP site, which already has a user db, to let Drupal handle the logging in of users? I guess I could use services (but I would need help on this) or alternatively is there some way that users are passed to the Drupal login form to log in, but the simple external PHP site knows, through some kind of cookie arrangement, that the user is logged in?

The main priorities are that the user should only have to log in once for both sites, and the existing users on the external site can be maintained and transitioned smoothly. I want Drupal as the main user db because it's more secure and I think it's easier to have the external authenticate off Drupal rather than the other way around.

Any thoughts?


texts: Is there a module that will take an entity machine name and optionally id as input, and generate a suitable edit form as output?


texts: How can I send an e-mail whenever user registration fails?

texts:
I am a bit concerned that my user registration is too complicated.  I have done some basic usability testing, but I'm still not confident, so what I'd like to do is send an e-mail to myself every time a user makes a mistake on the registration form that requires a correction before registration can be processed (Mollom validation fails, no input in a required field, etc.)

Is there an easy "catch-all" way to do this for all possible mistakes users can make?


texts: How to make an Openlayers map based on geojson layers with exposed filters?

texts: Openlayers builds maps combining multiple layers, some of which are based off of view into a single map. From what I have experimented with, putting an exposed filter on a geojson based views, doesn't put an exposed filter on top of the map block. So, how could I make a map that would be searchable through an exposed filter?


texts: Change drupal standard messages like "You have just used your one time login link"

texts:
I'm having trouble with changing drupal default messages.

Like for example when you register you get an email with a one time login link (I know how to change this email text) and when you click on the link you get the message

  This is a one-time login for username and will expire on ... .

  Click on this button to log in to the site and change your password.

  This login can be used only once.

But how can I change this text? Another example is:

  You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password.

How can I change these texts?


texts: Text format dropdown has dissapeared from edit article form

texts:
There is something strange it happened at a certain time. I no longer can set the text format from article (node) edit because the Text format input has dissapeared.

I can configure them from Configuration page but no longer can choose them from edit mode.

I have all permissions over them set up ok.

Please if you have any suggestions help me up.

Strangely, this combo dissapeared from admin/structure/types/manage/CONTENT_TYPE/fields/body as well

I tried to alter the content type filter using a module but no luck:

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

 $form['body']['und']['0']['#format'] = "full_html";

}


texts: Export selected view rows and selected columns to excel

texts:
I use VBO export module and Views Bulk Operations module to export my view results to CSV. This works fine. The user can also make a selection which rows to export.

Is there a solution to let the user also select which columns (which view fields) will be exported to CSV?


texts: Setting a default value in views jump menu d7

texts:
I followed a tutorial on how to use the jump menu functionality in views drupal 7 link http://dev.nodeone.se/node/771,it was successful.
i have one problem though,I need to show a default value(for example a taxonomy term by default) if nothing is selected instead of the  drupal default to -select- .
i have opened the file in views/plugins/views_plugin_style_jump_menu.inc and found this code,it looks like here is where i am supposed to change. but i just dont understand this code. Any help will be appreciated

function option_definition() {
    $options = parent::option_definition();
    $options['hide'] = array('default' => FALSE);
    $options['path'] = array('default' => '');
    $options['text'] = array('default' => 'Go', 'translatable' => TRUE);
    $options['choose'] = array('default' => '- Choose -', 'translatable' => TRUE);
    $options['default_value'] = array('default' => FALSE);

    return $options;
  }
?>


texts: How to sort content in Views by menu weight

texts:
I have a D7 Views view which delivers a number of nodes. I would like them to be sorted based on the weight that their relevant menu items have.

I would like to avoid the fine module DraggableViews or any additional weight field for that matter.

How could this be accomplished?

Relevant pages: https://drupal.org/node/313140


texts: How do I filter entity reference fields based on language?

texts:
In a Drupal 8 site I have a node content type "page" that references a custom entity type using inline entity form. "Page" also has a paragraphs field usig the Paragraphs module.

The site have multiple languages and therefore the following scenario appears:

I have an existing "page" node in both english and german containing entity references and paragraphs.
On the english node I add a new paragraph and a new entity reference and save the node.
When viewing the node in english I see the  added content.
When viewing the node in german I also see the new content, which is in english.

I don't want number 4 to happen. That is, I don't want the new untranslated entity and paragraph to be visible on the german translation of the node. The entity reference and paragraph fields are not set as translatable but the target entities are translatable. From what I understand, this means that the newly created entity will be in english, the same is true for the paragraph.

To solve this I'm thinking I should be able to filter out the untranslated entities and paragraph items when viewing the node so that any item that is not in the current language is not shown. The they won't be visible until I go and edit the german node and resave it, which will create translated versions of the entity and paragraph item.

But I am unsure how to go about filtering the fields. Is there any suitable hook that can be used? Or am I going about this in the wrong way?


texts: How to create local task links for referenced entities on a node?

texts:
I have a content type, which has three reference fields to three different content types. I want to create secondary task links to those referenced entities.

Let's say that I have a Product content type which reference fields to Manufacturer, Distributor and Technical Details content types.

If you visit a content of type Product, I want to show three secondary tabs to Manufacturer, Distributor and Technical Details contents which are referenced from that specific node (Product).

Fore example, we have a product with following fields:

Product X (node/1):

Manufacturer A (reference to node id: 2)
Distributor B (reference to node id: 3)
Technical Details X (reference to node id: 4)

If I visit Product X (node/1), I want to get three tabs to node/2, node/3, and node/4.

How can I achieve this?


texts: Trigger Rules when Ubercart order is edited

texts:
I am trying to figure out how to trigger a rule when an Ubercart order is edited (for example, when an admin user views the order, clicks the edit tab, changes some info on that page, and then clicks the "Submit Changes" button). I have tried the "Order Status Gets Updated" event, but that only works when you update the status itself on the order's "View" tab (which, of course, is what it is supposed to do). The admin could Edit the order, and then View it and update its status, but I'd like to remove the status update step to streamline this process.

Does anyone have any ideas on how to trigger a rule in this fashion?

Thanks!


texts:
I'm trying to limit certain views on certain pages, like preventing certain articles from appearing on /node, and I'm using hook_views_query_alter() with \Drupal::service('path.current')->getPath() to figure out when to do that.

Is this going to work, or will view cache kick in before this hook can be used? How can I write my own rules into the view so that it will only cache after I've been able to add in my excludes?


texts: Re-write the output of taxonomy_term_page() without hacking core

texts:
In Drupal 7, taxonomy.pages.inc contains the taxonomy_term_page(), which places a <div class="term-listing-heading"> around the taxonomy heading output.

How can I re-write the output of taxonomy_term_page() in my theme, so I can remove the DIV without hacking core?

I'm quite surprised that there isn't a tpl.php file available for taxonomy_term_page() as this would making theming much easier.


texts: Add a custom attribute to the main div of a node only on teaser view mode

texts:
I want to add a custom attribute to the main div of a node only on teaser view mode.
e-g

<div class="node" tarbot="left"> </div>

I need to add tarbot attribute to the main div of a node to apply a JS function. I want to affect only teaser view mode with my Function, not Full content display.


texts: Commerce Flat Rate Shipping not being added in Paypal Express Checkout

texts:
I'm hoping this is straight forward, but I can't seem to find the answer.

I have Drupal Commerce setup and working properly.
I have Commerce shipping setup to use a flat rate of $7.00
I have Commerce PayPal Express checkout setup.

Product is $40.00
Flat Rate shipping is $7.00
Once customer adds shipping the total reflects $47.00
When the customer goes to PayPal to pay, PayPal is only showing $40.00

For some reason, the shipping amount is being removed once the customer hits PayPal.

Anyone know what's wrong?


texts:
I have problem with drupal behaviors and context in combination with big pipe. It seems like context variable sometimes contains same part of page. I have tried:

(function ($, Drupal) {
  Drupal.behaviors.myCustomBehavior = {
    attach: function (context, settings) {
      console.log(context);
    }
  };
})(jQuery, Drupal);

When I load page and watch browser console contexts there is div with main menu block but there is also whole #document element which contain menu block also (see screen).

This behaviour is for me real problem because I use zurb foundation and I have to initialize all components and I do it:

(function ($, Drupal) {
  Drupal.behaviors.myCustomBehavior = {
    attach: function (context, settings) {
      $(context).foundation();
    }
  };
})(jQuery, Drupal);

I think this is correct way how to initialize foundation for all elements and it should be compatible with big pipe. But if I get same html part in context twice (some sub elements in context are same) I initialize some zurb foundation plugin twice (see next image).

This breaks zurb foundation plugins. I'm not sure what to do. I read lot of Drupal documentation about js, behaviours and big pipe and according to documentation there should not be problem.

When I disable big pipe everything works as expected but that's not solution.

Do anybody knows what am I doing wrong?


texts: How to create a button that sets a node value

texts: I would like to create a set of buttons or text links on my site that set the value of a node field and/or create additional nodes.  Currently, I am using a combination of flags and rules to do this (when a flag is set, do the following...) This works fine, but it feels a bit cumbersome.  The flag has no other purpose other than triggering an action.  Is there a module specifically for doing this (including ajax) or is there another simpler way to perform this activity?


texts: Image field upload shows a broken preview until I reload the page

texts: When I upload an image it does an AJAX upload and then tries to show the thumbnail but the thumbnail style of that image is not available, so it shows up as a missing image. If I save and come back to the form, then it displays fine.


texts: Form Default Values missing on theming form

texts:
Long story short when doing some basic theming on a drupal form the default / previously saved values refuse to display within the form fields (works without theming of course).  In the code exerpt below we are simply taking some for fields and sticking them into a drupal table to better organize the overall page.  This is within the hook_form_alter() framework.

$form['top'] = array(
  '#theme' => 'table',
  '#header' => array(array('data' => $form['#node']->title, 'style' => 'text-align: center; font-size: 1.6em; color:#333399; margin:1em 0; background: transparent; border: 1px solid #FFF; border-bottom: 3px solid #CCCCCC;', 'colspan' => 2,),),
  '#rows' => array(array(drupal_render($form['title']), drupal_render($form['field_order_id']),),),
  '#weight' => -8,
);

The form correctly outputs the form items and submits correctly, all that is missing is the default / previously saved values.  Nothing around the internet seems to have a workable solution either.


texts: Upload one image but save/export to multiple formats

texts:
Have been searching for this quite some time but I can't seem to find an answer. There must be someone who has encountered this before.

What I want to do is have an editor upload 1 image and then save/export it to multiple formats. Automatically save a thumbnail, smaller teaser version and a version that has a color filter. I don't want to create 3 upload fields and have the editor choose a filter.

Any help is appreciated.


texts:
It's possible to skip required body field validation, if it's empty? I can add custom validation on the first place, like:

  $form_validate = $form['#validate'][0];
  $form['#validate'][0] = 'remove_body_field_validation';
  $form['#validate'][] = $form_validate;

function remove_body_field_validation($form, &$form_state) {
 $form_state['complete form']['settings']['body_field']['body']['#required'] = FALSE;
}

But i think the "required validation" runs before "remove_body_field_validation"?? :-/


texts: Output node creation date between two fields

texts: I want to print the creation date of nodes of type article between two fields. I know you can do this with Display Suite, but I don't want to install the module only for this functionality. My only idea is to put an if condition into the for loop of field.html.twig to print the date after a certain field occurs, but I wonder if there is a better solution.


texts: Migrate FieldCollection with host entity FieldCollection

texts:
in our Drupal application, we have a few field collections that themselves have field collections. It looks like this:

field_collection1
 ├── field_xyz
 ├── field_collection2
 └── field_collection3

I am currently implementing migrations for all our content, and am a little bit stuck trying to figure out the best way to migrate these collections. I have absolutely no problem migrating field_collection1 and field_xyz using the MigrateDestinationFieldCollection class, but don't know how to approach the two nested collections.

Looking at the documentation available for migrating field collections, the only two host_entity_types that are supported seem to be node and term. field_collection1 is of course neither a node nor a term, so I am not sure how I would set it as the host entity. Is that even possible?

If not, would it be a sensible option to create the two nested migrations in the complete hook if the field_collection1 migration?

I am really appreciating any feedback on this.


texts: Why is my sub-menu not loading in main menu?

texts:
<div class="row" id="mainNav">
 <?php print theme('links__system_main_menu', array(
    'links' => $main_menu,
    'attributes' => array(
      'class' => 'menu',
    ),
  )); ?>
</div>

I've used the above code to load main menu in page template. This code fails to display submenus. Please suggest.


texts: Dynamically size images for mobile first design (omega theme)

texts:
I've built my first site using an omega subtheme and I'm really liking it. The mobile first design dynamically changes the width of the page to follow the width of the browser.

With my column arrangement with a wide browser, my content area is 780px wide. So, the header images I use on my blog posts are up to 780px wide. If the user's browser is more narrow, then the css will shrink the content area to the following sizes:

wide: 780px
normal: 620px
narrow: 460px
mobile: 720px and smaller (in this arrangement the sidebars are removed to give the content more room.

The smaller the browser gets, the smaller the content area gets. When it is below 720px, then it follows pixel for pixel, so if I make my browser only 480px wide, then that's how wide the content area will be.

PROBLEM:

The header image on my Article nodes is up to 780px wide so that it fills the content area in the widest browser size. However, when the content area shrinks to 620px, the image doesn't get smaller which means that it overlaps the side bar.

The image below shows how the layout would work in the "wide" arrangement.

The next one shows how the header image is overlapping the sidebar in the "normal" arrangement:

I tried to solve the problem by setting the css width of my header image to be 100% of its container element. That did successfully restrict the width of the image, but when drupal generates the html for that image it always includes explicit width and height tags. This causes the image to become distorted because the width is shrinking to match 100% of the parent container but the height isn't changing along with it, so it ends up looking like this:

Is there a way to prevent drupal from including the explicit height attributes? Or is there some other drupal solution?

I know that I could set up some javascript to strip those attributes off, but that seems really hackish.

Any suggestions or solutions?


texts: After update to 7-2.8 "Conditions" not working

texts:
It seems that after the update to the latest version 2.8 the Conditions section stopped working. No matter which condition I try to choose, nothing happens - my browser just keeps cycling forever.
Anyone has the same problem or a solution?
Thanks


texts: How to manage contextual filters for a simple date-based view

texts:
I'm building a simple view to show content of X type, filtered by date. I want this view to be available via URLs like:

/events/2012       - Show all content for this year only
/events/2012/11    - Show all content for this year and month only
/events/2012/11/28 - Show all content for this exact day only

These URLs form part of this section's hierarchy so the patterns are non-negotiable.

The date I'm filtering on is a date field provided by the Date module, and has an optional end date.

I've tried setting the path of the view to /events/%/%/%, and have added three contextual filters for the date field. The granularity for each of the filters is set correctly to the respective date part for that filter.

However, none of that works; I either get all event content, regardless of year, for the year filter, or no content at all if I include the other filters.

There are several related questions (none with answers as it happens):

https://drupal.stackexchange.com/questions/29663/contextual-filters-and-year-by-date-module
Creating a contextual filter for a view based on month and day
Use date as Views Contextual filters

But nothing that covers exactly what I'm looking to do.

How do I tame these contextual filters, without resorting to the PHP filter which is simply not an option? I can't believe that there's no way to do this just with the UI, it seems like one of the most obvious use-cases.

UPDATE

I tried using a filter with a granularity of month, and changed the argument to 2012-11...and it worked.

So I think the answer is simply that the date filter handlers don't work as I expected.


texts: Anonymous Flag with boost module enabled

texts:
I have a node type which allow anonymous to use flag (Non global flag).

The problem is with Boost enabled, all anonymous users have the same flag status at the cached page.

For eg, anonymous A Bookmarked a node and the page get cached, when anonymous B visited the page she has the Bookmarked status as well which is undesirable.

How should i update the flag status by user?

Any suggestions are welcome!!


texts:
what's the best way to go about to hacking core variables? I need to edit a few values in Drupal core's common.inc, for instance:

  'name' => 'Generator',
  'content' => 'Drupal ' . $version . ' (http://drupal.org)',

and also in user.pages.inc

$timeout = variable_get('user_password_reset_timeout', 86400);

but if I update drupal core, these values will return. Is there a "Drupal way" of editing these values so that I don't have to do that every time?

Thanks.


texts: How do I add multiple links in each table row form table?

texts:
I am new to drupal 8. I have created a form listing in admin.Now i want to add three or more links for operation(Edit/Delete/Suspend) in single TD columns. Can anyone let me know how to do this? I tried by concatenation two links but did not work. I am creating links as below.

$query = \Drupal::database()->select('vacations', 'v');
    $query->fields('v');
    $table_sort = $query->extend('Drupal\Core\Database\Query\TableSortExtender')->orderByHeader($header);
    $pager = $table_sort->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(10);
    //$results = $query->execute()->fetchAll();
    $results = $pager->execute();
    // Initialize an empty array
    $output = array();
// Next, loop through the $results array
    foreach ($results as $key => $result) {
      $approve_link = Link::fromTextAndUrl(t('Approve'), Url::fromRoute('vacation_forms.operations', ['ID' => $result->id, 'action' => 'approve']))->toString();
      $reject_link = Link::fromTextAndUrl(t('Reject'), Url::fromRoute('vacation_forms.operations', ['ID' => $result->id, 'action' => 'reject']))->toString();
      $newLink = $approve_link; // this works
      //$newLink = $approve_link . "|" . $reject_link; //this does not work it shows plain html in table columns
      $output[$result->id] = [
        //'id' => $result->id,
        'employee_name' => $result->employee_name,
        'employee_email' => $result->employee_email,
        'vacation_start_date' => $result->vacation_start_date,
        'vacation_end_date' => $result->vacation_end_date,
        'leave_days' => $result->leave_days,
        'status' => $result->status,
        'operations' => $newLink,
      ];
    }
    $form['table'] = [
      '#type' => 'tableselect',
      '#header' => $header,
      '#options' => $output,
      '#empty' => t('No users found'),
    ];

I am using Drupal 8.


texts:
Drupal 8.x

I have a view returning:

UID: 1, NID: 1, VALUE: 9
UID: 1, NID: 3, VALUE: 8
UID: 1, NID: 2, VALUE: 7
UID: 2, NID: 9, VALUE: 5
UID: 2, NID: 5, VALUE: 4
UID: 2, NID: 7, VALUE: 3

I would like to only return:

UID: 1, NID: 1, VALUE: 9
UID: 2, NID: 9, VALUE: 5

My goal is to show only one row per UID which contains the highest VALUE. For this view, NID does not matter, but it is a part of the Database table and query being sent to views with hook_views_data() and is used elsewhere.

Can the Views module accomplish this?


texts: How to make a new field type visible to the Rules module?

texts:
I have installed the Examples for Developers module, and enabled the Field Example submodule. It creates a new field type called field_example_rgb.

I've added this field to a new content type. I'm trying to set and/or display the value of the field using Rules - to no avail. Rules does not "see" the field in the node.

I've tried adding a file called field_example.rules.inc that implements hook_rules_data_info(), still without luck. Can someone please help me figure out how to make the field visible to Rules?

This is the code of the hook_rules_data_info()

   function field_example_rules_data_info() {
  return array(
    'field_example_rgb' => array (
      'label' => t('example color rgb'),
      'wrap' => TRUE,
      'property info' => array(
        'rgb' => array(
            'type' => 'text',
            'label' => 'RGB',
        ),
    ),
    ),
  );
}


texts: Is this the proper way to alter a path defined in code by another module?

texts:
I have installed the FAQ module on my site, and it defines the path to the FAQ page in code as 'faq-page'. I would like to make the path be 'mypath/faq' instead. I think I need to create a little module that implements hook_menu_alter(), so that if I upgrade the FAQ module, my custom path won't be overwritten. I think it should go something like the following:

/**
* Implements hook_menu_alter.
* Override FAQ page path defined by the FAQ module.
*/
function MYMODULE_menu_alter(&$items) {
  $items['mypath/faq'] = $items['faq-page'];
  unset($items['faq-page']);
}

Is this the proper way for me to override the path defined by another module?


texts: Ability to flag each uploaded image separately after doing multiupload

texts:
I want to create some kind of photography website where users will be able to flag some images for later use.

This is the user story:

Photographer upload images of the client event on the website
Page with a gallery is created
A client comes to the gallery page and marks few items using Flag module
A view is created with a list of flagged images so Photographer can get a list of images for further manipulation

The problem is if I use multiple image field there is no way to use Flag module as it works only with nodes, and I have all images in a single node.

There is this issue in Flag module where it says why is not possible.

So I'm wondering if there is a way to convert images to nodes after creating an initial node that contains all of the images?

Or do you have any other suggestion how to handle this?


texts: How to effectively manage a site with Drush make?

texts: What things are important to consider when managing a site using Drush make?


texts: Possible conflict with multiple jquery plugins

texts:
I have a custom module that uses the jCarousel jquery plugin (not the Drupal module). The module code up to this point works correctly, and looks like this (only the main function included for brevity.)

function speaker_carousel_block_view($delta = '') {
 switch($delta){
    case 'speaker_carousel':
      drupal_add_js('sites/all/libraries/jcarousel/lib/jquery.jcarousel.min.js');
      drupal_add_css('sites/all/libraries/jcarousel/skins/speakers/jcarousel-speakers.css');

     drupal_add_js(
       'jQuery.noConflict();
            (function($) {
              $(document).ready(function() {
                 jQuery("#mycarousel").jcarousel({wrap: "circular"});
                });
            })(jQuery);',
       'inline'

     );

        $block_content = "";
        //Use our custom function to retrieve data.
        $result = speaker_carousel_get_data();

        //parse into html
        $block_content .= '
';
        $block_content .= speaker_carousel_create_html($result);
        $block_content .= '
';

        $block['content'] = $block_content;
  }
  return $block;
}

I'm now trying to incorporate a second plugin ([jquery tools tooltip])2 to handle a mouseover popup of some text. This is what the function looks like after additions:

function speaker_carousel_block_view($delta = '') {
 switch($delta){
    case 'speaker_carousel':
      drupal_add_js('sites/all/libraries/jcarousel/lib/jquery.jcarousel.min.js');
      drupal_add_css('sites/all/libraries/jcarousel/skins/speakers/jcarousel-speakers.css');
      drupal_add_js('http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js', 'external');

     drupal_add_js(
       'jQuery.noConflict();
            (function($) {
              $(document).ready(function() {
                 jQuery("#mycarousel").jcarousel({wrap: "circular"});
                 jQuery("#mycarousel img").tooltip();
                });
            })(jQuery);',
       'inline'

     );
        $block_content = "";
        //Use our custom function to retrieve data.
        $result = speaker_carousel_get_data();

        //parse into html
        $block_content .= '
';
        $block_content .= speaker_carousel_create_html($result);
        $block_content .= '
';

        $block['content'] = $block_content;

  }
  return $block;
}

As soon as I add the second drupal_add_js() call in (to the cdn.jquerytools.org site), everything blows up. The carousel no longer displays correctly; it just shows a single item instead of the horizontally scrolling strip of images that was there before. Any idea how I can get the two to play nicely together?

I found the JQuery Multi module, which I really thought would help. I installed and configured, and now the carousel no longer blows up, but I get an error in Firebug console:

  jQuery("#mycarousel a.speaker_trigger").tooltip is not a function
  jQuery("#mycarousel a.speaker_trigger").tooltip();

I know it's not an issue with the two plugins working together, because I copied the rendered source into a static HTML file and put it here. It works fine, but it's only using a single version of jquery.

Do you have any idea?


texts: My page is refreshing rather than directing when I hit submit on form

texts:
I am a noob to drupal and cannot figure out why my form isn't working correctly. The form itself loads fine and if I go to the redirect page manually it works, so I figure its a problem with my submit or redirect but I cannot figure out what is going wrong.

<?php

function queen_attack_menu(){
    $items['queen_attack']=array(
    'title' => "Queen Attack!",
    'page callback' => 'drupal_get_form',
    'page arguments' => array('queen_attack_form'),
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM,
);
$items['attack_calculated']=array(
    'title' => "Attack Results!",
    'page callback' => 'attack_results',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
);
return $items;
}
//chess board 8x8 so coordinates 1-8 for each side
function queen_attack_form(){
$form["queen_coordinates_x"] = array(
    '#title' => 'Queen Horizontal Coordinate',
    '#type' => 'select',
    "#options" => array(
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8
    ),
    '#description' => t('Enter your starting horizontal coordinate for your Queen'),
);
$form['queen_coordinates_y'] = array(
    '#title' => 'Queen Vertical Coordinate',
    '#type' => 'select',
    '#options' => array(
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8
    ),
    '#description' => t('Enter your starting vertical coordinate for your Queen'),
);
$form['target__coordinates_x'] = array(
    '#title' => 'Target Horizontal Coordinate',
    '#type' => "select",
    '#options' => array(
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8
    ),
    '#description' => t('Enter the horizontal coordinate for the target piece'),
);
$form['target_coordinates_y']= array(
    '#title' => 'Target Vertical Coordinate',
    '#type' => "select",
    '#options' => array(
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8
    ),
    '#description' => t('Enter the vertical coordinate for the target piece'),
);

$form['submit'] = array(
    '#type' => 'submit',
    '#value' => "Queen, Attack!",
);

return $form;
}

function queen_attack_form_submit($form, $form_state){
//$queen_x;
//$queen_y;
//$target_x;
//$target_y;
$queen_coords = $form_state['values']   ['queen_coordinates_x'];//['queen_coordinates_y'];
$target_coords = $form_state['values']   ['target__coordinates_x'];//['target_coordinates_y'];

//session hit or miss

$_SESSION['queen_coords'] = $queen_coords;
$_SESSION['target_coords'] = $target_coords;
$form_state['redirect'] = 'attack_calculated';
}

function attack_results(){
 $result = 'Hit or Missed';
    return '
 Queen Coords: ' . $_SESSION['queen_coords'] . '

     Target Coords: ' . $_SESSION['target_coords'] . '
';

//      return '
 Your Queen' . $result . 'the target!
';
}


texts: Remove node_view rendered node's title link

texts:
I am using the code below to add a form to my node. This renders a page with the node and form on it. Apparently, the node is rendered with its title as a link. I would like to have the node's title without a link. So I tried to change $node->content, but there seems to be no value that determines that the node title is a link. how do I change this with code?

$form = array();
$node = node_load(24)
$form['offer_form'] = array(
  '#value' => drupal_get_form('dt_offer_entry_form', $node),
  '#weight' => 10
);
$node->content = $form;
return node_view($node);


texts: How to remove a specific term page link?

texts:
I have taxonomy term list page..

Apple
Banana
Sweets
Cake

These are the terms listed with links to default term page.

suppose I want to remove the link for Apple only but listed how do I go about it?

I have tried this

  function mytheme_node_view($node, $view_mode, $langcode) {
    if (isset($node->content['field_fruit_name'])) {
      foreach ($node->content['field_fruit_name']['#items'] as $delta => $item) {
         if (count(taxonomy_select_nodes($item['taxonomy_term']->tid)) < 2) {
           $title = $node->content['field_fruit_name'][$delta]['#title'];
           $node->content['field_fruit_name'][$delta] = array();
           $node->content['field_fruit_name'][$delta]['#markup'] = $title;
         }
      }
    }
  }

its not working... so if i can remove the link for each term individually it would be great.


texts: how do i create a site that allows users to create "organizations?

texts: I'm creating a site where users should be able to create organizations(groups) that other users should be able to join....a list of these orgs should be accessible by all users of the site on an "orgs" page.....whats the best way to do this? thank you very much!


texts: Views: if fieldvalue (external link) is set, use it, if not, link to node

texts:
For my articles, i've added a field "external_link". If this link is set, the headline should link to an external website, and if not, the headline should open the articles detailview.

Now i have the fields of my view two fields, which are excluded from the display, the external_link, and the nid. And on the headlinefield, i can do a

"rewrite results -> output this field as a link"
and write either node/[nid] or [external_link],

but how to use conditions in views, to use the external_link if set, and the node/[nid] if not set? I'm new to Drupal and i have no idea how or where to add this condition...


texts: How to pull a record from Salesforce and immediately push the node ID back to Salesforce

texts:
I'm using the Salesforce Suite module.

What I'm trying to accomplish:

When a record is created in Salesforce, that record is pulled into Drupal and the new node content ID is pushed back to the Salesforce record (for reference in Salesforce).

I have a mapping set up as such:

Triggers

Drupal create (push)
Drupal update (push)
Salesforce create (pull)
Salesforce update (pull)

Fields

Title - Salesforce to Drupal
Content ID - Drupal to Salesforce

With this setup, it pulls the record into Drupal but the Content ID doesn't get pushed back to Salesforce. It will, however push when I update (just save) the node but we don't expect these nodes to be saved anytime soon after it's pulled in.

I've tried a few different ways leveraging the events dispatched by the Salesforce module but it always leads me to a race condition or a circle.


texts: No route found for GET /block-render?_format=xml

texts:
I have installed render-block 8.x-1.0-alpha1 module in drupal 8 and i try to get all blocks like this:

http://localhost/drupal8/block-render?_format=xml

But i get this message error:

<response>
    <message>No route found for "GET /block-render"</message>
</response>

where is the problem ?


texts:
I'm trying to start a session for anonymous users (using Drupal 8.2.2), so I can use the private temp store, but the session does not persist. This is what happens with anon users:

// $session is the Drupal `session` service (Symfony Session component)
$session->start();
var_dump($session->isStarted()); // always FALSE
var_dump($session->getId()); // changes from request to request

With an authenticated user, isStarted() returns TRUE, and the session ID remains the same.

How can I start a session for anonymous users that will enable private temp store?


texts:
I'm doing a multistep form and I need to add images next to radio buttons. The radio buttons has the description and the image show what is the option.

Now I have the radio buttons list

Now I need to insert above the description the image. Something like this.

I don't know how to do it... Could anybody explain me how to do it?
Thank you.


texts: How to override a module in sites/all/modules directory?

texts: Is there an easy way to override a module located in sites/all/modules directory? Like placing it's customized version into modules/ directory or create one under sites/default/modules?


texts: Make almost duplicate copy of node when submitting

texts:
We have a meeting room booking system that needs one extra feature added. Meeting rooms 1 and 2 have a removable wall so people can book Room 1, Room 2 or Rooms 1 and 2. What I need is a way during booking for the option to book one or both rooms.

My plan: Offering separate booking forms for Room 1 and Room 2 and just have a field where they can check off if they need the other room booked with it. If this box is checked, it will create a duplicate booking with a new ID and the room number (Term reference list) changed.

From my reading, I think I need to use node_save() to do this? I am not sure where to call this from though. I assume I need to call it from one of the hook_node_* things (as we already do for some other custom code)?

Basically, how do I create a duplicate node when submitting a form with almost identical data but one field is changed before it saves the copy?

Thanks!


texts: Migration from csv problem (Incorrect string value: '\xAB Nove...')

texts:
In my drupal 8 project, I'm trying to import data of a content type from a csv file, everything is well, but when I'm trying to execute the migration command drush mim my_migration I got the following error:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xAB Nove...' for column 'sourceid1' at row 1 in                   [error]
/Users/brahim/Sites/news8/core/lib/Drupal/Core/Database/Statement.php:59

It seems like a problem of database encoding.. but I don't know what is it really, any idea about the solution?


texts: customer commerce profile = user profile

texts:
is it possible to get all registered users into commerce profiles? /admin/commerce/customer-profiles

I mean when I create an account for user drupal will automatically create a commerce profile


texts: How to create test users on the localhost?

texts: I would like to make test users on my localhost (in my case I am using WAMP). Since I need to be able to authenticate them via email. I am not getting it to work what can I do?


texts: How can I programmatically extend the registration form?

texts:
I'm trying to extend registration form programatically to add an additional field. I was following an example from Extend _form in Drupal 8

I created a new service that will redirect to the new form.
I created a route subscriber to that will return the new form.
I created a form class that will extend the form.

It works for the user login form but wont work on user registration form because it is an _entity_form and I guess it should be treated differently. I changed the router subscriber to match registration form but i get this error.

Call to a member function getEntityTypeId() on null.
if ($route = $collection->get('user.register')) {$route->setDefault('_entity_form',
'\Drupal\form_overwrite\Form\NewUserLoginForm');

Can anyone suggest please what's the right way to extend this form?
I tried with the all known hook_form_alter but even like that I'm not sure how to save the new field content in the configuration files.


texts: How to use PHP Evalution in rules scheduling

texts:
I have a rules component that i want to trigger on specific time that is set by end user.
in my case i have a form where user create rental property and select the rent date there. then i have another form of alerts where user can set alerts related to rentals. like user wants alert before 2 days of rental date. I am able to set the rental date but unable to get the value of alerts section to check what value the end user has set to get an alert. I tried to put sql query in 'PHP Evaluation section' but in scheduling section it shows the blank date. Rule that i have creatrted:

component: Schedule reminder to end user
Rule: Schedule rental alerts
action: schedule component evaluation
      data-selector:node:field-rental-start-date
      php evaluation: $query = db_query("SELECT field_days_before_the_rent_value FROM field_data_field_days_before_the_rent");
foreach($query as $result){$res = $result->field_days_before_the_rent_value;}
return $value - $res;

Please help me here how i can get the field_days_before_the_rent_value.


texts:
I have a small jpeg image that I want to display in a panel.

I created a panel with the layout I desired but I am confused as how can I display an image inside one of the columns of the panel.

I tried adding a new custom content in which it presents a html text area. But not sure how would I add the correct url without hard coding the entire path (i.e: the host and sub directory etc).

Please enlighten me :)


texts: React if user's text changes in existing node are major

texts:
I would like to ask about some ideas about following issue:
I have a content type - answer, that can be created and edited (not deleted) by users. From time to time, for any reason an user can delete all text inside node, thus completely destroying it.

I do not want to be informed about every subtle change in node, but I certainly want to be alerted and possibly approve, if there is a major change in node's content.
So the requirements are:

detect negative change + restrict user to publish changes + alert admin for approval

Solutions?:
1) Count words in node and compare it to word count in node's revision. The word count may be saved inside a field in node and after compared by rules.

2) As suggested by @T-34, use custom module
I found some modules but none of them gives the ability to figure out the difference percentage and use it with rules:
https://drupal.org/project/diff
https://drupal.org/project/rules_diff
https://drupal.org/project/trevi - suggested by @T-34 gives me an error + it seem s to work only on node edit page.
Thank you for ideas.


texts: How do I include a JS file that conditionally overrides a JS library in D8?

texts:
We use the jQuery Validation plugin as a library we declare in our mymodule.libraries.yml.

However, our site is multilingual, and this plugin provides localized strings in separate language-specific JS files (messages.langcode.min.js) that need to be evaluated after the main library is included.

If I include the language specific file in an #attached element in mymodule_preprocess_page(), would that cause it to be evaluated after the main library? If not, how should this be done?


texts: Why does using '#type' => 'text_format' change the position of the field's description?

texts:
I have a form with a text field which looks like this:

$form['myTextField'] = array(
    '#title' => 'Write here',
    '#type' => 'text_format',
    '#format' => 'filtered_html',
    '#description' => "Description goes here")
);

Now I would like the description to appear bewteen the title and the field, so I tried the technique described here. It works for all the other fields, but not for this one. I can make it work by changing the above code to this:

$form['myTextField'] = array(
    '#title' => 'Write here',
    '#type' => 'textarea',
    '#description' => "Description goes here")
);

The downside of this approach is that I end up with a plain old textarea instead of a text_format, which is what I need.

Any ideas as to why the description appears below the field rather than above it when I use '#type' => 'text_format' as opposed to '#type' => 'textarea'?


texts:
I'm creating a system on D7 that tracks how much progress users have made watching various videos on the site. I've set up the jQuery that stores the percentage progress in an array with a modified version of the process at https://www.urbaninsight.com/2014/10/06/tracking-progress-embedded-vimeo-videos. Where I'm lost is where I actually post the data using:

$.post('/callback', {
   progress: myProgressVariable
});

I realized that '/callback' is just a placeholder, but I don't know what to sub in there. Should I designate a callback() function in a custom module that does something with the progress data and just place the function name into the javascript -- and what might that look like? Or do I need to do something something else entirely?


texts: Migrating Users from Older Versions of Drupal

texts:
I'm part of a team that's going to be migrating several older Drupal sites (Drupal 5, Drupal 6) into a new, single Drupal 7 site.  I'm familiar with Drupal from a software architecture point of view, but not as familiar with the day to day running of a Drupal site as I'd like.  Because of this I have a few general questions about this migration.

Are Drupal's password hashing mechanisms consistent across different versions?

If not, are there tools to support migrating user accounts and converting the passwords between versions?

If a no to migrations, are there modules that provide a standard experience for this situation that allows an old user to pick a new password?


texts: WYSIWYG CKEditor is altering source text on reload. Why?

texts:
I created a paragraph with a text field that uses CKEditor text editor with Full HTML enabled. I switched to the Source view and pasted the following code into CKEditor.

<!doctype html><html lang="en">
<head>
    <meta charset="utf-8"><title>The HTML5 Herald</title>
    <meta name="description" content="TheHTML5Herald">
    <meta name="author" content="SitePoint">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head><body>
    <script  src="https://code.jquery.com/jquery-2.2.4.min.js"  integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="  crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
</body></html>

Very simple, I was just testing to see if it accepted script and link tags out of the box. After I saved the page and went back to edit it, the source view only showed:

<meta charset="utf-8">
<title></title>
<meta name="description" content="TheHTML5Herald"><meta name="author" content="SitePoint">
<link href="https: //stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" /><script  src="https: //code.jquery.com/jquery-2.2.4.min.js"  integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="  crossorigin="anonymous"></script><script src="https: //stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>

Note that it removed the doctype, html and body tags. What's weird is that in the database, the value for this field in this node is still exactly what I pasted in (with all the tags). Is there a hook or filter that is altering this before it is rendered? How can I prevent this to make sure it always displays what I previously pasted in?

I'm using Drupal 8 and the CKEditor version is 4.7.2 according to the JavaScript console.


texts:
I would like to rewrite the original function code for the Private messages block module. The original code displays a text message for no messages or messages in the inbox. I would like to change it to an image but am no where near on the right track.  Here is the coded that I am trying to change

 /**
 * Theme a block which displays the number of new messages a user has.
 */
function theme_privatemsg_new_block($count) {
  $count = $count['count'];
  if ($count == 0) {
    $text = t('0 Messages');
  }
  else {
    $text = format_plural($count, 'You have a new message!',
                        'You have @count new messages!');
  }

  return l($text, 'messages', array('attributes' => array('id' => 'privatemsg-new-link')));
}

I was trying the following replacement:

/**
 * Theme a block which displays the number of new messages a user has.
 */
function theme_privatemsg_new_block($count) {
  $count = $count['count'];
  if ($count == 0) {
    /*$text = t('0 Messages');*/
    $text = l(');
  }
  else {
    /*$text = format_plural($count, 'You have a new message!',
                        'You have @count new messages!');*/
    $text = l('');
  }

  return l($text, 'messages', array('attributes' => array('id' => 'privatemsg-new-link')));
}

I suspect there are issues with the fact that it is designated as a text string instead of code that should be rendered.  What do you think?

Using PHP I am trying:

/**
 * Theme a block which displays the number of new messages a user has.
 */
function theme_privatemsg_new_block($count) {
  $count = $count['count'];
  if ($count == 0) {
    /*$text = t('0 Messages');*/
    $theme_path = drupal_get_path('theme', 'eternal'));
    $text = '';
  }
  else {
    /*$text = format_plural($count, 'You have a new message!',
                        'You have @count new messages!');*/
    $theme_path = drupal_get_path('theme', 'eternal'));
    $text = '';
  }

  return l($text, 'messages', array('attributes' => array('id' => 'privatemsg-new-link'), 'html' => TRUE));
}


texts: How do i create an item list where the item has a mixture of links and text

texts:
If I add the following to my controller, the first item in the list displays correctly, but once I concatinate in text, the links are all escaped.

 $basic_items[] = \Drupal::l('Basic example',Url::fromRoute('flot_examples.basic_usage'));
$basic_items[] = \Drupal::l('Different graph types', Url::fromRoute('flot_examples.series_types')) .
" and " .
\Drupal::l('simple categories/textual data', Url::fromRoute('flot_examples.categories'));

$output['basic'] = [
  '#title' => 'Basic Usage',
  '#theme' => 'item_list',
  '#items' => $basic_items,
];

I know the l() function in deprecated, and I should be using:

$basic_items[] = ['#type' => 'link', '#title' => 'Basic Example', '#url' => Url::fromRoute('flot_examples.basic_usage')];

instead, but I can't figure out how to get that to work either.


texts:
I've got a problem with hook_views_query_alter().
I want to override the view's query with a rather complex one. In the first step, I placed the hook in my views.inc and tested it. The hook is called. But none of my tests to alter the query worked.

function glass_lagermanagement_views_query_alter(&$view, &$query) {
  if ($view->name == 'lagerbestand') {
    $query = db_select('materials');
    $query->condition('materials.ID', 1, '==');
  }
}

To test the function, I want to show only one entry which has got the ID "1", but nothing happens at all in the view. What am I doing wrong?

I'm using Drupal 7 here. It is an old project I need to update.


texts:
I have a multilingual setup, and the content translation works well and smooth.

But when I try to edit a node on the other language - I have the same link from the content admin menu, which renders the default language form. I.e. I have /node/21/edit both for En and De versions.

For the test I've try to alter the node object on the form build step (couldn't found a correct hook, so just try it in the FormController::getContentResult() ) - no luck:

$translated = $form_object->getEntity()->getTranslation('de');
$form_object->setEntity($translated);

form object states the active language as 'de', but the rendered form still has en version fields.

Also the form has native language switcher (Languages), which in my mind should do language switching, but for me it shows only English and does nothing.


texts: Replace the drop-down in Views with an image map

texts:
I am looking for a way to replace one of the exposed filters used in the Views module with an Image Map (e.g. a map of the country).

Is there a way for doing this?


texts:
I installed the Migrate module, but I can't use it, nor can I find any useful documentation that explains how to use it. The page on /admin/content/migrate is empty.

How can I use this module?


texts: Embed rate number up down widget in panel node

texts:
I am using rate module and the number up down widget, and in the settings for this module I had set it to appear at the top of content. It was appearing fine. However, now I am using a panel for this node and the widget no longer appears as expected. I need to embed it into my panel. How would I go about this? I have done a few searchs and found rate_embed, but I am not having any luck getting this to work. I have tried the following. My rate widget is called 'points', and its settings are at /admin/structure/rate/:

function:

<?php rate_embed(&$node, $machine_name, $mode = RATE_FULL); ?>

What I tried:

<?php print rate_embed($node, 'points', $mode = RATE_FULL); ?>
<?php echo rate_embed($node, 'points', $mode = RATE_FULL); ?>

this was giving an error that rate_embed was acting on a non-object.


texts:
i would to theme a specific webform page and i achieve this with devel themer help but i find it not logical.
Usually i use ID to specify a template for a page, node or other element.
Then in my case i use the node-419.tpl for my node 419.normal
For my page it's a bit more complicated because this the hierarchical applied template :

page-infos-profil-élève.tpl.php < page-webform.tpl.php < page-node-419.tpl.php < page-node.tpl.php < page.tpl.php

so why a template called page-webform-419.tpl.php doesn't work instead of page-infos-profil-élève.tpl.php ?
Could i do this with php in my template.php file ? if yes how ?

thanks


texts:
I've defined a block that returns a string of HTML as follows:

function product_block_view($delta = '')
{
  switch ($delta) {
    case 'groups_images':
      $block['subject'] = t('Category Images in Groups');
      $block['content'] = "
Group images html
";
      break;

    case 'singles_images':
      $block['subject'] = t('Category Images as Singles');
      $block['content'] = "
Single images html
";
      break;

    default:
      break;
  }

  return $block;
}

This block lives in a custom region named 'myregion'.  I am attempting to render this block's view with <?php render($page['myregion']) ?> but nothing comes through. The dump of $page['myregion'] looks something like this:

    array (size=4)
        'product_groups_images' =>
            array (size=5)
              '#markup' => string '
Groups images html
' (length=29)
              '#contextual_links' =>
                array (size=1)
                  'block' =>
                    array (size=2)
                      0 => string 'admin/structure/block/manage' (length=28)
                      1 =>
                        array (size=2)
                          ...
              '#block' =>
                object(stdClass)[116]
                  public 'bid' => string '77' (length=2)
                  public 'module' => string 'product' (length=7)
                  public 'delta' => string 'groups_images' (length=13)
                  public 'theme' => string 'id' (length=2)
                  public 'status' => string '1' (length=1)
                  public 'weight' => string '0' (length=1)
                  public 'region' => string 'findyourflavor' (length=14)
                  public 'custom' => string '0' (length=1)
                  public 'visibility' => string '1' (length=1)
                  public 'pages' => string '<front>' (length=7)
                  public 'title' => string '' (length=0)
                  public 'cache' => string '1' (length=1)
                  public 'subject' => string 'Category Images in Groups' (length=25)
              '#weight' => int 1
              '#theme_wrappers' =>
                array (size=1)
                  0 => string 'block' (length=5)
        '#sorted' => boolean true
        '#theme_wrappers' =>
            array (size=1)
              0 => string 'region' (length=6)
        '#region' => string 'findyourflavor' (length=14)

Any idea what I'm doing wrong that is causing my div to not be rendered by the render function?


texts: What are Entity tags (Etags) and how do you configure them in relation to your Drupal site's files?

texts:
The GTmetrix Page speed & optimization test notified me that 13 components in my site (all are files) have "misconfigured Etags", so I ran a search query like " Drupal Entity tags " in Google and found almost nothing that was instructive for me (for my knowledge and understanding) on how to solve it via the Drupal UI. Therefore my question is first of all what are these Etags (or Entity tags) and how can I add them (or just configure them right, if they exist), For the relevant files?
Much thanks,


texts:
Adding in the child theme a CSS file with the same name as the parent theme CSS file overrides the parent file. It doesn't seem to work JavaScript files.

How can I override a JavaScript file loaded from the parent theme?


texts:
php 5.5.x, mysql 5.5, drush 5.x, drupal 7.33,

backed up drupal: 'drush ard default --destination=/manual_backup/backup_site_2014_11_15.tar'
switched to new 14.04 Ubuntu server, installed drush, import tar file:

drush arr ./backup_site_2014_11_15.tar --destination=/var/www
edited /etc/hosts:

127.0.0.1 mysite.local

edited /etc/apache2/sites-available/default.conf

    ServerName  mysite.local
    Root            /var/www

        AllowOverride …

Restarted apache

While 'drush cc all' I got the message:

    PHP Fatal error: Call to undefined function node_load() in /data/www/fdb/includes/menu.inc on line 593 <<

    Drush command terminated abnormally due to an unrecoverable error <<

    Error: Call to undefined  function node_load() in /data/www/fdb/includes/menu.inc on line 593 <<

Then I did 'drush dl registry_rebuild' and 'drush rr'.

Unfortunately I couldn't login. So I created a one time login which works.

I see all nodes, users, views, rules etc.

But after logging out I cannot login regularly.

Then I created a new password for user admin_ip via '/scripts/.create-new-pwd newpwd' and put the hash into the users database.

Finally I tried to login again but it didn't work.

How would you start to see what's wrong?


texts:
Hello i am having problems showing nodes created between '8 days ago and 38 days ago' in my Views filters.

filter Node: Post date: is between
 An offset from the current time such as "+1 day" or "-2 hours -30 minutes"
Min: -8 days
Max: +38 days

Im not getting the required behaviour. if i trim it down to

Min: -3 days
Max +5 days

it seems to be filtering. With my original -8 and + 38 though its showing all the nodes. Am i doing something wrong?

Thanks


texts: How can I remove allowed values of a list field?

texts:
I set up a List (Text) select list field in a paragraph bundle. I set some values to test. I want to remove them (so I can populate them programmatically) and I deleted the content using the fields, but I still get this message.

  Allowed values list: some values are being removed while currently in use

These values are not used. I did use them to test, but I deleted them after testing.

How can I remove those values?


texts:
I'm trying to make page with nodes filtered by author name. My context filter is comming from url.

My path looks like domain.xx/drupal/authors/johny

If i set validation by user ID, and send user ID in path, all works properly.

You can see contextual filter setup in attachment.


texts: ahah_helper or ctools for ahah in Drupal 6?

texts:
The excellent ahah_helper module (http://drupal.org/project/ahah_helper) improves the core ahah functionality to the point where it works quite nicely.

Ctools (http://drupal.org/project/ctools), seems to bypass the core functionality totally, offering its own brand solution.

Ctools seems to be quite a bit more complicated, needing more complexity to deal with no-js situations : http://drupal.org/node/1025448#comment-4196882

Where as ahah_helper seems much cleaner/simpler to deal with : http://drupalcode.org/project/ahah_helper.git/blob/refs/heads/6.x-2.x:/ahah_helper_demo.module

So.

Which is better?
Which is more like the implementation in 7 (so we only learn once)?


texts: Inline images of body is not getting migrated

texts:
I am migrating a drupal6 site to drupal7. I am using migration and migrationd2d_ui module for this. Everything is working fine except wysiwyg inline images in body. path is getting migrated for wysiwyg images . But in content [[wysiwyg_imageupload:15:]] is appearing. In drupal 6 wysiwyg with tinymce editor is running. I am using same wysiwyg with tinymce editor in drupal 7. In drupal6 wysiwyg_imageupload module was used for inilne images in body.

How can i migrate these images in drupal 7 ?


texts:
Having some trouble with the Drupal 6 query syntax. My query works fine on its own:

SELECT term_node.tid, term_data.name FROM term_node, term_data WHERE nid = 22640

Below is what I have when I convert it for use with drupal 6:

$currentTIDs = db_query("SELECT {term_node}.tid, {term_data}.name FROM {term_node}, {term_data} WHERE nid = 22640");

while ($cTids = db_fetch_object ($currentTIDs)) {
array_push($currentTIDsArray, $cTids);
}

drupal_set_message('<pre>' . print_r($currentTIDsArray, TRUE) . '</pre>');

This results in an empty query / array? Any Ideas?


texts: How do I consume JSON data via a hook_menu callback?

texts:
I'm trying to set up Tropo's WebAPI with a Drupal site, and I thought I'd just create a hook_menu() callback for example.com/tropo, then use the hook_menu callback I just created to consume the API call from Tropo (which contains a simple JSON array of data), then respond.

I can do the response part pretty easily... build the data, drupal_json_output() and exit (that just returns the JSON basically).

The part I'm having trouble with is getting the data that is sent to the /tropo menu callback... I can't access any data by using either of the following:

$json = file_get_contents("php://input"); // returns NULL

(below uses the inputstream module:)

$json = file_get_contents("drupal://input"); // also returns NULL

I checked what some other modules do, and it looks like they use hook_init to grab the JSON. Is this the preferred method? I'd love to be able to do it in hook_menu and use my own path and such...

Alternatively, would I be better off writing my own PHP script and running outside of Drupal, just doing a bootstrap for the database if I need to?


texts:
I have Domain Access instaled, but not very sure if that is the problem: I have several domains under the same installation. It all works perfectly, but when I try to enter www.example.com/?q=user, it only works for some of the domains, for others it redirects to the home, and this causes other problems.

I have revised .htaccess (even installed a fresh copy), I have seen in the database, and cannot trace the problem, which is completely consistent. When using the same config in localhost (home PC), the problem is not found, so there is some incompatibility that came accros the project.

Any suggestion? I have Clean URLs switched on, but because it depends on any domain config, I cannot be sure because don't know where it stores the data, apparently it does work perfectly (don't understand ? in a content node, for example).


texts:
i keep getting the following message on my exposed filters. Any ideas as to what i might have missed out when configuring the filters. I used the cck list (text) widget to compile options in each select list.

ps- i did not select the required option on the views filter options. For each filter i selected the expose filter option, the "is one of" option and the options i want to appear in the filters. I also have the Better formats module selected.


texts:
I have found many articles about showing sections of the user profile edit page based on $user->roles but none that deal with other custom fields.

For example,

global $user;
if (in_array('administrator', $user->roles)) {

}
else {
  drupal_add_css(drupal_get_path('theme', 'my_theme') . '/css/normal-user.css');
  //Disable admin-only fields
  $fields = array('field_employee_types');
  foreach ($fields as $field) {
    $form[$field]['#disabled'] = TRUE;
  }
}

BUT what I am needing to do is check a custom user profile field (which happens to be a taxonomy term array) and if the user has a certain term,  then do something such as show fields.  Can someone lead me in the right direction?  I am doing all of this in a custom module to alter profile form.

thanks!

So I somewhat got the info to print on the user profile page

[field_affiliation] => Array
    (
        [und] => Array
            (
                [0] => Array
                    (
                        [tid] => 28
                        [taxonomy_term] => stdClass Object
                            (
                                ...
                            )
                    )
            )
    )


texts:
Now, I'm trying to translate my content pages into Burmese language. But, the problem is there is no language option appear in "Publishing Options" Tab. I enabled Content translation, Locale and Multilingual Internationalization, Variable modules. Although I enabled all these modules and clear the cache, it still doesn't appear.
Please, help me!


texts: Collapsible fieldsets in form using button

texts:
How can I make a button collapse a fieldset in my custom form? I tried the following which did not seem to work:

$form['stepone']['next'] = array(
    '#type' => 'button',
    '#value' => t('Next'),
    '#name' => 'nextone',
    '#weight' => 1,
    '#submit' => array('collapse_next'),
    );

The function is:

function collapse_next($form, &$form_state){
    if(isset($form_state['values']['nextone'])){
    $form['stepone']['#collapsed'] = TRUE;
    $form['steptwo']['image']['#collapsed'] = FALSE;
    return $form;
    }
}