texts: Can't set a default theme in a FunctionalJavascript test with $defaultTheme class property

texts:
Trying multiple ways here to set a default theme to use in FunctionalJavascript tests and it is not working (I am watching them execute in VNC viewer). Bartik always shows.

I also tried setting $defaultTheme to stark, it does not appear either. It is always Bartik. According to the class and docs, this is supported in Drupal 8.8.2.

How can I make my theme default and load? This is the class my FunctionalJavascript class tests extend:

abstract class WebDriverTestBase extends CoreWebDriverTestBase {

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'MYTHEME';

  protected $profile = 'standard';

  /**
   * {@inheritdoc}
   */
  protected $strictConfigSchema = FALSE;

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this->container->get('module_installer')->uninstall(['page_cache']);
    $this->container->get('theme_installer')->install(['MYTHEME'], TRUE);
    $this->container->get('config.factory')->getEditable('system.theme')->set('default', 'MYTHEME')->save();
  }

Edit: command being run:

docker-compose exec --user=$DOCKER_COMPOSE_USER php phpunit --testsuite unit,kernel,functional,functional-javascript

My phpunit.xml.dist file has limited those suites to my modules/custom folder.

Edit 2:

I have now done the following:

drush si --sites-subdir=testing.docker.localhost
drush then MYTHEME
drush cedit system.theme (set MYTHEME default)
drush pm-uninstall page_cache
drush en mymodule_user_auth
drush cr
phpunit ....

I had to set the block too (one test looks for the presence of a block). Now the tests pass. But why is the setUp() method not doing the above even though its being told to do so? Regular Functional tests adhere to this, why not FunctionalJavascript ones?


texts: Recently front page to Drupal 6 site not found

texts:
For the past month or so, I have been experiencing intermittent problems with the front page of my Drupal site not being found. I have noticed that this has been asked before but none of the suggestions is working for me. As far as I know, the hosting provider hasn't changed anything and neither have I (other than applying module updates as needed). When I log in, the front page display fine and seems to work for awhile for both logged in and anonymous users. Then it will disappear again some time later. Any ideas as to what I should be looking at to fix this? I would suspect perhaps it might be a recent module update but I would figure more people might be experiencing this problem. When the page doesn't display, I see a 406 error in the drupal log.

Thanks.


texts: How to change fields permission using some action in the Rules module?

texts:
I installed the Field Permissions module to grant access of the individual fields to the roles.

I need to change the permission of some fields when an event occurs. How do I can add the field edit permission to the Action component of the Rules module?


texts: Can I use Drupal plugin in managing news?

texts: Can I use the plugin of Drupal twitter feed on managing news? Is there a twitter feed for Managing News? Sorry for this dumb question, as I was new on this content management system.


texts: Sending Auto-filled Email from Content Type Profiles

texts:
I have 'resource' content types. There are hundreds. I want each profile to contain an individualized link to a 'feedback form', or some mechanism to report an error with the profile, by email...to our staff. These items are coming from the DB, obviously. So something like the following:

Resource Name
Type
Description
[LINK to submit problem about this profile]
more details here

When the user clicks the link (in my imagination) they would either be able to send an email to someone on our staff with details auto-filled about the resource they are complaining about, OR, it takes them to a feedback form of some type with details auto-filled about the resource they are complaining about. Either way it auto-fills form fields and allows the sending of email.

Anyone know of a good module or technique for handling this?


texts: How do I add a CSS class to a p tag in CKEditor?

texts:
The standard center button only applies a in-line style to the HTML.
But how can I add a class 'text-center' to a paragraph or selection by clicking the following icon? I went ahead and created a custom button on CkEditor.

(function($) {
CKEDITOR.plugins.add( 'center', {
    icons: 'center',
    init: function( editor ) {
        editor.addCommand( 'center', genCommand());
        editor.ui.addButton( 'center', {
            label: 'Align text on center',
            command: 'center',
            toolbar: 'center'

        });
        if ( editor.contextMenu ) {
            editor.addMenuGroup( 'centerGroup' );
            editor.addMenuItem( 'centerItem', {
                label: 'Change link',
                icon: this.path + 'icons/center.png',
                command: 'center',
                group: 'centerGroup'
            });
            editor.contextMenu.addListener( function( element ) {
                if ( element.getAscendant( 'center', true ) ) {
                    return { abbrItem: CKEDITOR.TRISTATE_OFF };
                }
            });
        }
        CKEDITOR.dialog.add( 'centerDialog', this.path + 'dialogs/center.js' );
    }
});
function genCommand( name ) {
    return {
            exec: function( editor ) {
                editor.insertHtml('
' + editor.getSelection().getNative() + '
');
            },
    };
}
})(jQuery);

What it is doing is nothing. In the case there is a selection, it deletes the selection and markup.

What I need:

If there is a line saying "text", I need
text

In the case there is a selection, make 1 out of the selection


texts: Moving from Custom MySQL-Based Blog to Drupal

texts:
I currently have a database with the following schema:

Table: Articles Columns: ID, Title, Author, Content

Table: Authors Columns: ID, AuthorName, EmailAddress

Table: Categories Columns: ID, CategoryName

I'm interested in moving this over to Drupal. I do NOT actually need to preserve the authors or categories tables because we are revamping those sections in the migration. However I DO need to save certain rows (or all, if easier) of the articles table. This includes keeping the author ID linked to it. I'm willing to do manual queries in order to select which rows I want to move over to the new table, but I'm not sure exactly where I should do this. So my question is: How can I move these articles over to Drupal in the easiest, most seamless fashion?


texts:
I know it is fairly easy to create a table form with one column of checkboxes using table_select. But I would like to have two columns, preferably on the right of the text (as opposed to checkboxes in the left margin with table_select).

I looked at the code of the permissions table in core, but that one seems closely integrated with theming and I would like to avoid messing with that.

What would be the best way to achieve this? I'm using Drupal 7.


texts:
"Powered by Drupal" is a footer block I need to change to my name for my website.

How do I edit its default title?


texts: I am making a custom block in Drupal 8 and I want to show my entity list builder in it.Is there any example or certain way by which I can show my entity list in the block.


texts: "Censor" View results/ CCK fields (Censor based on a role)

texts:
Drupal 6 Nodes + CCK allow the creation of custom fields on nodes and per Role based Permissions to view / edit / delete on a per Field basis. Whilst I don't want to simply "switch off" fields (disable the Permission to View a field based on a Role), I want the field to display "********", or "withheld".

So essentially I want to add additional permissions to the View CCK field, called "View Censored", which doesn't allow them to see the content, but know at least the content exists. In addition, it means that I don't have to have duplicate Views (one with full details, one with some sort of templated *** instead of fields) and the linked Nodes will display, but with censored fields automatically.


texts: Load a view block into a custom page generated in a module

texts:
Is it possible to programatically insert an existing view into a block generated by a custom module and pass it a parameter?

I am generating a block based on some external api data. I have been asked to add a view that pulls in related content from the website. To do this I would like pass a view to my block and pass it a parameter I extract from the api data.

Can this be done, and if so... how?


texts:
I added an external CSS to my theme. When I look at the  source code the external file is not being rendered.

In my html.tpl.php file I have:

<?php print $styles; ?>

In my template.php. file I have:

function fire_preprocess_html(&$variables) {

  drupal_add_css('https://www.getmyfonts.com/assets/fonts/webfonts.css', array('type' => 'external'));

}

function fire_preprocess_node(&$vars) {

  // Custom CSS for content types
     if (isset($vars['node'])) {
    drupal_add_css(drupal_get_path('theme', 'fire') . '/assets/css/page-' . $vars['node']->type . '.css', array('group' => CSS_THEME));
  }

}

I have this in my .info

stylesheets[all][] = assets/css/style.css
stylesheets[all][] =
sites/all/modules/datatables/dataTables/media/css/jquery.dataTables.css
stylesheets[all][] = assets/css/rwd-table.min.css
stylesheets[print][] = assets/css/print.css

Any ideas on what I am missing?? Thank you


texts: Is there a way to create a batch import of product bundles, or an API function? I have a few hundred combinations of product type 1 & product type 2, with different amounts of each product type, depending on a bunch of factors. I have the Commerce Feeds module enabled, if that helps.


texts:
Which is the best module to do a multilingual site for different countries. This is the exact word from client requirement.

"Site created for ABC country can be quickly adapted for country XYZ"

They are mainly looking for reuse of code.  Like they create a website for one country and they reuse the same code and same DB fro different county but language will be different.


texts: How to get rendered content properties from an entity reference in Twig

texts:
I'm using the Stock Photo Search module, for particular image fields, and it has its own field type with interesting properties.

As far as I can tell, the only way to access the URI of the image is content.field_stock_photo[0]['#uri']. There is no node.field_stock_photo.0.entity.uri.value or similar. The only way to access the URI is through the rendered entity.

The problem I'm running into is when using a reference to another node that has the stock_photo_search field, I have no way to access this rendered entity from a reference.  node.reference.0.entity.field_stock_photo.value doesn't do it, and as far as I can tell node.reference.0.content.field_stock_photo doesn't work.

How do I go about getting properties from a rendered entity of a reference in Twig?


texts: Preprocess title field in all contexts (sitewide)

texts:
If you put a backslash in a title of a node I need to rewrite that title and remove the backslash wrapping the text after in  tags. I'm currently doing this using multiple preprocess functions. It seems that I have to create a new preprocess function for every context that a title might appear in:

function project_preprocess_page(&vars){/*rewrite*/}
function project_preprocess_node(&vars){/*rewrite*/}
function project_preprocess_node(&vars){/*rewrite*/}
function project_preprocess_panels_pane(&$vars){/*rewrite*/}

This is working but it's frustrating (and probably inefficient) as there are so many different contexts where titles are displayed.

It seems like there should be a function where I can just override this once and not worry about it anymore. Can anyone suggest a solution?

Thanks


texts:
I created a Tour with the Tour UI module and I was unable to activate the tour on the homepage.

The homepage of my site is the default view of drupal 8 with the machine name frontpage

How to activate the tour on the homepage ?


texts: View list of teasers wrapped in  instead of

texts: How can I view my teasers in <li> instead of in the default <div>? I find that changing the <div> to <li> in node.tpl.php doesn't work since <li> needs to be wrapped in a <ul> tag.


texts:
My admin menu keeps randomly showing up at the bottom of the page. Any ideas why?

EDIT: I've continued to pay attention to the behavior.. and it appears to only happen when there is a "message" displayed at the top (in the green box).


texts:
Why don't menu tabs show for a view generated page?
Viewing my site as an administrator I see menu tabs above content pages for view, edit, and Devel (I have the developers module turned on).  When I generate a view page, the menu tabs are not displayed.  I have viewed video tutorials and they are present on a view page.  The view is working and generating the correct page. Is there a setting somewhere?

Added Question:
OK hansag answered my initial question below, so let me rephrase the question. The problem is I have created 3 pages in the view each with menu tabs assigned. The paths for each are:

default tab page= materials/%
page 2 = materials/%/general
page 3 = materials/%/scope

There is a contextual filter that takes the % value and finds articles with an attached taxonomy term.  The view page works since the placing a URL such as materials/termname finds the correct articles and displays them.

Why don't the menu tabs show?


texts:
I'm trying to extend my already existing Taxonomy list by a second value per existing one. Let's say I have a Taxonomy list like this:

First Item
Second Item
Third Item

Now i want to store a second value (FI, SI, TI) to receive a list:

First Item | FI
Second Item | SI
Third Item | TI

where I can access either the first or the second value of one taxonomy item. Is that somehow possible?

The only thing I would know to achieve that, is a custom content type.


texts: Display Suite and Views - how to troubleshoot why a View content pane is not being applied?

texts:
I have a site that uses Entity Reference to link exercises with guitar lessons (these are two content types). I created a view (both content pane and block, identically configured), of display type Display Suite, which filters on exercises, uses a relationship with referenced entity, and contextual filter of content node id which corresponds to the lesson node id. In preview all looks fine,a lesson is displayed as well as its associated exercises, and I saved the view.

In Display Suite I managed the display for exercises and lessons and added the view I created to be managed by Display Suite.

So I thought all would be fine on my site, but when a guitar lesson page is loaded, it only displays the lesson fields as managed by Display Suite, but it does not display the exercises associated with the lesson, which I thought would work based on the view.

Now if under Structure->Blocks I attach the block view to Content, then the exercises display with lessons. But I thought Display Suite allows one to not think about blocks and instead use views and content panes to control display. Since the view has a content display type, and since the lesson and exercise content types are configured to display fields in DS-arranged content layouts, why on earth would the content pane view not be displaying?

I am new to drupal and I have no idea how clear I have described this issue, but I can clarify as needed.

Any troubleshooting tips to figure out what is going on?

I also have Page Manager and Panels installed, but I disabled the panels I had created previously and I don't see how Page Manager would be interfering since I don't have it managing any of my pages.

Regards


texts: How to get rid of the default field markup

texts:
I need to customize registration form fields. Drupal generates form fields like this:

 Name
 <input type="text">

but I need to leave just <input> and be able to add some other tags around it.

For example:

Name<input type="text" />

It seems to be a common problem as the default html fields markup don't always what needs to be applied in particular html templates.

What is the best approach to this?


texts:
I'm currently creating a calendar where the events are Group Content. The calendar now shows only the events from the groups of which you are a member - unless the event is public.
I would however like to be able to let everyone see the titles of every event - independantly of the groups - every other field should be hidden.
This is achieved through the OG field permissions - however this doesn't allow the users to create public event anymore because the fields are hidden from every event.

To sum the problem up - I would like to:

Let the users create an event - and determin if it should be private or public
If the event is private - only the title is shown to non-members
If the event is public - everthing is shown to non-members
How am I able to achieve this?


texts: How to set a specific vocabulary in a taxonomy reference field during migration?

texts:
I am doing a D7 > D8 migration (where the D7 site in question itself was migrated from D6 some years back) and most stuff just works fine. But I am stuck on the field (instance) settings for taxonomy reference fields.

When migrating the field instances, I am using a slightly changed version from the one provided by core (that's how I did it with most other stuff, too):

langcode: en
status: true
dependencies: {  }
id: my_fields
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
field_plugin_method: processField
cck_plugin_method: null
migration_tags:
  - 'Drupal 7'
  - Configuration
migration_group: my
label: 'Field configuration'
source:
  plugin: d7_field
  constants:
    status: true
    langcode: und
process:
  entity_type: entity_type
  status: constants/status
  langcode: constants/langcode
  field_name:
    plugin: static_map
    source: field_name
    map:
      taxonomy_vocabulary_1: field_issues
      taxonomy_vocabulary_2: field_tags
    bypass: TRUE
  type:
    plugin: process_field
    source: type
    method: getFieldType
  cardinality: cardinality
  settings:
    plugin: d7_field_settings
destination:
  plugin: 'entity:field_storage_config'
migration_dependencies: null

When I run this via drush mim my_fields all field instances on all content types are created (wonderful!), the only thing missing is the restriction in taxonomy term reference fields regarding a specific vocabulary.

When I create such a field manually and export the configuration, there is a section in the yaml file describing that restriction:

settings:
  handler: 'default:taxonomy_term'
  handler_settings:
    target_bundles:
      issues: issues
    sort:
      field: name
      direction: asc
    auto_create: false
    auto_create_bundle: ''

I guess this needs to be in the process section of the migration configuration, but how do I set it correctly? If I read that right, the vocabulary name (issues) is both field name and value, which would probably pose a problem for multiple vocabularies. Also, how would I set this for taxonomy reference fields only?

Added note: In Drupal 7, the restriction was set within the field global settings (allowed_values[vocabulary], could be found in the DB table field_config) and not with the field instance.

In Drupal 8, it seems to be a field_instance setting as the same field can be restricted to different vocabularies in different content types. May that be the reason, why this setting is not migrated?

By the way: I did try a simple migration first by using the Migrate Drupal module and while it got most configuration right by just using defaults, here also the restrictions on taxonomy reference fields was missing.


texts: How do I output the entire page template?

texts:
I've created a custom module that defines a menu callback; that menu path will call a function which performs some actions and once it's finished, it needs to display the theme with a message as the body.

This used to be doable using theme('page', $message) but in Drupal 7 it only returns the HTML content that would normally appear within the BODY tags.

I know that there is now a html.tpl template, but I'm unsure how I can combine the two to generate a full page.


texts: How do I flag and categorize Drupal Commerce related products?

texts:
Given that there isn't a related products contrib module yet.

What is the canonical means (with priority of maintainability, developer experience) to flag related products and thus have them displayed in views ?

Would it include setting up content types with many different taxonomy vocabulary fields? Another product reference field?


texts:
I have a content type called 'webtv' for adding videos from youtube with media, media_youtube modules. On the webtv page I want to add blocks with video preview image and node title.
My problem is that the video preview image is not linked to the node. I followed the instrunctions of the link but is not working as the field in not output to link
https://www.drupal.org/forum/support/post-installation/2011-12-25/making-preview-images-using-modules-media-and-media-for#comment-5644588
I also tried to use Content:Path and add it later but still not working.
PS. file_entity_link is not working because the field is a multimedia asset
Any ideas?
Using media youtube 7.x-3.9 version


texts:
I want to autopost the contents in facebook.I installed Drupal for Facebook module and created Apps in facebook.

In this,the user can connect facebook.But the content doesn't get autopost.
I got an error like this

"Something went wrong while posting update to your facebook wall. The error has been captured by watchdog".

How to clear this error.


texts:
Long story short:

I have various entity types in my system and some of their subsets (bundles) has the very same fields. So far I have 3 "common fields" sets, which are from EntityRelation perspective the weak entities. A set has from 3 to 9 fields in it.

The following constraints I need:

When changing something in field bundle settings (eg: make it
required) I don't want to sync all of the other occurrence
of this    field.
Field content should be translatable (based on the
    parent)
Field content should be revisionable (based on the
        parent)

So far the following solutions came to my mind:

Field Collection (bad experiences in D7, still in dev)
Separate bundle / entity (ECK maybe) + Inline Entity Form (months ago
there was a problem with revisions)
Paragraphs (translation + revisioning good, but I couldn't make it to
appear in forms just like Inline Entity Form (it always had the "+
Add new paragraph" and if it was a new content, the form of the
paragraph didn't appear, only after clicking the add button)
Custom entity, which includes these fields as base fields. (a lot of hassle to generate the forms, listers, revision support.. etc.)

Do you have any advice for me to solve this issue?


texts: How to translate taxonomy terms displayed via an exposed filter in views?

texts:
I'm using the Views, i18nviews, and Entity Translation modules.  All of my terms have already been translated using Entity Translation.  In views displays, the translated terms appear in the correct language except in exposed filters.  In exposed filters, the terms always appear in the default language for the site.

A search of the issue queues reveals a thread of monstrous length here.  So, while support for this is still a work in progress, is there any way (quick and dirty hacks are ok) to get this working today?


texts: db_query() PDOException (no parameters were bound)

texts:
I have a relatively simple query that is executed via db_query()->execute;
For some reason this causes a PDO Error, which I assume has to do with the way drupal handles the input. Any ideas on what causes this error and how to avoid it?

db_query('
    INSERT INTO {account_floodprotect} (ipaddress, soapcount, mailcount)
    VALUES (:ipaddress, :soapcount, :mailcount)
    ON DUPLICATE KEY UPDATE
    soapcount = soapcount + :soapcount,
    mailcount = mailcount + :mailcount',
  array(
    ':ipaddress' => $ip,
    ':soapcount' => $soapcount,
    ':mailcount' => $mailcount,
  ))->execute();

/*

ERROR CAUSED:

PDOException: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound

The table involved:

+------------+------------------+------+-----+---------+----------------+
| Field      | Type             | Null | Key | Default | Extra          |
+------------+------------------+------+-----+---------+----------------+
| id         | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| ipaddress  | varchar(255)     | NO   | UNI |         |                |
| soapcount  | int(10) unsigned | YES  |     | 0       |                |
| mailcount  | int(10) unsigned | YES  |     | 0       |                |
| updatetime | timestamp        | YES  |     | NULL    |                |
+------------+------------------+------+-----+---------+----------------+


texts: Disable file name change when downloading private files

texts:
I'm using drupal 6. When user is downloading file from my website name of the file is changed to "download" on chrome (in firefox it is just random string) and only when file is image or pdf file extension is provided (for example word and excel files are without extensions). Is it possible to "keep" file name and extension as it was saved on server?

For file management i'm using IMCE module (imce-6.x-2.6).


texts:
I was building an exchange with a partners XML service, and I couldn't get the XML right, but as with all things Drupal, the xmlrpc error and action logging is less than robust.

So I did this in includes/xmlrpc.inc.

function xmlrpc_request($method, $args) {
  $xmlrpc_request = new stdClass();
  $xmlrpc_request->method = $method;
  $xmlrpc_request->args = $args;
  $xmlrpc_request->xml = <<<EOD
<?xml version="1.0"?>
<methodCall>
<methodName>{$xmlrpc_request->method}</methodName>
<params>
EOD;
  foreach ($xmlrpc_request->args as $arg) {
    $xmlrpc_request->xml .= '<param><value>';
    $v = xmlrpc_value($arg);
    $xmlrpc_request->xml .= xmlrpc_value_get_xml($v);
    $xmlrpc_request->xml .= "</value></param>\n";
  }
  $xmlrpc_request->xml .= '</params></methodCall>';

  /* This part here */
  watchdog('xmlrpc',$xmlrpc_request->xml);
  /* End ridiculously tiny hack */

  return $xmlrpc_request;
}

I got the data I needed and in 10 minutes had the partner interface responding appropriately to my request because (shocking I know) logs are good.

I like the extra logging, and I want to keep it. What is the clean, straightforward, and most importantly, Drupal-approved way of doing that?


texts: Drupal 7 Megamenu Construction Using Views in Menu and a menu module?

texts:
Currently I need to construct a responsive Megamenu and so far I have narrowed down that I need menu_views (https://www.drupal.org/project/menu_views) to output the megamenu items as each dropdown will contain a bunch of recent nodes relating to the sub menu items.

I've been using responsive_menu for my menu, but apparently its not compatible with menu_views as it doesnt output the views in the menu.

It's either I code this responsive menu from scratch, but I rather not if there is a solution for this already that can get me more than 50% of the way there.

Now my question is,  what menu modules would make it compatible with "menu_views"? Or maybe another solution all together. I know about tb_megamenu, but that module seems to have alot of bloat with bootstrap built right into it.


texts: Requiring a package doesn't find a dependency

texts:
When running HOME=/home/gymsagec composer require "drupal/commerce 8.2.x-dev", I get this error message:

  drupal/commerce 8.2.x-dev requires commerceguys/intl dev-master -> no matching package found

I can install the intl package by itself using composer but even after doing that, running the first script fails. Why?


texts: Drush can't connect to MySQL through socket

texts:
When trying to install a new drupal with

drush si standard --db-url=mysql://root@localhost/drushtest

I get the following error Message:

  [...] SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket [...]

MySQL User is root with no password and the database drushtest was already created. I'm using Ubuntu with Xampp and guessing that the incorrect mysql.sock is used.

ps -ax|grep mysql

says that my mysql.sock lies within

/opt/lampp/var/mysql

Has somebody a clue how to solve this error?

Thanks in advance


texts: I have a content type that includes a date field called expires.  I'd like to set up some way to monitor all nodes of this content type and if the current date is close to the expires field value, send an email.  I checked the rules module using the built in scheduler, but I didn't see a way to check a specific node, or a series of nodes.


texts:
<div class="meta">
  <?php
    echo  $submitted;
    $common = $content['body']['#object']->field_fenlei['zh-hans'];
    foreach($common as $vocab){
      echo  l($vocab['taxonomy_term']->name,$vocab['taxonomy_term']->uri['path']);
    }
  ?>
</div>

This code is the one I wrote for node.tpl.php, and it's too bad. Is there a way to put the code into the template.php file? How do I do?


texts: How to print paragraph image title/alt in custom twig template?

texts:
How to display the alt and title text in drupal twig template? I already enable the alt and title field, but don't know how to print the field.

Here is the code in custom twig template. I want to display it in the image tag.

                {% for row in data.dynamic %}

                {% endfor %}


texts: Alter field instance settings form on admin/structure/types/manage//fields/node../storage

texts:
I'm trying to figure out how to add an extra field to content type field settings page.

Basically I want to alter field instance settings form on admin/structure/types/manage//fields/node../storage .

I'm going with hook_form_FORM_ID_alter for FORM_ID field_config_edit_form.
The new form element appears on the form but after submit I'm not able to see the value.

Am I missing something? Is an extra form submit function required other than the default one to submit my new value?

Here is my snippet -

/**
 * Implements hook_form_FORM_ID_alter().
 */
function mymod_form_field_storage_config_edit_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {

  $form['enabled'] = array(
      '#type' => 'checkbox',
      '#title' => t('Enable'),
      '#description' => t('If enabled then this module will alter the field settings.'),
      '#default_value' => $form['enabled'],
  );
}


texts: How to override Drupal.ajax.prototype.beforeSend?

texts:
I need to add my own little if's and checks in 3 functions inside

misc/ajax.js (
  Drupal.ajax.prototype.beforeSend,
  Drupal.ajax.prototype.success,
  Drupal.ajax.prototype.error
)

How can I override them in my module? I can't find a manual and it's not in Examples for Developers. Sorry if it seems a dumb question, but I'm a php developer - I can work with js, but I'm not so fluent with it.

Can I simply write it in my module's js file?
If 2 or 3 modules needs to modify them, how to avoid conflicts?


texts:
I'm trying to use Panels and Page Manager in Drupal 8. My current versions of each are:

Page Manager: 8.x-1.0-alpha23+12-dev
Panels: 8.x-3.0-beta4+41-dev

My current problem is having no idea how to actually make a layout (layout_plugin is installed.) I'm seeing this screen:

It doesn't matter what I change "Layout" to, the "Layout Settings" section doesn't change. I'm somewhat familiar with Page Manager in D7, and expected there to be some sort of layout manager in there, allowing me to choose panels/blocks/etc. I know there's a "Block Page"--and this would work for me--but in any of the tutorials, I've heard something about Block Page NOT being for production?

Nearly EVERY video/tutorial I've seen uses some other version of panels/page_manager, and the look/structure has changed. So, I'm not sure if I'm doing this right or not, if it's broke, or if I just have no idea what I'm doing.

Panels, Page Manager and CTools was supposedly synced with their alphas last year, but they look like they've separated and I'm hesitant to use 5 month old versions of modules on a new release like D8 (particulary, CTools.)


texts: How can I check for differences - Local vs Live

texts:
I have a fairly large D8 instance with a ton of content and our deployment process does not include automated testing at all. This means that for all of our changes, we literally go through all pages and compare side by side local vs live to see 1) that our change is working and 2) that there are no unintended side effects of said changes (mostly for design/front-end). I was curious to know if there was an easy way to have live vs local compared auto-magically? I think that side by side comparison for super small changes is a bit inefficient.

Just as a side note: I just started at this job 2 days ago so side-by-side comparison is the only way that I would be able to actually check differences until I get a solid understanding of the site. We are a 3 man dev team for a large multi-millionaire institution so bandwidth is tight and it looks like whatever the solution is, it'll have to be a 1 man project for now.

Any and all assistance is greatly appreciated! Thanks in advance!


texts: How to reduce the delay in sending email notifications about new content?

texts:
I've set up a workflow rule to send an email to all users of a role when new content is saved.  I've tested it with three test users and have noticed that the email takes quite a while to actually be delivered.

I thought it was related to cron, so, I changed the setting to Run cron every 1 hour. The emails are eventually delivered, but, not in a timely fashion. It seems like they're delivered according to the cron schedule, but, I'm not sure.

I'd like to have the emails sent as soon as possible when the content is posted. Some of the content can be time sensitive. Is there any way to speed the delivery of the email?


texts: Problem in displaying with Embedded Google Docs Viewer module

texts:
I'm using Embedded Google Docs Viewer module,everything is ok except when viewing it's showing like this:

How can solve this problem?


texts: how to make conditional fields work with MEDIA

texts: I installed conditional fields for drupal 8 and i made a field be invisible or visible depending on the choice of another field which is an entity reference.  but it doesn't work at all. It works for nodes , but not media.  Any idea how to make it work for media?


texts:
I upgraded a site from D6 to D7 and am coming across an interesting error with being able to edit my existing views. My views are all listed, but when I click on the edit button to edit a view the whole configuration section is missing- all the edit page shows is:

  Breadcrumb

  Title of view

  Auto preview
  Preview with contextual filters:
  Separate contextual filter values with a "/". For example, 40/12/10.
  Update Preview

New views do have the configuration area. Any help or ideas on what I might use to search for a solution to someone else that might have had this issue would also be appreciated. I haven't been able to come up with the right search terms to help find the answer. Thanks!


texts:
What open-source license is Drush licensed under?

I've checked GitHub including the README (https://github.com/drush-ops/drush/blob/master/README.md) and it isn't stated anywhere.


texts: I need to put in-place links to edit nodes and blocks in Panels. I see that there are some modules in Drupal 6, like EazyEdit and Block edit, but I didn't find anything for Drupal 7 yet. So appreciate your hints, whether to pick up an existing project on how to do this.


texts: D7 - Multilingual in the admin, only one language for the users

texts:
We have a drupal 7 with the following need :

When the user visit the website, we let drupal chose the best language for the user
He can then choose to chose another language.
We have a finite number of language (5 so far)
Unless he decide to change the language for the whole website, he should only see the content written in the selected language
all user (except admins) on the website are anonymous (no registration, no login)
we need the admins to see all languages.
contents can exist in one or many languages. There is no "reference" language that holds all the contents.

So far we have set the language switcher for all languages, but then on the website the menu for all languages are displayed (which we don't want). Also, search is made on content for all languages. If we set the language switcher to only use the selected language, everything works as intented on the website but then the admin can only see the content matching the current selected language. We need that he sees all content.

We've been looking into some options (including the Administration Language, but unless we overlooked some configuration, it doesn't seem to fit our needs).

Any ideas, hints or suggestion welcome !


texts: jQuery once callback function is not called

texts:
I'm struggling with the once function. The once callback function is not called. I'm trying to use like this:

(function ($, Drupal){
  Drupal.behaviors.my_module = {
    attach: function (context, settings) {
      console.log('this runs');

      $('.my_selector', document).once('special-mark', function() {
        console.log('this never called');
      });

      console.log('this also called');
    }
  }
})(jQuery, Drupal);

In the library file I use the following:

dependencies:
  - core/jquery
  - core/jquery.once
  - core/drupal

There's no a single error in the console. It's just simply not called the callback... How can I make it work?

Drupal: 8.8.4
jQuery: 3.4.1


texts: Auto-upload image feature with image browser module (e.g: Image picker)

texts:
I am using the imagepicker module for browsing the uploaded images, I have tried searching for the auto-upload integration for this module but still no luck.

I am searching for any alternative way if there for similar thing (mainly I require image browser to use the already uploaded images, and implementing the auto-upload functionality on it).

Any suggestion/recommendation would be appreciated.


texts: How to add custom path for taxonomy term page

texts:
I need to give custom path for one of my taxonomy term page which will be redirected to view page.
Example:- I have view page called testimonial and in my taxonomy i have a term called user testimonials which should be redirected to testimonial view page once user click on the term.

I have tried taxonomy menu but its custom path feature is no more available.
Any suggestion, how can i complete this functionality.


texts:
I am using drupal commerce on D7, with the fedex shipping module, and all is well except the packaging algorithm is not advanced enough...

Current Functionality
Currently, you set one default box size in the fedex module config, and it uses that as a base unit of measure to determine how many of those boxes are needed to fit the volume of the order.

The Problem
The current method is kinda close, except now they want to have several box sizes, and the estimates are all over the place, usually way to high for large orders.

Fedex module says...
... you can create custom modules for more advanced calculation rules.

Quote:

  More complex logic involving multiple package sizes, weights, and void space can be implemented via custom modules.

So, how?
I can't find any examples of what this module would look like. I would be happy with just a barebones boilerplate module for this, or a tutorial, or best case someone elses functional module.


texts: Using RNG with a seminar with multiple optional sessions

texts:
I just installed the RNG module and have been playing around with it a bit - but I'm still unsure as to the best way to set it up for my situation.

I help to organize several seminar events a year that run for about three time blocks a day, and each time block has up to 10 different, optional sessions to sign up for.

Each registrant can only register for one session each time block, and each session needs to have a variable maximum number of registrants allowed as they're all held in different rooms of varying sizes.

I think I've sussed out that each session will need it's own event, so that I can define a maximum number. But I'm not sure how to tag certain events/sessions as belonging to a specific time block, and then how to ensure each user can only sign up for one session in each block and that once a session has reached max it will be disabled/greyed out/removed as an option.

Thanks for your time, and thanks for the great module!


texts: change order of shipping services in checkout

texts:
I build two Shipping services in a drupal commerce shop. One with calculated rates. One with 0€ for pickup by the customer.
It looks like this:

But i would like to change the order and make shipping service with costs as default.
I tried to change the wight of the calculation rules, but without effect.
Is it true, that I need a module for this task?
It would be no problem, but I don't won't to overlook a easy solution.


texts: There was an error with the file in gathercontent module of Drupal

texts:
I am importing content from gathercontent platform using the GatherContent module.

All the fields get populated except media type which gives a warning that states :

"There was an error with the file"

Any ideas what might be causing this?


texts: Can a site be put in maintenance mode without a database?

texts:
I'm trying to handle a planned database outage and want Drupal to show the maintenance page during that time.

$conf['maintenance_theme'] = 'exampletheme' and a suitable $conf['_message'] are set in my sites/sitename.com/settings.php
I have a maintenace-page--offline.tpl.php and maintenance-page.tpl.php in sites/all/themes/exampletheme/templates/
I set $conf['maintenance_mode'] = TRUE in sites/sitename.com/settings.php

I hope that Drupal that does not have a database can still bootstrap and display the contents of maintenance-page--offline-tpl.php in this configuration, but in my testing it seems that's not the case. Should this work? Anything I should look into?


texts:
I've a node, which is linked to a sub menu in the main navigation. I would like to get the url and title for the parent menu of the sub menu selected.

I've used it, but it is not working.
I'm trying to use it in hook_node_view()

$node_id = $entity->id();
      $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
      $result = $menu_link_manager->loadLinksByRoute('entity.node.canonical', array('node' => $node_id));
      $build['result'] = $result;
      kint($result);

In twig, I'm calling it as

{{ content.result }}

But it is not working..


texts: Connect to Salesforce using wsdl in Drupal 8

texts:
I am trying to connect to Salesforce (SF) with wsdl to pull data.

I can't use SF suite module or Salesforce rest client service.

In the D7 file, I have:

require_once ('soapclient/SforceEnterpriseClient.php');
require_once('soapclient/SforceHeaderOptions.php');
ini_set("soap.wsdl_cache_enabled", "0");

$sfdc = new SforceEnterpriseClient();
$SoapClient = $sfdc->createConnection($curPath.'/enterprise.wsdl');

It create the connections without any problems.

D7 References from here: https://developer.salesforce.com/page/PHP_Toolkit_11.0_Getting_Started and learned to how to use it from here: https://github.com/developerforce/Force.com-Toolkit-for-PHP/blob/master/soapclient/SforceEnterpriseClient.php

In the D8, I am trying to figure out how to connect to SF in the same way:

namespace Drupal\mymodule\Controller\Soapclient;
$sfdc = Soapclient::SforceEnterpriseClient();
$SoapClient = $sfdc->createConnection('../../includes/soapclient/enterprise.wsdl');

But got the SforceEnterpriseClient class not found error.

Stuck on it for a while, any help will be so much appreciated.
Anybody knows how to connect to SF in the same way like this:https://github.com/developerforce/Force.com-Toolkit-for-PHP/blob/master/soapclient/SforceEnterpriseClient.php


texts: Resize Image for more than one Image Size profile automatically

texts:
Here is my problem.

I have field BigPicture in a my Product Content Type.

Is there a way that When I upload an image from BigPicture Field that the current picture automatically resize in more than one image profile.

Here is the desire Image Resize Workflow:

1- Upload the image

2- Automatically Resize and Crop the image in more than one size property (Thumb :120px X 120px, Big : 250px X 250px, ExtraBig 1024px X 760px)

3- The Final File Name for each image should be like MyImageName_Thumb.jpg, MyImageName_Big.jpg, MyImageName_ExtraBig.jpg

I'am using Drupal 7

Thanks a lot


texts: How do I separate custom template from the administration theme?

texts:
I have made a custom template for the user_profile_form. I made a module and in the module I added the hook_theme function:

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

  $items['user_profile_form'] = array(
    'render element' => 'form',
    'path' => drupal_get_path('module', 'myuser'),
    'template' => 'user-account-form',
  );

  return $items;
}

This works as suspected but the theme is also applied in the administration theme. How can I have a custom template for the profile form and retain the original layout from the administration theme?


texts:
I am using the following to add a custom field to a user with a custom variable.

global $user;

$account = user_load($user->uid);

$language = ($user->language) ? $user->language : 'und';

$edit = array(
  'field_favourite_football_team' => array(
    $language => array(
      0 => array(
        'value' => 'Manchester City',
      ),
    ),
  ),
);

user_save($account, $edit);

Problem: I can see the outputted value on module A but on module B, when I dump or print out that global $user, I can't see that field. Is there anyway to save that on a for global use?


texts: How do I get a dashboard like the one drupal.org is using?

texts: In search of making the dashboard for the user like drupal.org site I came to know there is a dashboard module in the drupal core. It is already enabled but I am not getting user interface like drupal.org site, not for admin and not for otehr users, How can I activate that so the user profile looks like what is on drupal.org site. I enabled the permission for user also. And where is the tab for the dashboard or how to enable it? Or am I missing something?


texts: Contextual filters in Views - Filter by taxonomy

texts:
I have a View with contextual filters. I filter by Content Has Taxonomy ID. The problem is that the website is multilanguage, and the name of the taxonomy may change, have commas, non-common characters (cyrillic, for example), be too long and could be, in fact, different from the friendly URL.

My idea (which I have used in other projects) is to have the URL in this way:

www.example.com/en/products/sport-shoes

or

www.example.com/ru/продукты/спортивная-обувь

and from the URL, retrieve the parameters with

$url_arr = explode("/", $_SERVER['REQUEST_URI']);

In this case, $url_arr[2] would contain the taxonomy description(sport-shoes or спортивная-обувь in Russian), which is what I look for. The taxonomy name could be completely different, for example: "Sport shoes, complements, and other wearables".

Then I make a query to the database with db_query() searching by description field ( or better use a EntityFieldQuery), get the ID (the product will be associated to both taxonomy terms and I only need one), and pass the ID to the contextual filter, instead of letting the module Views to guess the ID from the URL (Term name converted to Term ID).

Is this procedure (which works) too convoluted? Is there a simpler and elegant way of doing this?


texts: View for selecting an image associated with a node's child node?

texts:
I am trying to compose a certain view. I have a content type lesson that contains exercise content types. Exercises reference a lesson nid through an entity reference field. Exercises have images. For a given lesson node, I am trying to build a view that returns the images associated with a lesson's exercises, and then choose one at random.

I couldn't figure out how to make Views return such a result set. And if someone can just explain this in SQL terms, irrespective of view, there is a fiddle: http://sqlfiddle.com/#!9/dbf63

Regards


texts:
I have exposed filter of taxonomy with dropdown. I want to override the dropdown menu, so that when I filter through this exposed filter, the url contains title of taxonomy and not the ID of taxonomy.

So, I have used hook_form_alter to override this dropdown, and made it in the form,

<option value='TEXT'>TEXT</option>,

initially it was like

<option value='ID'>TEXT</option>,

But in this case it is not filtering out any results, please suggest how can I make it work.

Thanks for your time.


texts:
I've successfully setup the LDAP configuration so that users can login to Drupal using their LDAP account.  I've mapped the Drupal password to the LDAP password so that when users change their Drupal password it updates their LDAP password.

I mapped Pwd: User only to [unicodePwd] and it synchronizes On LDAP Entry Creation and On Synch to LDAP Entry.

Those are the only two Synch options, and I need them in order to set the LDAP password.

The Question
How can I synchronize the password only when the user sets their Drupal password?  The LDAP password expiration date keeps changing every time a user logs into Drupal because it synchronizes the password with LDAP.

Edit: I actually thought I answered this question by only checking On LDAP Entry Creation and not On Synch to LDAP Entry.  That did prevent the password from being set every login, but it also prevented it from being changed at all!  Problem remains...


texts:
What is the best way to add javascript to Drupal theme now that drupal_add_js is gone?

I want to use specifically jQuery ui animate, which I suspect is in Core, but I cant find out how to add it to my theme.


texts: How to have two domains for same site, but site working in directory in second domain?

texts:
Example:

www.domain1.com -> Drupal site in root dir (Managed by Apache)

www.domain2.com/usa -> Drupal site of domain1.com (Managed by Nginx)

The idea is that www.domain2.com/<countrycode> points to the real domain but in a transparent way (User must not see the existence of the real domain).

What I did:

1) Configured nginx as reverse proxy:

## HTTP server.
server {
    listen 80; # IPv4

    server_name emed.com, www.emed.com;

    access_log /var/log/nginx/drupal.log;
    error_log /var/log/nginx/drupal.log;

    keepalive_timeout 75 75;

    root /opt/www/web/drupal;
    index index.php;

    include apps/drupal/drupal.conf;

    location /fr/ {
        proxy_set_header Host $host;
        proxy_pass http://localhost:8080/fr/;
        proxy_redirect http://localhost:8080/fr/ http://www.emed.com/fr/;
    }

}

2) Configured Apache

<VirtualHost *:8080>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
        Alias "/fr" "/var/www/html/drupal7"
</VirtualHost>

The problem is that Apache must have the Alias fr directive, otherwise Drupal generates incorrect URLs:

www.domain2.com/usa tries to load assets from www.domain2.com/sites/... instead of www.domain2.com/usa/sites/...

Is this even possible withouth using Alias? Because the first domain serves on / (root)


texts: How to display form submitted values without storing in database

texts:
I am new to Drupal. I couldn't figure out how to display the values submitted in a form on a new page without storing in a database.
I found a video on how to retrieve data submitted through a form and stored in a database, but, for my site I wouldn't need to store data. The data will get some simple mathematical processing and then the result will be displayed on another page. Here is the code I have.

<?php
/**
 * Implements hook_permission().
*/
function form_price_permission() {
return array(
'submit form_price' => array(
  'title' => t('Submit form_price'),
  'description' => t('Submit the form_price form'),
  ),
);
}
/**
* Implements hook_menu().
*/
function form_price_menu() {
$items = array();
$items['form-price'] = array(
  'title' => 'Form to calculate price',
      'page callback' => 'drupal_get_form',
  'page arguments' => array('form_price_form'),
  'access arguments' => array('submit form_price'),
);
return $items;
}
/**
 * form implementation
*/
function form_price_form($form,&$form_state){
$form = array();
$form['numberb'] = array(
    '#required' => '1',
    '#field_prefix' => 'Number B',
    '#weight' => '1',
    '#title' => t('B'),
    '#type' => 'textfield',
);
$form['numbera'] = array(
    '#required' => '1',
    '#field_prefix' => 'Number A',
    '#weight' => '2',
    '#title' => t('A'),
    '#type' => 'textfield',
    );
$form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add item'),
    '#weight' => '3',
);
 return $form;
 }
/**
  * how to display A + B
 */
function form_price_form_submit($form, &$form_state) {
$a = $form_state['values']['numbera'];
$b = $form_state['values']['numberb'];
$c = $a + $b;
}


texts: Node access doesn't consider translation

texts:
I'm trying to check user access to node via this code:

 $node = Node::load($node_id);
 User::load(\Drupal::currentUser()->id());
 $node->access('view', $account)

It seems it doesn't check if user has access to node translation or not and it check only for first language of node -when we create node for first time.

For example if node is created in English as published and later in french as unpublished node access returns which user has access.
If I update English language to unpublished and french to published, node->access returns false;

So node_access doesn't consider translation? How we can check for translations too?


texts:
When embedding an image in CKEditor on Drupal 7 any styles or alignment are applied directly to the image itself e.g.

However this doesn't allow for a great deal of CSS control over the appearance for the image because the inline styles override CSS.

How can I do the following 2 things:

Automatically wrap the image in a div and apply classes to this instead of the img element
For alignment use classes (e.g. 'image-left', 'image-right' etc.) instead of inline styles

So the above example would instead be rendered as:


texts: Hi i am using drupal feeds module to export csv data into my website, but when csv has more than 700 lines the exporter is failing saying "Source file is not in UFT-8 encoding",but if i upload same file with less that 700 line export is working fine.


texts: Are db_update->condition() and db_update->where() the same? If not, what are the differences?


texts: Views report for Ubercart Order product totals for date range?

texts:
I have been trying to create a view that will provide me with the total number of each product SKU ordered within a specified date range. Let's say there were three orders within the specified date range:

Order 101
Product ABC - Qty 1
Product XYZ - Qty 3

Order 102
Product ABC - Qty 1
Product XYZ - Qty 0

Order 103
Product ABC - Qty 10
Product XYZ - Qty 2

The View result would look something like this:

Total Number Ordered Per SKU for (date range)
Product ABC - 12
Product XYZ - 5

It is important for the results to be based on the SKU of the product, not the product title.

I have played around a bit with Views Aggregation on a "Type: Orders" view, but I am not knowledgeable enough to make it do what I need to do. Perhaps there is an easier way?

The purpose of this view will be to have an "at-a-glance" of which products need to be prepared for fulfillment, and how many of each, for the filtered date range.

Thanks!


texts:
I have a site "damo1.com" now I want to use my drupal site in "damo.com", so I just change $base_url in sites/default/settings.php. And I still can see my homepage very good, but I cannot check the others views or access to the site as user.

Do I need to do one more step? Thx


texts: NID as a contextual filter doesn't work on some nodes

texts:
I have a view where the NID is getting passed as a contextual filter for a specific content type, but some nodes doesn't pass at all and for some of them there is no problem.

I've checked the database, and I can see that the node NID I am trying to expose is there, but I still can't see it in Preview with contextual filters.


texts:
I am granting users specific a role on purchase of some product( using ubercart). In doing so I have added a rule to take away their initial role(so that they do not have 2 roles and confuse the content access permissions). When the role expires, I want to grant the use back his original role. I am trying to use rules to do this. However, I am unsure on what action to call this rule.
Any suggestions? Thanks!


texts: Node add form set entity reference default selection based on content from another type node

texts:
I wrote module with hook_form_alter to modify node_forum_form, i.e., node/add/forum form. One forum field is a taxonomy entity reference, field_topic. I want to set the field_topic selection based on the value from a specific node (NID=77) of type current_topic, which also has field_topic as an entity ref.

field_topic is ref to Topic taxonomy.

After loading node 77, I got the TID of the current_topic field_topic, loaded the term, and then got the term name. Name is displayed on the form above the title using $form['title']['#markup'].

Problem:  Before returning the form, how can I set the form default selection to be that same field_topic value?

use Drupal\taxonomy\Entity\Term;
use Drupal\Core\Form\FormStateInterface;

function MYMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {

  if ($form_id != 'node_forum_form') {
    return FALSE;
  }
  else {
    $nid = 77;
    $node = \Drupal::entityTypeManager()->getStorage('node')->load($nid);

    $current_topic_id = $node->get('field_topic')->getString(); //get the TID
    $term = Term::load($current_topic_id);
    $the_topic = $term->getName();

    $form['title']['#markup'] = t('
The Current Topic is:  ' . $the_topic . '
');

    // REPLACE THE NEXT LINE WITH CODE TO SET THE CURRENT TOPIC
    $form['field_topic']['widget']['#options']['_none'] = 'Click & Select the Current Topic';

    return $form;
  }
}


texts: How to define my own entity.tpl for my custom entity? I am using entity API to declare my entity and its controller and class. I don't want to use entity.tpl of entityAPI but my own tpl.


texts: Mailchimp 6.x-2.6 module wont update user changes to Mailchimp

texts:
I am using the MailChimp module and getting a problem when updating user settings.

The new settings are not synchronized with Mailchimp. The module is only working when users are created.

In module settings I tried with sync during cron and without it.It does not sync the changes.


texts: When using hook_form_alter() and additional submit functions, can one reference a php file for the submit callback?

texts:
The following code works.

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

  switch ($form_id) {
    case "webform_client_form_13":
      $form['#submit'][] = 'bleh_community_submit';
      break;
  }
}

function bleh_community_submit($form, &$form_state) {
  // Do some stuff here.
}

However, is it possible to use code similar to the following one, where the form submit function calls a PHP script (e.g. bleh_community_submit.php) containing the form submission handler?

function bleh_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case "webform_client_form_13":
      $form['#submit'][] = 'bleh_community_submit.php';
      break;
  }
}

// Separate .php file in the module directory with the
   additional bleh_community_submit function

function bleh_community_submit($form, &$form_state) {
  // Do some stuff here.
}


texts: Create custom entity type programmatically

texts:
maybe my title is not correct but I have written a module that creates a new entity. Now I would like to create a few of these entities on hook_install. I can create a new entity, that's not the problem, but I cannot create the entity types.

This is my code I use to create a new entity:

/**
 * Implements hook_install()
 */
function skilt_badge_install(){
  $entity = entity_create('skilt_badge', array('type' =>'test'));
  $entity->title = "Testtitle";
  $entity->description = "Testdescription";
  $entity->save();
}

Now, when I create a new Skilt badge type with the machine name "test" in the drupal interface it works. But first I would like to know how I create the Skilt badge type programmatically.

I've tried something like this first, thinking the type is also an entity:

/**
 * Implements hook_install()
 */
function skilt_badge_install(){
  $entity = entity_create('skilt_badge_type');
  $entity->title = "Testtitle";
  $entity->description = "Testdescription";
  $entity->save();
}

But that didn't really work because entity create requires a type...

Could you guys help me?


texts:
If I set a date programatically with this code:

$currentDateString=date("Y-m-d H:i:s", strtotime($current_date));
 $static_media->set('field_posted' , $currentDateString);

the data in field is there , when I do a get-> i can see the date, but it does not show up in the edit view of the entity. (just shows as blank)

If I modify the date in the edit view, when I do a 'get->' the date comes out with the EDT timezone in the time , and then it does show up in the edit form.

I tried inserting it with the EDT Timezone, but I get a message that the data is too long

Drupal\Core\Entity\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too       [error]
long for column 'field_pup_posted_value' at row 1: INSERT INTO {media__field_pup_posted} (entity_id,
revision_id, bundle, delta, langcode, field_posted_value) VALUES (:db_insert_placeholder_0,
:db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4,
:db_insert_placeholder_5); Array
(
    [:db_insert_placeholder_0] => 562729
    [:db_insert_placeholder_1] => 1045632
    [:db_insert_placeholder_2] => published_products_static
    [:db_insert_placeholder_3] => 0
    [:db_insert_placeholder_4] => en
    [:db_insert_placeholder_5] => 2017-06-08EDT17:19:31
)


texts: Patch gets not applied to Drupal locally in DDEV built with Composer from the Drupal Git repo

texts:
I try to build a local workflow to be able to review patches for core. I am using DDEV for the local environment. Steps I have taken:

git clone https://git.drupalcode.org/project/drupal.git .
ddev config --mariadb-version=10.3
git checkout 9.1.x #I've chosen that way cuz with detached head I am unable to install composer packages
ddev composer install
ddev composer require --dev drush/drush
ddev . drush si standard --account-name=myuser --account-pass=mypassword --account-mail=my@mail.local --site-name="D9 Test"
ddev . drush en help_topics
ddev composer require --dev cweagans/composer-patches

Then I've added the following part to the composer.json extra section

"enable-patching":true,
"composer-exit-on-patch-failure": true,
"patches": {
   "drupal/core": {
       "#3044059-48: Convert big_pipe, dynamic_page_cache, page_cache module hook_help() to topic(s) (https://www.drupal.org/project/drupal/issues/3044059)": "https://www.drupal.org/files/issues/2020-01-13/3044059-48.patch"
   }
},

When I perform a ddev composer update -vvv now the first odd thing is I get:

Gathering patches for root package.
Removing package drupal/core so that it can be re-installed and re-patched.
  - Removing drupal/core (9.1.x-dev), source is still present in core
Deleting core - not deleted

In the tutorials and documentation I've learned normally core gets deleted in that step? Next I get an exception with drupal/coder

  - Updating drupal/coder (8.3.8 => 8.3.9): Executing command (/var/www/html/vendor/drupal/coder): git show-ref --head -d
Executing command (/var/www/html/vendor/drupal/coder): git status --porcelain --untracked-files=no
    The package has modified files:
    D coder_sniffer/Drupal/Test/Arrays/ArrayUnitTest.1.inc
    D coder_sniffer/Drupal/Test/Arrays/ArrayUnitTest.inc
    D coder_sniffer/Drupal/Test/Arrays/ArrayUnitTest.inc.fixed
    D coder_sniffer/Drupal/Test/Arrays/ArrayUnitTest.php
    D coder_sniffer/Drupal/Test/Arrays/DisallowLongArraySyntaxUnitTest.php
    D coder_sniffer/Drupal/Test/Arrays/disallow_long_array_d7/DisallowLongArraySyntaxUnitTest.1.inc
    D coder_sniffer/Drupal/Test/Arrays/disallow_long_array_d7/disallow_long_array_d7.info
    D coder_sniffer/Drupal/Test/Arrays/disallow_long_array_d8/DisallowLongArraySyntaxUnitTest.2.inc
    D coder_sniffer/Drupal/Test/Arrays/disallow_long_array_d8/DisallowLongArraySyntaxUnitTest.2.inc.fixed
    D coder_sniffer/Drupal/Test/Arrays/disallow_long_array_d8/disallow_long_array_d8.info.yml
    289 more files modified, choose "v" to view the full list
    Discard changes [y,n,v,d,s,?]? y

I've chosen yes and proceeded and get for the patch part the following output:

- Installing drupal/core (9.1.x-dev): Source already present
    REASON: Required by the root package: Install command rule (install drupal/core 9.1.x-dev|install drupal/core 9.1.x-dev)

  - Applying patches for drupal/core
    https://www.drupal.org/files/issues/2020-01-13/3044059-48.patch (#3044059-48: Convert big_pipe, dynamic_page_cache, page_cache module hook_help() to topic(s) (https://www.drupal.org/project/drupal/issues/3044059))
Downloading https://www.drupal.org/files/issues/2020-01-13/3044059-48.patch
patch '-p1' --no-backup-if-mismatch -d 'core' < '/tmp/5eb75f842ba88.patch'
Executing command (CWD): patch '-p1' --no-backup-if-mismatch -d 'core' < '/tmp/5eb75f842ba88.patch'
patching file core/modules/help_topics/help_topics/core.performance.html.twig

The output states that the file core/modules/help_topics/help_topics/core.performance.html.twig was patched. But problem is there isn't any core.performance.html.twig file. It doesn't exist at all.


texts: Composer install is asking me user and password for a contrib module

texts: I'm installing my own clone of a Drupal project and when I'm launching Composer Install, in the drupal/calendar, ask me an git.drupal.org id to download the module...what can I do?


texts: How to import a boolean value in a migration

texts:
I'm trying to run a migration and one of the fields in Drupal is a boolean. For some reason I cannot get it to import the boolean value.

In Drupal

The field type is boolean, the on/off labels are yes/no (I've also tried setting them to on/off). the machine name is field_release_compilation

In my data source (Google sheets the data is stored as:

"gsx$compilation":{"$t":"1"}

I have also tried values of "TRUE", "on", "Yes" as well as "1"

In my migration

I'm using the google sheets plugin, along with migrate plus and migrate tools. The rest of the data pulls in fine so there's no issue connecting to sheets or that it's viewing the wrong doc/worksheet.

I remap the field using (I'm remapping every field, the others work fine)

fields:
- name: Compilation
  label: Compilation
  selector: compilation

I've tried the following ways of processing the field, all to no avail:

field_release_compilation:
  - type: bool
    source: Compilation

field_release_compilation:
  - fieldtype: bool
    source: Compilation

field_release_compilation:
  - type: boolean
    source: Compilation

field_release_compilation:
  - fieldtype: boolean
    source: Compilation

field_release_compilation:
  - callable: boolval
    source: Compilation

I'm not sure what to try next...


texts: Load custom library when form contains special field type

texts:
I'm writing a custom field in Drupal 8. I added a custom library that contains js and css to my module. They will be loaded on forms. Now I need a way to load the library only when some special field is placed in the form.

How can I check if a form contains a field with field type X?

function rate_field_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
   if(/*Check if form contains field with type X*/)
   {
      $form['#attached']['library'][] = 'rate_field/admin-star-field';
   }
}


texts: dpm() does not display any results on screen

texts:
I have the same problem as file_scan_directory() takes about 10 seconds to execute. I just tried the dpm(func_get_args()) suggestion, and unfortunately it doesn't show anything to me.

I've cleared all the caches, and run the cron tasks. What am I missing?


texts: Checking for custom view mode inside twig template!

texts:
I am using {% if teaser %} .... {% endif %} To change structure of content type according to its view mode.

But it looks like I cannot check for custom view modes created using Drupal 8, Such as:

{% if medium_teaser %}

     {{ content.field_image }}
     Buy now

{% endif %}

Is there a way to check for custom view modes in twig templates?


texts: Search API / Facet API hierarchy based on taxonomy term reference across vocabularies

texts:
With Search API + Facet API it is possible to create search facets for taxonomy term reference fields, that reflect the hierarchy of terms in the vocabulary, based on the taxonomy_term_parent table. (With Facet API Taxonomy Folding it is even possible to browse these hierarchies as folders.)

Sometimes hierarchical information is not represented in the taxonomy_term_parent table, and the relations exist between terms of different vocabularies.

E.g. in a site I am building, a "Product series" has a term reference field to "Product family", which has a term reference to a "Supplier". Suppliers, Product families and Product series are 3 distinct taxonomy vocabularies.

Some products only have a supplier. Others have a supplier and a product family. And some have all three. If a product has a series, then its product family is the same as that of the series. And if it has a product family, then the supplier is the same as that of the product family.

I would like to expose this structure as one hierarchical facet, similar in appearance and behavior to that for a single hierarchical vocabulary.

Any ideas?

What I managed so far is to assemble the terms from different vocabularies into a common entity property. I also managed to unify the two different "parent term" relationships (series -> family, family -> supplier) into a common entity property. But then what?


texts:
I created a views. I am not sure what I selected show and Type when I created the view.

After I created the view, I see it is retrieving data from multiple content types. I am trying to edit the view to select the specific content type but i cant find it under edit view page.

Content type that I created name is "xpress". View name is "GlobalSearch". How can I edit the view and select to display only the content type "xpress".

Thanks.
D


texts: How to add pagination after using hook_views_post_execute() to modify $view->result?

texts:
I have successfully used hook_views_post_execute() to remove results I do not want from $views->result.

Now, however, I need to paginate the remaining results.

The code in my hook_views_post_execute() requires the full result set to work. If I edit the view in the admin interface and set it to 10 items per page with full pagination, the $views->result in hook_views_post_execute() will only include 10 items, so my code doesn't function properly.

It looks like I need to use hook_views_pre_render() to set up the pagination, but I'm not sure how.

Can someone point me in the right direction?


texts: Provide additional Status option for user_profile_form

texts:
I am writing the below code

     function mymodule_form_alter(&$form,&$form_state,$form_id){
      if($form_id == 'user_register_form' && $form_id == 'user_profile_form'){
        $form['account']['status']['#options'] = array(0 =>'Blocked', 1=>'Active', 2 => 'Closed', 3 => 'Ractive');
        }
     }

I am able to see the options at user register form but not in user profile form.
How to add other option on user profile edit.


texts:
I am trying to create a Menu-minipanel which will appear directly below the horizontal header menu, and push the content below down.

I have set the menu positioning to static so that it sits within the page structure, but that renders it at the bottom of the page when triggered (which is where it is put by default, and usually repositioned from there outside of the page structure).

Among the Menu mini-panels options there is a field labelled:

  "Allows control over where within the page's DOM structure the
  minipanel will be inserted. This defaults to $(document.body), i.e. at
  the end of the page's content."

but I have absolutely no idea how to manipulate this, and cannot find any documentation which makes this clear.

DOM is something I simply don't have a clue about, and I feel like I am so close to the answer, but my own knowledge seems to have run out!

Any guidance would be so appreciated!


texts:
I have the colorbox module installed so I assume there's a way to do this with it, but I've had no success. Pretty much what I'd like to do within the WYSIWYG editor is have a link to an external website open up in a colorbox modal. I have forms hosted on a third party website, so instead of having users leave my site, I'd like the ability to have them just see that external form in the colorbox.

How do I achieve such a thing? I've tried adding the colorbox-node class to no success and also tried creating my own class and then in a custom js file have the following code:

 (function($){
    $(".custom-class").colorbox({iframe:true, width:"80%", height:"80%"});
 }(jQuery));

The above code fails when I inspect it with the following error:
TypeError: $(...).colorbox is not a function.

I'm also using a bootstrap sub-theme but I don't think the modal component would be of any use, would it?


texts: Remove site name from template using twig function

texts:
I try to get rid of the site name which come with the twig expresseion {{ page.header }}.

To get further details of that variable I enabled twig debug mode and printed it {{ kint(page.header) }}.

It seems that block--system-branding-block.html.twig is used within {{ page.header }}. At the end of file it shows.

{% if site_name %}

      <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}

{% endif %}

The question is how to use a twig function to remove that item from {{ page.header }}.
There is a filter which is called without and I already applied it to page.header|without('site_name'). But that didnt work.

Additional question, how to establish a connection between the printed variables from {{ kint(...) }} and the template file. Iam looking for that specific div which displays the site name but I can't find it in the printed variables from debug in order to remove it.


texts: To get a table in drupal 7 same as content_type_[your_field_name] in drupal 6?

texts:
In the Drupal 6 database, for every content type, there is a  table that's called content_type_[your_field_name]
Now I have a database query as follows in drupal 6 :

db_query("SELECT n.nid FROM {node} n INNER JOIN {content_type_field_abc} s ON n.vid = s.vid
                          INNER JOIN {def_table} sts ON s.nid = sts.nid
                          WHERE n.type = 'trans' AND s.field_study = '%s' AND sts.status = 1", $account->name);

Then how can I use db_query in drupal 7 to get a table containing all the fields of the content type as columns same as drupal 6 ?

Or Simply, how can I write the above given query in drupal 7 ?


texts:
Is there a way to silence all PHP errors, warnings and notices in Drupal?
They are usefull on the devel site but they are a big security risk, and make the site look bad on live.

I know on Drupal 6 the page at admin/settings/error-reporting can stop Drupal from writing errors to the screen, but where can I find this in Drupal 7? It seems it is missing.


texts: How to submit a user profile form through ajax?

texts:
I want to submit the user profile form through ajax.

I see the ajax_register module but it does not support the user profile form. Is there any contrib module which I can use?

Or this can done custom. But with custom approach I have to look for the form validation also?


texts: Update order status with administrator comment

texts: I need a way to be able to allow an admin user post an order comment when they update the order status that the owner of the order would then get posted on their order. This would both be viewable from the owner of the order, when the owner of the order was logged in under their order history view of that particular order, but would at the same time, get an email with these update comments. Ubercart 2 did this quite well. I imagine Drupal Commerce is capable, but how?


texts: How to access global variable from within Drupal content

texts:
I am trying to access a global variable I created using javascript within a content node i created. In an attached js file i have var rootpath = "/clients/UMP/";

Inside of my drupal page i have:

<script>document.write(window.rootpath);</script>

But it just shows the text: undefined

Am i doing something wrong? Is there a more better way to do it using php perhaps?
Thank you for taking the time to read this and respond. I apologize for being such a noob with drupal. I have only been using it for a few weeks.


texts:
I've just installed recaptcha module and it works fine but I get this error only at the sign up screen (registration screen).

Does anyone know what can I do to fix it??

The error:

Notice: Undefined index: form_id in _captcha_get_posted_captcha_info() (line 604 of /var/www/drupal/sites/all/modules/captcha/captcha.module).
Notice: Undefined index: captcha_info in _captcha_get_posted_captcha_info() (line 607 of /var/www/drupal/sites/all/modules/captcha/captcha.module).

Screenshot:

https://image.ibb.co/eYQdhn/Captcha.jpg


texts:
I have different urls :

domain.com/blog : a list of articles made with Views module
domain.com/blog/article-title : article alias
domain.com/newsletter/confirm/add/xyz/ok : confirmation link sent to new subscribers by email by Simplenews module
domain.com/blog/ok : page to which subscribers are redirected after they click the confirmation link (simplenews passes the last arg to the redirect page)

For now, domain.com/blog/ok returns the same as /blog or a 404 (if I set the Global:null contextual filter in Views). I'd like new subscribers to be redirected to the blog page with a custom status message (for instance "You're now subscribed").

I guess it's something with hook_menu ? or MYTHEME_preprocess_page ?


texts:
I'm trying to add profile2 fields in my custom form. I have created a path in my custom module in hook_menu() and in page arguments inside array, I have passed my custom_form.

In my custom_form I have returned the following code:

function custom_form($form, &$form_state) {

    global $user;
    module_load_include('inc', 'user', 'user.pages');
    return drupal_get_form('user_profile_form', $user);
}

When I go to the path I do not see the fields which I had created for a particular profile type through manage fields. Instead it renders the default user-profile-form fields.

Where I'm going wrong? Please suggest any ideas.

Thanks In advance


texts:
I have a module and created twig templates there. I just followed the documentation here: https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-for-custom-module

I want to include a JS file from the twig. And the JS file is located inside the module folder. I have this code in the twig:

<script src="/{{ directory }}/js/script.js"></script>

But the directory is returning the theme path NOT the module path. How can I get the module path inside the twig?


texts: Notice: Undefined index: tid in taxonomy_field_formatter_prepare_view() (line 1669 of

texts:
I'm getting this error on my website. I have tried cleaning up the content type of all fields but it still shows up.

Any ideas what could be causing it, and how to debug?

Thanks a lot,

Chiko


texts: Changing a menu link used in the sitemap module but not in main nav

texts:
We are using the Sitemap module for creating a sitemap generated from three menus (Footer, Main nav and a 3rd arbitrary one).

In the main nav we have a placeholder LI element which we use to insert a view.

In the sitemap template we need to replace this placeholder with some content without affecting the main nav.

In the sitemap overridden template where {{ item.content }} normally appears I tried replacing with the following:

{{ item.content|replace('>LRGPH_BRANCHES_BY_SERVICE<', ('>' ~ allBranches ~ '<')) }}

Note: allBranches is a concatenation of the output of 4 views (Essentially pure HTML)

but Twig/Drupal seems to have issue with this as I get an error, as per below:

  Warning: strtr() expects parameter 1 to be string, array given in twig_replace_filter() (line 521 of /var/www/vendor/twig/twig/src/Extension/CoreExtension.php).
      twig_replace_filter(Array, '>LRGPH_BRANCHES_BY_SERVICE<', '>

I next tried using the contributed modules hook, namely function TEMPLATE_preprocess_sitemap(&$variables) but although I can see the HTML output of the sitemap I cannot change it using this as far as I can tell.

Is there any way to achieve this change at all without altering the Main navigation?


texts: Why does the "Main page content" block not display node content after upgrade of core?

texts:
I upgraded the Drupal core to 8.3.1 today morning. I also upgraded the modules like AT Tools 8.x-1.1, CAPTCHA 8.x-1.0-beta1 etc. on our production site.

Now, the "Main page content" block does not output the node content and outputs the following instead:

< data-history-node-id="46" class="ds-2col-stacked-fluid clearfix"> <> <>

Any help?

Edit:

The error is not displayed if I "Disable attaching Fields" from Home > Administration > Structure > Displays : Emergency settings. I think it is an issue with Display Suite.

How to troubleshoot it? Here is the info from the "Emergency Settings" page:

FIELDS ERROR

Disable attaching Fields

"In case you get an error after configuring a layout printing a message like "Fatal error: Unsupported operand types", you can temporarily disable adding fields from DS. You probably are trying to render an node inside a node, for instance through a view, which is simply not possible. See http://drupal.org/node/1264386."


texts: Language detection by domain breaks ajax requests over https

texts:
What do I have:

Drupal 8.6.2
Domain Access
Language modules
Cloudflare with https

Problem:

If in URL language detection option (/admin/config/regional/language/detection/url) I have "Path prefix" - everything works fine.

Party starts, when I change it to "Domain" - every ajax request on any subdomain is trying to get through http instead of https and I can see "mixed content error" in console, so these requests are being blocked and website is malfunctioning. I cant use views propeerly, upload files through Plupload, use autocomplete forms, change some settings etc.

If I change it back to prefix - ajax works great again.

For prefix I have site.com for default language and site.com/en - for english. For domain setting: site.com - default and en.site.com is english version.

In Domain Access settings I've tried to set all possible URL schemas (http, https and variable) - no change. In Cloudflare settings I have speacial rules, redirecting every request from http to https (I set up CF's https for dozen of websites, I know how to do it).

If I set back to prefix and go to en.site.com (it still works as an alias for the main domain) ajax works fine, so this is not something about server or background settings - it's just Drupal messing around.

I could run it with prefix, but for SEO purposes it is better to use subdomain, because website is going to be big and it is better to separate languages technically on different websites, search engines will rank these subdomains more correct.

Please help! This is my first experience with multilingual website and I don't have a clue what to do.


texts: Getting parent enitity of enitityreference field

texts:
Is there a function to get parent enityinfo to which entityreference field is attached. Similar function is hostEntity() provided by field_collection.

I created the content type which has enityform as enitityreference field.Enityform contains basic contact field with additional computed field.
In that field I need nid of node to which entityform is attached.Using entity_metadata_wrapper I am able to get info about entityform object using below code.

$wrapper = entity_metadata_wrapper($entity_type, $entity);
$info=$wrapper->entityInfo();

Any idea how to further backtrack and get parent node id?

Update : Entityform is attached to a node(ref).
1.Node contains entity reference field, to which enitity form is attached.
2.Enityform contains computed field.
3.In computed field when the above mentioned code executed, field $wrapper gets the details about enitityform object(should be because computed field belongs to this entity).
4.As there will be no relation between node and the attached entityfrom after submission, I am trying to capture the NID of node during the form submission.


texts: Why is file_managed not updated correctly?

texts:
In a custom module (amap), I have a custom content entity (contract) created with Drupal Console.
There are standard CRUD functions on this entity.
One of the fields of the entity is a file field:

$fields['file1'] = BaseFieldDefinition::create('file')
  ->setLabel(t('Source file'))
  ->setDescription(t('Source file (may be modified)'))
  ->setSettings([
    'target_type' => 'file',
    'file_extensions' => 'doc docx odt pages',
    'uri_scheme' => 'private',
    'file_directory' => 'contracts',
  ])

When I create one contract adding a file (a.pages) to the entity, everything works as expected: a file with permanent status is added to file_managed table and appears in Files tab of content page:

and the corresponding record is added to file_usage table:

My first problem appears when I want to update the contract changing the file (to Contract.doc, for example):
file_usage table is correctly updated:

but file_managed table is not! The previous file (a.pages) is still there with permanent status.

The second problem is quite the same: when I delete the contract, file_usage table is correctly updated: there is no more record related to these files.
But file_managed table is not! The previous file (a.pages) is still there with permanent status (as in update mode).

My question is: is is normal?
Do I have to handle file_managed table myself?
Why is file_usage correctly updated and not file_managed?
I naively thought it was the case...


texts: How can I exclude links to untranslated pages from Google search results?

texts:
I have a multilingual site (English and Japanese).  Japanese is the default language.  Some pages have been translated into English and some have not.

I am using the XML Sitemap and i18n Modules as well as Translation Redirect (one of the i18n submodules).

For pages that are not translated into English, both the "English" and Japanese versions are appearing in Google search results-- even though there is no English version!  (Both links appear like this:

www.mysite.com/en/node/29
www.mysite.com/ja/pathauto-url

I have two sitemaps (Japanese and English) made with the XML Sitemap module.  The pages that have not been translated into English are still listed in the English site map, so I assume this is how Google found the pages.

How can I deal with this?

Is it possible to remove untranslated pages from the sitemap of the relevant language?  Or is it possible to automatically redirect all untranslated pages to the default language?


texts: How can I see what variables are available on the loaded page via the devel PHP Execute block?

texts: How can I see what variables are available to me on the page i am viewing via the PHP Execute block? I'm trying to do a dsm($node) but that doesnt seem to work. Neither does dsm($page).


texts: How to give a content editor access to the theme settings?

texts:
I'm using the Marinelli theme and want to give my main content editor access to the theme settings.  Ideally just the ability to upload/change/add/subtract/enable the backgrounds of the rotating banner.

I don't see any way for them to do this without full access to the Theme settings. I was able to just give "administer themes" settings to this user and give them a shortcut to that theme.  But that's still a lot of liability.

Has anyone been able to do this: limit theme configuration to just certain tasks?


texts: Where all are the hooks defined in a contributed module?

texts:
What are the files in which core hooks are implemented in a contributed module?
Are they declared in .inc files? If so, what are the naming conventions for those include files containing core hooks?


texts: How to manipulate field with Number of value "unlimited" through php

texts:
I've got a field image with unlimited number of value and a view who shows 12 of them from different node(in this case I can not use delta).
Now instead of showing the 8th and the 11th pictures I want to show a blank box with text.

I would like to insert this loop so I installed view PHP and I wrote this code on the box "Output code"

$counter = 0;
foreach ($row->field_image as $image){
  if ($counter++ = 8){
  echo "something";
continue;
}
  if ($counter++ = 11){
  echo "something else";
continue;
}
print $images;
}

What am i doing wrong?
How can I get the result I want?
Thanks in advance


texts: Performances with many fields per content type

texts:
Drupal creates a new table for every new field in a content type.

How much this affects the performance in fetching data when the fields of an entity are 15 or more?

Is possible to store all fields in a table (with a new entity?) without drawbacks? Is worthwhile?


texts: How can I allow users to download the whole folder from Drupal? Is there any easy way? As far as understand, right before they click download link I need to execute php script on a server that will zip the folder and return link to user. This is just too complicated for me. Is there any module that can work? The best I've found is: http://drupal.org/project/download_file but it seems it only works with single file. I have a shared hosting.


texts: Ideas for implementing a shift scheduler? calendar? custom content type?

texts:
for our NPO we need the following feature: We have a bar, hotel and restaurant, and there are some fixed shifts ie. 7am to 12am, 12am to 7pm and so on, the whole week;

People enter their wanted work shift themselves;
There has to be an overview what shifts are set and which ones miss workers. A table for the current and next week, coloured with the user names;

I thought about a custom content type in a module, where the time (start, end) are set by the admin and can be changed from time to time. On click in the calendar resp. the overview panel, the node is prepopulated with auto_title and the times and the entityreference to the user.

And ideas if there is a view plugin which could do the overview, or do i need to code that myself?

I am aware of : shift_scheduler module (sandbox)


texts: Views UI doesn't provide links to expand fieldsets anymore

texts:
I have moved an entire drupal site to another server. While everything else seems to work fine, I can't quite access collapsed fieldsets in Views UI anymore. It looks like this

All fieldsets (STYLE SETTINGS and so forth) are collapsed. The fieldset label however is not a link. The content of the fieldset exists when I view the HTML of the site. If I remove the CSS

html.js fieldset.collapsed .fieldset-wrapper {
  display: none;
}

I can again see the fieldsets' contents, but the error must be somewhere else. But I don't have any clue where to look for. Anyone has an idea?

I tried to google the error, but it seems all known errors are related to some "Expand all" or "Collapse all" buttons.


texts: How do you print nothing from a Field template? (field--field_name.tpl.php)

texts:
I need to show a block if a field has a given state, or print nothing if it has a different state. I can get it to work using a field template with the code below, but printing useless html just to stop it from rendering it's default output seems more than a little hacky.

I've tried setting $element = null; - that didn't work. I tried changing #markup to be empty, that didn't work. Even using print ''; means Drupal kicks it's default rendering back in.

Is there a recommended method for telling a field to do nothing?

<?php if($element['#items'][0]['value'] === 1){
    //This is an archive page - show the block.
    $block = module_invoke('customblocks', 'block_view','archive');
    print render($block['content']);
    } else {
        //nothing to do here - not an archive page
        //The only way to stop Drupal rendering something appears to be to get it to print SOMETHING.
        //So we're going to print an invisible hr.
        print '<hr style="display:none;" />';
    }
?>


texts:
I have installed the Organic Group module and I created some groups. How can I make a menu which contains a list with all the groups?
Thanks!


texts: How does Drush figure out modules that have updates?

texts:
How does Drush get information about installed and disabled modules and  updates for them?

I'm facing issues since drush is trying to update modules that AREN'T in the modules directory nor in the system table anymore.

I had to remove them since they were causing problems.
But in the end I got nothing but more problems.

How could I get drush to understand these do not exist anymore and do not need to be a)checked and b)especially not updated.

I've tried drush rr to "make it clear" but it keeps trying these causing errors that crash all other updates etc.

Update:

These the modules.
Simplenews [simplenews-7.x-1.1],
Simplenews Bounced Mail Handler [Simplenews_BMH-7.x-2.x-dev],
Simplenews Statistics [simplenews_statistics-7.x-1.0-alpha1]

I can confirm that I can remove the simplenews rows from system table but they come back as soon as I run:              drush rr OR drush pm-list --pipe --type=module --status=disabled--no-core


texts: Getting the value submitted from form with FAPI radios in template.php

texts:
I have a form with radios on it. I do submit on the same page (there's no $form['#action'] assigned in the below code). What I want to do is to get submitted year in template.php so that I can define my logic based on received value.

To check that's all work fine I wanted print_r the contents of form['values'].
I did that in submit function but it didn't work. Actually, I can't print anything from both validate and submit functions.

So my question is how I can get the submitted value to template.php.

I work with the following code in my module:

function my_module_menu() {
  $items['formexample'] = array(
    'title' => 'View the sample form',
    'page callback' => 'mymodule_page',
    'page arguments' => array('frontpage_form'),
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM
  );
  return $items;
}

function mymodule_page() {
  $output = print_r($_POST, true);
  $output .= drupal_get_form('mymodule_form');
  return $output;
}

/**
* Define a form.
*/
function frontpage_form() {
  $form['years'] = array(
    '#title' => t('Please, choose appropriate year'),
    '#type' => 'radios',
    '#options' => array(
      t('2011'),
      t('2012'),
      t('2013')
     ),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit')
  );
  return $form;
}

/**
* Validate the form.
*/
function frontpage_form_validate($form, &$form_state) {
  if ($form_state['values']['user_name'] == 'King Kong') {
    // We notify the form API that this field has failed validation.
    form_set_error('user_name',
    t('King Kong is not allowed to use this form.'));
  }
}

/**
* Handle post-validation form submission.
*/
function frontpage_form_submit($form, &$form_state) {
  $name = $form_state['values']['years'];
  drupal_set_message(t('Thanks for filling out the form, %name',
  array('%name' => $name)));
}