texts: Uploading from within fieldset using drupal 6 forms API not working

texts:
I've got a drupal form with a fieldset (actually, two). Inside the fieldset, there are a number of dynamically generated file fields. Unfortunately, I can't seem to access these fields' contents from file_save_upload. Currently, I'm attempting to use the approach described here to set the #name property of my file fields so that the files array gets built correctly. However, file_save_upload always returns 0. What am I doing wrong?

Form (this is an example, since the actual form is dynamically generated by a bunch of code that isn't relevant here):

$form['release_data_graphics'] = array(              //This has a few other random things in it
    '#type' => 'fieldset',
    '#title' => 'Brand Release Graphics',
    '#collapsed' => FALSE,
    '#collapsible' => TRUE,
    '#weight' => 11,
);
$form['release_data_graphics']['graphics'] = array(  //This has a few other random things in it
    'folders' => array(                              //This is here because I iterate through it
        'folder1' => array(
            '#type' => 'fieldset',
            '#name' => 'Folder 1',
            '#description' => 'some description',
            'graphics' => array(                     //This is here because I iterate through it
                'graphic1' => array(
                    '#type' => 'file',
                    '#title' => 'Upload graphic 1',
                    '#name' => 'files[1]',
                ),
                'graphic2' => array(
                    '#type' => 'file',
                    '#title' => 'Upload graphic 2',
                    '#name' => 'files[2]',
                ),
            ),
        ),
    ),
);

Then, in my submit handler, I iterate through the folders and child graphics arrays (which I won't show here) with file_save_upload. My code ends up running file_save_upload like this:

graphic1 = file_save_upload('1', file_directory_path(), FILE_EXISTS_REPLACE);
graphic2 = file_save_upload('2', file_directory_path(), FILE_EXISTS_REPLACE);

When I select a few items for upload and then print the files table in the submit callback, the files table looks good:

[files] => Array(
    [1] => test1.png
    [2] => test2.png
);

So I'm really having trouble figuring out what's going on...


texts: Views: Path component not working in contextual filters

texts:
Details: I have to display view data on per user basis in a block-view. So i am trying a contextual filter on user id.

Read it somewhere that since blocks doesn't have a path so we will have to use "provide default value" option in setting of contextual filter. All goes well but it seems that filter is not taking the second component from the url.

Ex:
If my url is abc.com/user/9 and i set contextual filter to use  "Raw value from URL" and "path component" to 2. It checks filter on "user" not "9".

I tried changing the path component to 1 and 3 it takes "user" only as the value of fliter. Any suggestions here what am i doing wrong here?


texts: Filter view results by day of the week instead of the date - Date Module

texts: I have a view which includes a date field, and I'd like to provide a filter for users to show only items from a certain day of the week. From what I can see, though, the date filter only allows you to select the date by which to filter. Is it possible to create a filter which will allow users to show, say, all nodes which have a date that falls on a Wednesday?


texts: Drush 8.1 Drupal 8 throws PDOException: SQLSTATE[HY000] [2002] on MAMP

texts:
After installing Drupal 8 (via installation wizard), trying to run any drush command, getting below error:

drush en views_ui
PDOException: SQLSTATE[HY000] [2002] No such file or directory in core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php on line 79 Drush command terminated abnormally due to an unrecoverable error.

Drupal version: 8.2.x

Drush version:  8.1-dev


texts: How to disable persistent database connections for Drupal 7 / PostgreSQL

texts:
I have a Drupal 7.2 + CentOS 5.6/64 bit + PHP 5.3 + PostgreSQL 8.4.8 (servicing unix domain sockets only) web site which often goes down on peak times because of too many postmaster processes started.

On the advice from PostgreSQL mailing list I have installed pgbouncer at "port" 6432 with the following config:

[databases]
pref = host=/tmp user=pref password=XXX dbname=pref

[pgbouncer]
logfile = /var/log/pgbouncer.log
pidfile = /var/run/pgbouncer/pgbouncer.pid
listen_port = 6432
unix_socket_dir = /tmp
auth_type = md5
auth_file = /var/lib/pgsql/data/global/pg_auth
pool_mode = transaction
server_check_delay = 10
max_client_conn = 200
default_pool_size = 16
log_connections = 0
log_disconnections = 0
log_pooler_errors = 1

And forced Drupal 7.2 to use it by changing  sites/default/settings.php to:

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'pref',
      'username' => 'pref',
      'password' => 'XXX',
      'host' => '/tmp',
      'port' => '6432',
      'driver' => 'pgsql',
      'prefix' => 'drupal_',
    ),
  ),
);

Here an excerpt from /var/log/pgbouncer.log during peak times:

2011-06-20 17:32:48.591 23883 LOG File descriptor limit: 1024 (H:1024), max_client_conn: 200, max fds possible: 230
2011-06-20 17:32:48.591 23883 LOG File descriptor limit: 1024 (H:1024), max_client_conn: 200, max fds possible: 230
2011-06-20 17:32:48.592 23886 LOG listening on unix:/tmp/.s.PGSQL.6432
2011-06-20 17:33:48.593 23886 LOG Stats: 36 req/s, in 3346 b/s, out 57238 b/s,query 74605 us
2011-06-20 17:34:48.593 23886 LOG Stats: 43 req/s, in 3167 b/s, out 54435 b/s,query 68969 us
2011-06-20 17:35:48.593 23886 LOG Stats: 25 req/s, in 3391 b/s, out 42060 b/s,query 95764 us
2011-06-20 17:36:48.593 23886 LOG Stats: 25 req/s, in 3370 b/s, out 103636 b/s,query 72986 us

Also I've been advised to disable persistent database connections and have done it for my own PHP scripts.

But I don't know how to do it for Drupal, what would be the best spot for that?

Thank you!
Alex


texts:
There is a content type called library which has a field collection type as a field and  unlimited number of this field is allowed. I used Devel module to generate 200 nodes of library, so more than 1000 field collection items were generated. after deleting the nodes from /admin/content the field collection items were not deleted. How do I can delete these field collection items?

After a few search I found this code

for($i = 1 ; $i <= 700 ; $i++)
    entity_delete_multiple('field_collection_item', $i);

but it deleted nothing.I also found a few other codes on Drupal Stackexchange but none of them worked.

Thanks


texts: Print custom HTML between Exposed Filter Area and Results in Views

texts: I set up a view in drupal 7 that displays all my content.  I exposed filter criteria's Title and Taxonomy, so now there's a title and taxonomy search field that appears above the result set.  How do I print custom text like "Search Results:" between the filters and the results?


texts: Custom content type and views field rendering

texts:
I have a template views-view-fields--services.tpl.php

I don't want to iterate over the array of fields as I know which each of them are in this case.

I want to simply:

  <?php echo $row->title; ?>

  <?php echo $row->image; ?>

Doesn't appear to be a higher level template which might have this context of data???

UPDATED CODE SAMPLE:

views-view--services.tpl.php:

  <?php print $rows; ?>

views-view-unformatted--services.tpl.php:

<?php foreach ($rows as $id => $row): ?>
  <alex>
    <?php print $row; ?>
  </alex>
<?php endforeach; ?>

views-view-fields--services.tpl.php:

<?php foreach ($fields as $id => $field): ?>

  <?php /*print $field->class;*/ ?>
  <?php print $field->content; ?>

<?php endforeach; ?>

Results in:

    <alex>

    Entry #1

Briefly describe which problems we can help with.

  </alex>
  <alex>

    Entry #2

Quickly describe the services we offer or how our services can help?

  </alex>


texts: How we can remove field--type-entity-reference-revisions div from a paragraph

texts:
I am using paragraph module. and create a twig tempate for the paragraph - paragraph--machine-name--default.html.twig but It generated a div at starting of paragraph having class field field--name-field-machine-name field--type-entity-reference-revisions field--label-hidden field__items
<div class="field field--name-field-fieldname field--type-entity-reference-revisions field--label-hidden field__items">

 paragraph content displaying

</div>

How I can remove this div and can show only the paragraph content


texts:
I'm trying to override default views templates using _theme_process_registry() function.
It's ok, but i've got some trouble when administrator trying to redefine output via views_ui interface. When he creates a new template, he obviously starts from default views templates (views/theme folder), so my templates is lost.

I'm trying to do so:

$theme_path = drupal_get_path('module', 'mymodule') . '/theme/default_templates';

/**
 * List all plugins trying to find overriden in our work directory
 */
foreach($plugins as $group_name => $plugins_group) {
    foreach ($plugins_group as $plugin_name => $plugin) {
        if (isset($plugin['theme']) && file_exists($theme_path . '/' .  strtr($plugin['theme'], '_', '-') . '.tpl.php')) {
            $plugins[$group_name][$plugin_name]['theme path'] = $theme_path;
        }
    }
}

but single field template doesn't work, coz its hardcoded in view_plugin_display.inc

// Field templates aren't registered the normal way...and they're always
// this one, anyhow.
$output .= '<pre>' . check_plain(file_get_contents(drupal_get_path('module', 'views') . '/theme/views-view-field.tpl.php')) . '</pre>';

Is anybody know how to fully override views templates to my own module directory?

And the second. I need to create more semantic markup like on  dev.twitter.com.

How to redefine classes_array to get rid of extra classes and div elements?

I'm using drupal 7 and views 3.


texts:
Is there a way to have a rule run as a specific user instead of the person who triggers it?

For instance I have a rule where, if an authenticated user posts a certain type of content it creates a forum post in the administrators only forum.  But it seems like I'm having issues because the user doesn't have access to post in the forum that I want the post to go to.

The rule works when the application is submitted by someone with access to that forum, but creates a forum post with no taxonomy if run by someone without access to that forum.

Example export:

    { "rules_test_application" : {
"LABEL" : "test application",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_insert--guild_application" : { "bundle" : "guild_application" } },
"IF" : [
  { "node_is_of_type" : {
      "node" : [ "node" ],
      "type" : { "value" : { "guild_application" : "guild_application" } }
    }
  }
],
"DO" : [
  { "entity_create" : {
      "USING" : {
        "type" : "node",
        "param_type" : "forum",
        "param_title" : "New App: [node:title]",
        "param_author" : [ "site:current-user" ]
      },
      "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
    }
  },
  { "data_set" : { "data" : [ "entity-created:language" ], "value" : "en" } },
  { "data_set" : { "data" : [ "entity-created:taxonomy-forums" ], "value" : "9" } },
  { "data_set" : { "data" : [ "entity-created:body:format" ], "value" : "xbbcode" } },
  { "data_set" : {
      "data" : [ "entity-created:body:value" ],
      "value" : "new application : [node:url]\r\n                                                  \r\nBnet ID:[node:field-battle-net-id]\r\n                                                     \r\nemail: [node:application-email]\t\r\n\r\n"
    }
  }
]
}
}


texts: How to show children terms of parent terms in taxonomy?

texts:
Ok this thing is driving me completely haywire! I think this question has been asked before in some ways but I seem to be too dumb to tweak those to my requirement.

I've created a taxonomy vocabulary named "Brands" of products like so

Level 1: Brand names like Logitech, Gigabyte etc.

Level 2: Product categories like mice, keyboards, headphones etc inside each brand.

Level 3: The actual products inside each categories.

These levels can go deeper if necessary. Like in mice there can be wireless and standard ones. I hope I'm being clear. I've also created a menu from this taxonomy by using "Taxonomy Menu" and "Superfish" modules.

Now what I want is that when I click a menu entry (could be of any level) the page loaded should list it's children inside it. Like clicking Gigabyte should list only the names of categories of products inside the page not the actual products. I've gone through many insane combinations of options in views but to no use. So far I've only managed to show product teasers on every level but that's not what I want.

I want to do things the way it's done on the following site:
http://www.shophive.com/

I'm using Drupal 7 by the way.

Please please please help me with this as I'm on a deadline! :(


texts: How to clear textfield entityreference_autofill if select -none-

texts:
How to clear textfiled from module Entity reference autofill.

If select -none-, I try with jquery but not respond if change to -none-.


texts: I am trying to assign a user role at registration using Webforms in Drupal 8. Is this possible or is there another form module that would do it better? I have two user roles 'Venue' and Artist' which will be used throughout the site still using Webforms to enter data specific to user role. New to D8. Thank you.


texts: Adding Encryption to a Specific Field in an Existing Product Form

texts:
I'd like to add encryption to one of the fields in a product form on my site. I want to do this because my hosting provider doesn't send outbound email using TLS and users receive emails with this problem:

https://support.google.com/mail/answer/6330403?p=tls&hl=en&rd=1

Nothing sensitive contained in those emails, but I don't like it. See here for more information about what I've been working on. I took the second comment from that DA thread and tried implementing encryption.

My So-Far Unsuccessful attempt at Encryption:

First, I installed Encrypt. Then I installed Encrypt Form API. I enabled both of course.
Next, I opened up my custom module that uses hook_form_alter on the specific form I need to change.

I added the following lines:

if($form_id == 'commerce_checkout_form_checkout') { // this part was
    already there of course
      $form['#encrypted_field'] = TRUE;
      $form['customer_profile_billing']['field_email_address']['und'][0]
    ['value']['#encrypt'] = TRUE;

I also tried:

  $form['customer_profile_billing']['field_email_address']['#encrypt'] =
TRUE;

But the first one is how the form is named according to the code inspector.

Unfortunately, none of this helped me and I'm still getting a red lock icon next to the recipients email address in their inbox when they get the message. And yes the site is SSL protected and its enforced.

Question:
Is my code wrong and if so, can anyone provide guidance on how to improve it?


texts: Last hook to be called after entity save?

texts:
Of the various hooks called during the entity save process, which is the very last to be called?

Is there a way to trigger an event after the entity has been created, after all fields have been saved, after caches updated, etc? So that, when a user saves the update form, this action is the very last thing to happen before the redirect page is loaded?

If it's not strictly part of the save process, that's fine. What matters is: it's called after everything to do with an entity being saved. If there's a way of hooking some form function and reliably identifying from the data in there that a save process has been completed, or defining some callback, that's fine by me.

(context: I've got a problem where field caches are being created that caused newly created nodes, and other fieldable entity types, to load as if they are blank and as if they have no field data - but all attempts so far using cache_get and cache_clear_all don't find the cache - it's being created late in the process. So I'm looking for the latest possible hook which will definitely get it)

(Relevant info: hook_entity_postsave doesn't exist, and is one of those core issues that got stuck months and months ago)


texts: How do I print or expose a view field value in a page template?

texts:
I have a view display (as page) in which I want to theme the full container of the "view", taking the "filter field value of items" as an extra title for the main container. I have tried different preprocess way to get the field out of the view without success.

This is an example of the code I used.

function template_preprocess_page(&$variables)  {
  if ($view_id = \Drupal::routeMatch()->getParameter('view_id') && $view_id === 'viewnamedisplay') {
    $variables['field_to_print'] = $variables['view_id']->$variables['field']->field_to_print->value;
  }
}

Then I used {{ field_to_print }} in  page--template.html.twig.


texts: Adding external databases to settings.php using prefix

texts:
As per the comments in settings.php:

/*
 * You can also use a reference to a schema/database as a prefix. This maybe
 * useful if your Drupal installation exists in a schema that is not the default
 * or you want to access several databases from the same code base at the same
 * time.
 * Example:
 * @code
 *   'prefix' => array(
 *     'default'   => 'main.',
 *     'users'     => 'shared.',
 *     'sessions'  => 'shared.',
 *     'role'      => 'shared.',
 *     'authmap'   => 'shared.',
 *   );
 * @endcode
 */

So if my current simple default looks like:

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'dev',
      'username' => 'dev',
      'password' => 'dev',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => false,
    ),
  ),
);

How would I add two tables (table1 and table2) on another database (dev1) on localhost so that they are available to drupal?


texts:
With Drupal 8.0.0-rc2, no matter what, I get this error in the JS console:

  Uncaught TypeError: Cannot read property 'icons' of null

I think I have defined everything correctly, so I don't know what causes this error or what I missed.

Plugin definition:

/**

* @file
 * Contains \Drupal\codesnippet\Plugin\CKEditorPlugin\CodeSnippet.
 */

namespace Drupal\codesnippet\Plugin\CKEditorPlugin;

use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\ckeditor\CKEditorPluginConfigurableInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\editor\Entity\Editor;
use Drupal\Core\Url;

/**
 * Defines the "codesnippet" plugin.
 *
 * @CKEditorPlugin(
 *   id = "codesnippet",
 *   label = @Translation("CodeSnippet"),
 * )
 */
class CodeSnippet extends CKEditorPluginBase implements CKEditorPluginConfigurableInterface {
  /**
   * {@inheritdoc}
   */
  public function getFile() {
    return drupal_get_path('module', 'codesnippet') . '/js/plugins/codesnippet/plugin.js';
  }

  /**
   * {@inheritdoc}
   */
  public function getConfig(Editor $editor) {
    return array(
      'codeSnippet_dialogTitleAdd' => t('Insert Code'),
      'codeSnippet_dialogTitleEdit' => t('Edit Code'),
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getButtons() {
    return array(
      'CodeSnippet' => array(
        'label' => t('CodeSnippet'),
        'image' => drupal_get_path('module', 'codesnippet') . '/js/plugins/codesnippet/codesnippet.png',
      ),
    );
  }

  /**
   * {@inheritdoc}
   */
  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
    $form_state->loadInclude('editor', 'admin.inc');

    $styles = $this->getStyles();

    $form['highlight_style'] = array(
      '#type' => 'select',
      '#title' => 'Highlightjs Style',
      '#description' => t('Select a style to apply to all highlighted code snippets. You can preview the styles at !link.', array('!link' => \Drupal::l('https://highlightjs.org/static/demo', Url::fromUri('https://highlightjs.org/static/demo/')))),
      '#options' => $styles,
      '#default_value' => !empty($form_state->storage['editor']->settings['plugins']['codesnippet']['highlight_style']) ? $form_state->storage['editor']->settings['plugins']['codesnippet']['highlight_style'] : 'arta.css',
    );

    return $form;
  }

  /**
   * Returns available stylesheets to use for code syntax highlighting.
   */
  private function getStyles() {
    $styles = preg_grep('/\.css/', scandir(drupal_get_path('module', 'codesnippet') . '/js/plugins/codesnippet/lib/highlight/styles'));
    $style_options = array();

    foreach ($styles as $stylesheet) {
      $style_options[$stylesheet] = $stylesheet;
    }

    return $style_options;
  }
}

The icon on the toolbar when editing the text format appears just fine, I can drag it in and out of the active toolbar, and my settings form shows. But due to the JS error generated, it does not work.

The plugin used is available on ckeditor.com, I dropped it into the plugins/codesnippet/js folder untouched.

I can't find any other examples of custom plugins using anything called 'icons'.


texts: I want the view to show no results when the filter doesn't containing anything

texts:
I am trying to use the Views module for an auto-submit field, to get the names from my taxonomies. How can I get the field to show the results after the users type something into the input box, instead of showing all the results when nothing has been entered as value for the filter?

I have tried a number of contextual filters but no luck.

This what the current search looks like, if I type in one of the terms or the field name it matches up to what I type which is how i wanted it to work, the problem is the the results are showing by default before I type anything.


texts: Configure a view to display nodes that match a term value of the container node

texts:
I have two content types:

Programs
Events

I have a vocabulary:

Programs

I have a view that displays Events, and I place the view in my Programs nodes.

Both Programs and Events have a field_term_programs that references the Programs vocabulary. If I place the view in a Programs node, I want it to display any Events assigned to the same Programs term as that Programs node.  I have tried to set this up using contextual filters but have had no luck thus far.  The views block is displayed in the Programs node, but no nodes are displayed within the block.


texts: How to use Sort By desc by default with toggle link enabled?

texts:
I am using better exposed filter and added toggle link sorting for a field. But the toggle link sort Asc order on first click. I want to make it Sort Desc on first click.

I tried to write :

MyField Desc|MyLabel
MyField Asc|MyLabel

But it doesn't work.


texts: user_login_block not displaying status messages

texts:
I am creating my own theme for my website, and am having an issue with the user_login_block form. I have a simple jQuery dropdown style content div in which I am outputting the form, and have no clue why it is not displaying status messages (invalid login attempts, ect..). When entering incorrect credentials, the page simply refreshes and nothing is displayed to the end user. I am new to Drupal, but not new to PHP. I have no idea what I could be doing wrong. My code is below, any help would be much appreciated.

hook_form_alter:

function dtn_form_alter(&$form, &$form_state, $form_id) {
    switch($form_id) {
        case 'user_login_block':
            $form['links']['#markup'] = '

' . t('Request new password') . '

';
            $form['name']['#title'] = Null;
            $form['name']['#attributes'] = array('placeholder' => t('Username'));
            $form['pass']['#title'] = Null;
            $form['pass']['#attributes'] = array('placeholder' => t('Password'));
            break;
    }
}

Login Form Source:

$userLoginForm = drupal_get_form('user_login_block');

$output .= '
';
$output .= '
' . t('Login') . '';
$output .= '
';
$output .= render($userLoginForm);
$output .= '
';
$output .= '
';
$output .= '
' . t('Register', ['!url' => url('user/register')]) . '
';
$output .= '
';

$output = '
' . $output . '
';

return $output;

}


texts: D8 services errors - No route found for the specified formats : */*

texts:
I'm trying to get data from a Drupal 8 website to Go application.I created a view that it would display title and body on json format. Here is an example
  Th when the Go application try to get the request I got this error.

Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException: No route found for
the specified formats : */*. in Drupal\Core\Routing\AcceptHeaderMatcher->filter() (line
64 of core/lib/Drupal/Core/Routing/AcceptHeaderMatcher.php).

What I'm doing wrong ? As far I know, the Go application is asking the request properly.

Just in case you are wondering about the Go app here is the code.


texts: Is there a way to trace PHP errors logged from Rules?

texts:
Occasionally I'm seeing an error in the error_log

[10-Apr-2015 10:16:45 America] PHP Parse error:  syntax error, unexpected 'Some text' (T_STRING) in /home/simulab1/public_html/profiles/commerce_kickstart/modules/contrib/rules/modules/php.eval.inc(146) : eval()'d code on line 1

This could be coming from any number of Rules we have. Is there any way to pin this down to the specific Rule in question?

TIA


texts: Should the Update Manager module be uninstalled when installing with Composer?

texts:
Drupal 8 is installed with Composer and I use it to update. So I uninstalled the Update Manager module provided by the core.

Now when I go to /admin/reports/status, I have the following warning.

Should the Update Manager module be uninstalled when Drupal is installed with Composer?


texts: I have a query tagged QueryAlterableInterface that I need to add an item to the IN clause

texts:
I want to alter the term_access query and it's tagged in QueryAlterableInterface. There are items I want to add to an IN clause that's been altered before my module.

I've tried something

$query->condition('ga.gid', $new_items, 'IN');

But that just adds a new db_placeholder_n to the arguments array without altering the query itself.

Query is:

SELECT DISTINCT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, base.uuid AS uuid, v.machine_name AS vocabulary_machine_name
FROM {taxonomy_term_data} base
INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid
LEFT OUTER JOIN {og_membership} ga ON ga.etid = base.tid
AND ga.entity_type = :entity_type
AND ga.field_name = :field_name
WHERE  (base.tid IN  (:db_condition_placeholder_1)) AND( (ga.gid IS NULL ) OR( (ga.group_type = :db_condition_placeholder_2) AND (ga.gid IN  (:db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5)) ))


texts: Multisite - Put one alias in maintenance mode

texts:
We have one installation (let's call it example.com) with two domains (development.xpto.com and example.com) serving as alias (defined in sites.php) to the main site folder.

We wanted to put one of those aliases (the example.com) in maintenance mode and leave the development domain working np.

What's the best course of action to attain this functionality?


texts: Availability Calendar not working using Views

texts:
I could not find this issue in the issue tracker for Availability Calendar module and I'm wondering if somebody has encountered this issue before.

I set up 'Page' Views for all 'Contents' of 'Property' type using 'Unformatted' list. The page includes the field 'Availability Calendar' and the calendar shows properly on the specified URL location with all the colors and what not. But when you click on a date to specify your booking nothing happens.

I think this is because I am not able to include the 'formlet' in the fields specification. But the 'formlet' has type 'none' on the content type.

Any thoughts or has anyone encountered the same problem before I raise this in the issue tracker?


texts: How can I get Beautytips Module to work with Views field output?

texts: I have uploaded the module Beautytips, and enabled it as usual. I have a content type called Solicitation. From among many fields I have the two main fields (Title and Remarks). I listened to a tutorial video, but it seems it takes one too far than my simple needs. I have a view in which I made the Remarks field to be excluded from view and I followed that field with the title and and I set  option ( Output this field as a link) and I filled the the (Alt text:) with [field_remarks_value] . I have a block view. When I hover on the title I get only ordinary tooltip, while in the setup I selected the Transparent style. I guess I am missing something that I must fill like a selector that I must fill somewhere. Can someone with expertise in this help me. I would be much appreciating.


texts:
I would like to show a list of taxonomy terms and include:

number of nodes that are linked to this term
datestamp of latest node with author and title that is linked to this term

Can this be done in a view, or do I need a custom query?
From a performance standpoint, wouldn't it be better to save that info in taxonomy fields?


texts: It's a way to select by default N/A checkbox

texts:
I want that if a fields is not mandatory the N/A options on select box is ticked by default.

I have tried to tick default value N/A on the field but after the setting disappear.

I use Drupal 7.15.

Cordially


texts: How to create an Orbit slide show based on the zurb foundation?

texts:
I stubbornly tried to create an Orbit slide show based on zurb foundation 6 framework.

I followed all the steps on the instruction page:Orbit Slide Show.

I added everything needed for this type of slide show and included below CSS and Java Script classes in theme library:

motion-ui.css
foundation.css
foundation.js
jquery.js

The template code I used is here: Orbit SlideShow Problem

But unfortunately all images display vertically below each other (one image below another) and the Previous / Next button does not work properly, see below image:

I would be happy to hear what the problem is, share your experiences and guide me to know what is the right way to load that slideshow?


texts: How to cancel installation of my module if requirements are not met

texts:
My module depends on a PHP library (sites/all/libraries/xyz/xyz-library.php). I want drupal to continue with installation only if library requirements of my module are met.

I want something of this kind, in my mymodule.install:

function mymodule_install() {
  if( library_exists() )   return; //continue with installation
  else{
    drupal_set_message(t('Installation failed. Please put xyz-library.php in sites/all/libraries/xyz folder.'), 'error');
    return FALSE; // installation failed
  }
}


texts: Drupal 6: How to create a special case for searches on a limited set of single symbols (such as @ and ! and " and : )?

texts:
For the system I'm creating pages for some symbols have special functions. I have pages/nodes with those symbols as their title. @ and ! especially at issue because they appear in two different contexts (entirely different meaning in each), so there's two pages for each of them '@ (context A)' and '@ (context B)'.

When a user uses the Drupal Search, and searches solely on '@', those nodes should be in the search results. So far, I'm getting 'You must include at least one positive keyword with 0 characters or more.' when searching on the symbols, even after reducing the required word length to zero (I forced cron to run after doing so).

Does Drupal 6 strip out all or some of the symbols from the search text?

After playing with this for a while it occurred to me that since there's very few of these the approach might be to simply create a special case for them in the search. Is there a hook I could intercept in a module to handle the special cases? What's the best approach here? :)

Added Information:

To clarify, 'context A' and 'context B' were merely made up examples. the real thing would look more like: '@ (primitive)' and '@ (prefix)'. A search on '@' should turn up both, since the site has no way of knowing which (prefix or primitive) the user needs to know about.


texts:
I just updated Drupal core from 7.4 to 7.26. After running update.php site stopped working – both public and admin part. When I load it fatal error occurs:

  Fatal error: Call to undefined function _system_default_theme_features() in /[drupal_path]/includes/theme.inc on line 1422

and when I reload it another fatal error apperars:

  Fatal error: Call to a member function getDirectoryPath() on a non-object in /[drupal_path]/modules/image/image.module on line 83

next reload – first error, one more – second. Also, second error is loading much faster.

And one more thing, after applaying update.php I got one failed, I don't know if this is connected:

  media_gallery module

  Update #7009

  Failed: FieldException: Próba aktualizacji egzemplarza nieistniejącego pola media_gallery_media. w field_update_instance() (linia 557 z /[drupal_path]/modules/field/field.crud.inc).

which is something like:

  Failed: FieldException: Attempt to update an instance of a nonexistent field media_gallery_media. in field_update_instance() (line 557 in /[drupal_path]/modules/field/field.crud.inc).

PHP Version 5.5.6

I was trying disabling some modules from db (especially image.module, media_gallery already was disabled), but this did't help.

Any tips where the problem is? Thx in advance.


texts: Does using Views & Panels on every page will effect site performance (speed)?

texts:
I am building a community site.
The site would have A LOT of data on it.

I thought about creating a lot of content pane with views, and use them with panels - for every page.

I will be happy to hear your thoughts about this idea.

It will make my site much slower?
Or it depends entirely on different things?   if so, I will be happy to get more information. I know I need to cache,  but I don't really know how to do that on the user's computers.

Thanks!


texts: Populate custom drupal form in colorbox/lightbox/popup

texts:
I have a drupal custom form and a table attached to form. So when we create a new entry using form, that entry is now shown in table with an EDIT LINK. I want to use a  form populated in colorbox/lightbox/popup when click on EDIT LINK for edit selected entry.

how can i achieve this using any module/custom ?


texts:
I have a website containing different feeds.
Unfortunately I have 1 important newsfeed who doesn't get updated.

I have searched all possible forums, without success.

This is how it shows:
http://www.tri-portaal.be/aggregator/sources/1

Here is the feed it should display:
http://3athlon.be/feed/

I am using drupal 7.43

I think that the problem is not crone related, as all my other feeds do update.

Thank you for the help.


texts:
I have set up my Apache 2.4 on this new Yosemite machine to use vhosts but the clean urls are yielding 404s. The .htaccess works on the 1and1 server and I'm using it in this folder. Reading other SO posts say to enable mod-rewrite and AllowOverride All which I believe I have done. Here is my vhost configuration

This is my working .htaccess that production uses:
For more clarity this is the output of apachectl -M

Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_prefork_module (static)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 mime_module (shared)
 log_config_module (shared)
 env_module (shared)
 headers_module (shared)
 setenvif_module (shared)
 version_module (shared)
 proxy_module (shared)
 proxy_connect_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_fcgi_module (shared)
 proxy_scgi_module (shared)
 proxy_wstunnel_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 proxy_express_module (shared)
 slotmem_shm_module (shared)
 lbmethod_byrequests_module (shared)
 lbmethod_bytraffic_module (shared)
 lbmethod_bybusyness_module (shared)
 unixd_module (shared)
 status_module (shared)
 autoindex_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 php5_module (shared)

I have moved the application folder into OS X webserver and commented out the vhost include statement to ensure that if there is an issue with my vhost it should show up. However, there is a 404 response when drilling down to /user.

What am I overlooking? thx, sam


texts:
How do we set required for new & optional for existing fields - when adding  basic field to content type?

When using Drupal 8 following this how to article shows the steps to take to add a basic field to content types. https://www.drupal.org/docs/user_guide/en/structure-fields.html

What I want to learn how to accomplish is to make the new field "Required" for all newly created content types however for existing content I want the field to be optional.

In the admin I see the required checkbox however this will make all of them required. Below is an image of what I am viewing:

Any & all feedback is greatly appreciated.


texts: Customizing the search results page with Apache Solr

texts:
I have business requirements to do a total overhaul of the Search Results page for our site. Based on the searching i've done so far, I have a few options to adjust the results pulled by the search:

hook_search_page() to alter individual results within a module
Overriding the search results templates (search-result.tpl.php, search-results.tpl.php)
I'm sure there are template.php files

Here are the challenges i'm running into:

I have a custom module (example_search.module) with a hook_search_page() call that does not adjust the actual display of results. It insists on showing the OLs with an "apachesolr_search-results" class, which means any changes i'm making are being ignored. Am I missing anything here?
the tpl.php files, on the other hand work as expected. No big deal there. But I need to adjust how results are rendered.
I also need to adjust the layout of the search results using Context and Delta. I've applied rules using the "Apache Solr" conditions in Context for a custom delta with nothing sticking. Not sure why that's happening.

So in essence, what's the optimal way to adjust results returned by hook_search_page() within Apache Solr?

The code from my search module is below:

<?php

/**
 * Implements hook_search_page()
 */
function example_search_page($results) {
  dpm($results, "Results");

  $output['prefix']['#markup'] = '
';

  foreach ($results as $entry) {
    $output[] = array(
      '#theme' => 'search_result',
      '#result' => $entry,
      '#module' => 'mwb_search',
    );
  }
  $output['suffix']['#markup'] = '
' . theme('pager');

  return $output;
}


texts: Migrate dashboard goes to content dashboard

texts:
I am clicking on "configure" under Modules > Migrate UI and it is just taking me to admin/content. According to the migrate_d2d module page, the migrate module should have a dashboard.

  Enabling the migrate_d2d_ui module will add an "Import from Drupal"
  subtab to the Migrate dashboard

I made sure to give the admin user permissions to use the module and I cleared the caches.

I am using Drupal 7.50 on the site I am migrating data from and 7.54 on the new site.


texts: How can I randomize search results in Views?

texts:
It seems like the simple answer to this issue would be to select Global:Random from the Sort Criteria, but choosing this results in a selection of Global: Random (asc) -- the asc being ascending.

And indeed the results are displayed as ascending instead of random.

How can this be corrected?


texts: What is an allternatve approach to many fields in an entity?

texts:
I have an entity bundle 'A' that has about 30 fields in it.
This is probably affecting the page load performance of any view requiring to load these entities.

As an alternative, I was thinking about putting a number of the entity fields in a separate entity bundle 'B' which is connects the entities to bundle 'A' with an entity referenc field.

Would that improve performance or is there a better solution.


texts: Redirect from within controller always goes to home page

texts:
I have a custom module named rsc.

My Default 404 (not found) page is set to /page-not-found in Basic site settings.

My rsc.routing.yml file contains

  rsc.pageNotFound:
    path: '/page-not-found'
    defaults:
      _controller: 'Drupal\rsc\Controller\rscController::pageNotFound'
      _title: ''
    requirements:
      _permission: 'access content'

My rscController.php file contains:

  class rscController extends ControllerBase
  {
    public function pageNotFound()
    {
      $path = '/test-page'; // Just for testing

      if (($url = \Drupal::service('path.validator')->getUrlIfValid($path))) {
        $route = $url->getRouteName();
        $param = $url->getRouteParameters();
        error_log("route=$route param=" . print_r($param, true));
        return $this->redirect($route, $param);
      }
      else {
        return
        [
          '#markup' => 'No such page'
        ];
      }
    }
  }

/test-page is the alias for /node/125.

If I type mywebsite.com/junk in the address bar (to force the not found page to be invoked) and press Enter, I am always redirected to the home page, even though the error log contains the result

route=entity.node.canonical param=Array
  (
    [node] => 125
  )

What am I doing wrong? Why doesn't $this->redirect() take me to the node?


texts: empty ajax block not loaded on cached page

texts:
Drupal 6 user.
I came across interesting problem: I would like to use ajax block on cached pages on my webshop. The block would display some products which other customers have bought along with products inside current customers cart.
The tricky part is that this ajax block is initially empty, so after warming all pages in cache, this block is not rendered by drupal. Which means that ajax can not be working with this block.

My question is: how can I render the block even it is initially empty? The block is made in views, I tried to add attachment displaying some data, so there would be some content inside the block, but the block is not rendered anyway.

Thank you for help


texts: Attach term id to block or webform to display on a filtered page

texts:
I think this is  a simple problem but I cannot find the answer/module/snippet or whatever.
I have a page which displays content with a certain taxonomy term

www.website.com/#filter=.contact

How do i easily add a term to a webform? So it will display on the contact page.
(maybe via a webform block)


texts: How to hide fields by default with webform-7.x-4.0-alpha6

texts:
How do I make conditional fields work properly with webform-7.x-4.0-alpha6 ?

Expected behaviour : I created a webform content with a radio button field called "Assurance" (yes/no). The wanted behaviour is : when the assurance value is not "yes" hide a fieldset called "assurance information". By default "Assurance" has no value, so "assurance information" has to be hidden.
Unexcpected result : Currently my problem is that "assurance informations" is visible by default, and when i click on Assurance whatever the value is "assurance informations" disapear and never appears.

Can anybody find a clue ? thanks in advance.


texts: How do I create a View filter by a parent taxonomy term?

texts:
I've got a taxonomy that is set up as such, which I am using with Taxonomy Term Templates:

Manufacturer>>Model>>Colour

Eg:

Honda>>Accord>>Red

I'd like to create a View that displays all siblings of a Taxonomy, eg if I am on the Accord page I'd like the view to return other Honda models (eg: Civic, CR-X, HR-V, Odyssey).

I've tried using the %term:parent as a contextual filter, but have had no luck - no results display.

Would anyone know how I might go about this?


texts: Adding an information icon to a form element

texts:
I currently have a number of form elements that I have added an image icon to, which users can click on or hover over for more information... which looks like this:

(The blue image icon is the one users hover over for more information)

When defining the component via render arrays like so:

$component[$this->componentName] = array(
  '#type' => 'textfield',
  '#title' => t('Project Name'),
  '#description' => t('Enter the name of the project'),
  '#description_display' => 'before',
  '#required' => 'True',
);

Is there away to get the image icon to sit along side the element (either the title or the description or the textfield), for example like this:

I am aware that there is the potential to use something like the #attributes tag to add tooltips too (as outlined below), but wondered whether there is scope to add the image icon as I am attempting?

'name' => array(
  '#title' => t('Name'),
  '#type' => 'textfield',
  '#size' => 30,
  '#maxlength' => 45,
  '#default_value' => $item->Name,
  '#attributes' => array(
    'title' => t("Item's name, no longer than 45 characters."),
  )
),


texts: Access denied when user tries to edit his Content Profile

texts:
I’m having a strange problem on one of my Drupal sites running Drupal 6..

I’ve the Content Profile module installed and using Tab Tamer to create some tabs on the “My Profile” page where one of these tabs is “Edit my Profile” which directs to domain.com/user/uid/profile/profil

It works fine for me as Admin, it works fine for other users that are just regular registered users, but for one user both the “Edit my profile” tab is gone and when I try to manual enter the URL I get an access denied. I can’t seem to find anything different about the particular user when comparing to other registered users.

I’ve googled the problem and found that there is (or at least has been) some issues about the permission in the Content Profile, but since it works for everyone but this user I’m not sure that whether this is a bug in the permissions with the module or there is some strange other permissions that denies this user access.

I tried to change to users role to administrator, and then he has access to editing his profile – but when changing it back, same issue occurs.

Does anyone have similar experience or a solution for this problem?


texts:
I am pretty new to drupal php etc.

I have a module that just add links to main menu and load a .html and a .js when a link is called.

For now my menu looks like this:

Demo

Now I would like something  like:

Demo
More demos

extra demo1
extra demo 2

Ideally "More demos" should be collapsed and should expand on click

Here is the code I have so far:

<?php

/**
 * Implements hook_menu()
 */
function kl_menu(){
  $items = array();

  $items['demo'] = array(
   'title'            => t('Demo'),
   'page callback'    => 'build_demo_page',
   'access arguments' => array('access content'),
   'menu_name' => 'main-menu',
   'type' => MENU_NORMAL_ITEM,
  );

  return $items;
  }

/*
 * build_demo_page
 */
function build_standard_demo_page() {
drupal_add_js(drupal_get_path('module', 'kl') . '/demo.js', 'file');
 return  ( file_get_contents( drupal_get_path('module', 'kl').'/demo.html') );
}

I am not sure to go from there.

Thanks


texts: Creating a shortcut to a listing of a specific content type or a set of specific nodes

texts:
I want to create a shortcut that acts similar as when you click the "Content" link. But I want to be able to display only a specific content-type or probably a specific set of nodes.

Is this possible weather by coding or through a module?


texts: What's the best way to maintain templates for standard pages and a front page?

texts:
I’m developing a new Drupal 6 theme with a custom front page. My standard page.tpl.php has the entire HTML structure (as it should), including the doctype, HTML head, and HTML body.

When I make page-front.tpl.php, though, I have to duplicate page.tpl.php and modify it, meaning that whenever I need to make changes to the standard page template (add Javascript, modify CSS, etc.), I have to replicate all those changes in the front page template.

What’s the best way to avoid all this duplication? What’s the best way to keep the main page structure uniform? Create a custom function that spits out the HTML head? Put everything in separate PHP files (header.php, footer.php, etc.) and include them in the two template files?


texts: How to make metatags output proper images urls

texts:
I'm tring to create set of open graph tags for better sharing of my page. Unfortunatelly I cannot make Metatags output proper path to images attached to nodes. I have node with field_promoted_image. In metatags configuration I put:
[node:field-promoted-image]
[node:field-promoted-image:file:url]
[node:field-promoted-image:file]

but all I get is field name or file name but without proper path.


texts:
I want to set a breakpoint in xdebug to debug an interesting issue the site is having regarding user access to certain nodes. My question is where do I do that in D8? Where, specifically, is the D8 replacement for user_access to be found?
Not using any form of node access, but am using Group and Content Moderation. The problem could lie with either of them, but I thought the best approach would be to break where Drupal decides whether a user has access to node/###/edit, then step from there.
The problem is that the user's role's permissions give all node and content moderation permissions for the applicable content type. Yet, when going to the admin/content page or admin/content/moderation, given two nodes of the same content type authored by a user of the given role, with the same node and moderation status, only one has an edit button. In viewing the nodes, only one has an edit link.
I have rebuilt permissions, to no effect.


texts: Is there a "best practice" for overriding a contributed module's controller in Drupal 8?

texts:
I'm still relatively new to Drupal 8 and recently I came across an occasion to override the WebFormSubmissionListBuilder Controller.

I eventually found another project which had exactly the same need and they did it as below:

<?php
/**
 * Implements hook_entity_type_alter().
 *
 * @todo This alters all webform_submission entites but should alter only the ones in configured workflows.
 */
function academic_applications_entity_type_alter(array &$entity_types) {
  /* @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
  $entity_types['webform_submission']->setListBuilderClass('Drupal\academic_applications\WebFormSubmissionListBuilderOverride');
}

While this works I can see it being a real problem if more than one module tried to override another module's controller this way. However, I couldn't find a better way so I ended up using their method for now.

Is there a known or "best practices" for doing this? I don't see any obvious plugin points in the WebFormSubmissionListBuilder controller's code so taking it over seems to be the only way to extend it as far as I can tell.


texts: Drupal 7 node save gives intermittent token validation error

texts:
When submitting a content type node I'm occasionally seeing a form validation error regarding tokens being invalid.

I've tried reducing the token tree depth too using Token Tweaks which helps on token list viewing, but makes no different on form submission and validation process.

What other causes could be at play with the form token validation flow in Drupal 7 ?


texts:
In my theme_preprocess_taxonomy_term function I am loading a node.
Then want to move its "body field" to the content array of my template.

    mytheme_preprocess_taxonomy_term(&$variables){
        $import_content_node_id = 32;
        //load node
        $import_content_node = $node = Node::load($import_content_node_id);
        variables['content']['body'] = $import_content_node->getFields()['body'];
}

This does not work because variables['content']['body'] is NOT a render array.

But from where I get the render array?
Or how do I create one from an by script loaded node?


texts: Simple category with drupal commerce not showing to anonymous users

texts: I followed this guide https://drupalcommerce.org/user-guide/setting-product-catalog and now I have a nice simple category page, but not visible to anonymous users. I tried changing the roles to marking all three options but no luck.. Any suggestions?


texts: How to limit the number of comment a user can post?

texts:
I have a content type where users can post reviews or comments.
I want to achieve this with the comment module and not by creating another content type and using node reference.

So I want to limit the number of comment a user can post per node for a specific type of content type.

Again I also have other content types where I have given the users the option of commenting on article, and that can have multiple comments and replies.

Can anyone suggest me how to achieve this?

Can I do it through rules(I haven't tried yet)?


texts:
How can I use Drupal node title as URL Permalink just like wordpress %postname% ?

or even change the "node" from example.com/node/id ? (Drupal 6)


texts: How to use URL query parameter on a View Exposed Filter?

texts:
We have a View which has the following settings. How can we setup the view to use a query parameter from the URL to filter the results?

Article Content Type (fields):

Title
Body
Category (field_category) --> taxonomy
Type (field_type) --> taxonomy

View Exposed Filters (values)

Category (All, Security, IoT, Wifi, Network)
Type (All, Blog, Press Release, Breaking News)

Desired output:

When the URL is www.mysite.com/news?type=Blog, then set filters Type=Blog and Category=All to return results of all Article pages where type=Blog and Category can be any (not null)
When the URL is www.mysite.com/news?type=Blog&Category=Security then filter results to return all Article pages where type=Blog and Category=Security

We tried adding a contextual filter with the following settings only but it did not work.


texts: CKEditor: Images with captions can't be centered?

texts:
Drupal: 8.6.10
CKEditor: 4.10.1

Using the DrupalImage plugin along with the data-caption and data-align filters I am able to float images left and right, but never centered if the image also has a caption.

My image code in CKEditor:

The produced HTML:

Woot, a caption!

The problem is the figure is still block level and thus 100% width of the content area. The result.

It is centered in the editor itself, before I save it, and I noticed
 has a class caption which applies display: table.

However looking at the FilterCaption plugin, it appears to be doing what it is supposed to.

What am I missing? Why is the figure 100% and not the same width as the image, so it can be centering using align-center class that it has (and presumably is supposed to have)?


texts: Hide fields from "address_field Module" form

texts:
I have a site using Profile2 with address_field Module; and I would like to prevent users from filling out the follwing fields:
Address 1
Address 2
ZIP Code
Country

The goal is is only to be able to fill only CITY AND STATE; (e.g. Orlando, FLORIDA)

Thanks.

J.M.


texts:
I want the user defined webform to be popped up in an overlay when a button is clicked. I am using colorbox and colorbox-node modules. I am able to display the whole node. But I am not understanding how to display just the webform instead of the whole node. I used the following code:

 <a class="colorbox-load" href="enquiry?width=600&amp;height=600&amp;iframe=true"><input value="Send Enquiry" type="submit"> </a>


texts: How to insert table view inside another view?

texts:
I have created a View and two display blocks inside the View and set the format to table on each.

like this:

I will display these two tables at the front page. Now I need to write a common  for both tables

For this may I need to use table view inside another view?

My tables looks like this


texts: How to find non-existing terms based on the list?

texts:
I've few thousands terms in my vocabulary. I'd like to find out which one still are missing (without adding them) based on the list of term names.

I believe this can be achieved by some anti-join sql query, but any solution would be fine.

How this can be achieved?


texts:
Since most of my d7 users will authenticate somewhere outside Drupal itself, I need to disable "/user" path for most of them (not uid 0 of course).
What is the best approach we have here?


texts: Difference between field form hooks for settings

texts:
I created a field for my module and now I want to create settings for this field.

Now I found four hooks:

hook_field_settings_form
hook_field_instance_settings_form
hook_field_widget_settings_form
hook_field_formatter_settings_form

What is the difference between these hooks?

I think "formatter_settings" is for settings to change the later display of the output on the entity. Right? And the other hooks?


texts: Views : how to combine fields in exposed filter using is between operator

texts:
In a view showing commerce products, with exposed filters, I need to make a slider filter for commerce_price field. This is easy with exposed filters (is between operator) and BEF module, but ...

commerce_price field is retrieved in the view by its relationship to Product variation type, and I've got 2 different Product variation types for the same product display :

  And

This means you can make a slider for each one, but this makes no sense for end-user to have 2 prices slider !

And by default Views 3.x  Global: Combine fields filter doesn’t provide "is between" operator, it only works with strings and operators like equal to, begins...

How can I filter the values of both relationships in a single slider for that Price field ?
Is there a Views setup way or a module to do that? If not, how can I add a custom filter to my view using API ?


texts: How to use Rules to disable access to selected fields while editing an existing node?

texts:
Based on couple of features I require to restrict/disable access to certain field based on other fields while editing the node.

The problem is that in Rules module, there's no "While editing an existing node" event.

What I want is to set an action for the user while editing the node.


texts: Cannot assign calculated value to user field in Rules

texts:
Here is the situation and what I want to do:

Users have a "days left" field of type integer.
A user will set a date range while creating a "time off" content type.
When he hits the save button, a rule will intercept, subtract the date range from his "days left" field and save the result as the new "days left" value.

here is what I have done:

user clicks save button rule intercepts
action - gets the duration and divides it by 86400 (to convert it to days from seconds)
action - converts the result to integer
action - subtracts the converted value
from content authors "days left" field.

At this point I want to assign the result of the subtraction to the author's "days left" field. The node:author:field-days-left variable is available and I select it. But the result of the subtraction is not.

I also tried to convert the result of the subtraction to integer and then assign it, but it did not work too.

Any ideas why?


texts: Arguments in url break other view on same page

texts:
Whenever I go to a url that has parameters in for example www.sitename.com?page=1

It breaks another view that uses contextual filter and looks like this

Why is this happening?


texts: User uploads media and community votes: How do I implement them?

texts:
I am a graphics guy who can fumble through code, but not write it from scratch. I have developed a NUMBER of sites, but this is my first Drupal experience. I've read all the starting documents, been playing with Drupal for DAYS now; I have even installed and modified different modules, so I'm somewhat familiar with it and the concepts (nodes, vocabularies, etc).

I have installed Drupal 7.2 on MDD Shared Hosting. I am looking to build a community site (actually a NUMBER of them very similar to this one once this is completed). They are very similar to these sites:
- colourlovers.com
- instructables.com
- gdgt.com (somewhat).

The concept is that the users will upload various pictures/video & a description to a page, and then the rest of the community will be able to 'like' it (not in a Facebook way, though). The pages with the most 'likes' will appear in the home page and various search/sideboxes (top rated by time/date, newest, most viewed, etc). For example, a user uploads a video and/or pictures of some artwork. He'll write a short statement about it and 'publish' it to the community. Once published, other users will be able to see it, comment on it, and rate it if they choose to. There are different categories for each type of upload (vocabularies, etc), as well as tagging, comments, etc.

Users can also 'follow' their favorite members to easily keep track of any new pictures/media they post, comments they make, etc. It would be fairly similar to the sites mentioned above.

My problem is that I just don't get where/how to go about doing this. I have designated various vocabularies, installed a few different gallery modules. I really don't think I want a gallery for this, as each 'project' a user uploads will be separate from all the others they upload (but it can still be found/visible in the author's profile page). Is there a module that pretty much does this functionality?  Alternatively, is there a key concept that someone could explain to me on how to handle something like this? I could even pay a little bit to have someone set it up for me. However, I want to learn how to do it, so I can maintain the site later and build future sites in the same way.


texts: Are there any working Form Modules in Drupal 8 yet?

texts:
Webform doesn't work yet. Eform won't send emails yet (because rules isn't ready yet). Drupal's built in Contact form sends an email but doesn't save the entries or let you redirect to a thank you page.

Basically I need form builder that saves the results and sends an email - like webform in D7

Is there anything I'm missing or do I just have to wait?


texts:
I have created a content type named Ranking and also created a field rank this content. If I give rank 1,2,3 and so on.

Content should display according to rank, the content with rank 1 should show at first position and so on.

Any idea how to perform this?

Note: I'm using the Views module.


texts: Unable to render fields in node.html.twig

texts:
I'm trying to get individual fields printed on my node template, but am unable to get anything other than {{ content }} to work.

I'm using 8.5.0 and I'm not seeing any errors in the log. The page renders my markup so I know the template is being called.

Here's my node.html.twig markup:

    {%
     set classes = [
    'main-article',
    'main-article-page',
    ]
    %}
    {{ attach_library('classy/node') }}

    {{ content.field_image }}

    {{ content.body }}

Perhaps I've missed something in the setup of my theme?


texts: How to alter a function in a contributed module?

texts:
I am using a module Simple hierarchical select in my website.

I have a taxonomy in which I have some parent terms and there children terms, I am getting two select list with this module. In one select list I am getting all parent terms, and the module is filtering the second select list as per the parent selected, showing children terms of parent term selected in select list 1.

I need to add some condition to the values I am getting in the select lists to alter this function shs_json_term_get_children using custom module.

The function declaration in the module is:

  function shs_json_term_get_children($vid, $parent = array(), $settings
  = array()) {}

So I tried using:

  function hook_shs_json_term_get_children_alter($vid, $parent =
  array(), $settings = array()) {}

and

  function hook_shs_json_term_get_children_alter(&$vid, $parent =
  array(), $settings = array()) {}

but neither worked.

Any suggestions?


texts: Migrating Content from Blogger and Google Sites

texts: I might be working on a project that would require me to transfer content from Blogger and Google Sites into Drupal. I was looking at Google Sites Liberation and using Blogger Importer for the Blogger portion. My concern is getting the XHTML from Google Sites Liberation imported into Drupal and images transferred in from both Google Sites and Blogger. Does anyone have suggestions for a good way of migrating the content from Blogger and Google Sites? Thanks in advance for the help.


texts: Taxes not updated after manually adding a product to an order. Drupal Commerce

texts:
Using Commerce 7.x-1.10.

I created several tax rules to fit different countries. All of them works fine through the checkout process.

The problem is that if I (as admin user) manually add a product Line Item to the order at: admin/commerce/orders/ORDER-ID/edit, then the taxes are no re-calculated.

I already enabled the option: Enable the local action link on order edit forms to apply pricing rules. in this admin page: admin/commerce/config/order. Loop my capture bellow. I expected to see a link in the edit order form, but I see no link there. What's the goal of this feature??

To reproduce:
1) an order is created
2) as admin user I go to `admin/commerce/orders/ORDER-ID/edit`
3) add a new product to the order
4) save
5) the taxes are not re-calculated

UPDATE 2: changing the order status didn't work for me: https://www.drupal.org/node/1094266#comment-4269794, https://drupalcommerce.org/questions/4302/rules-not-firing-during-admin-order-editing


texts: I just want to add a radio buttons to my content type

texts:
I am creating a new content type in Drupal 7 and I would like to add some radio buttons as content types.  This is surprisingly difficult to do.  I have enabled field and options modules but I have yet to see radio buttons show up as an option for numeric or text fields.  How do I do this?

Update: I do not have 'select option' or 'list' as a select-able field type


texts: How to implement a reputation based system with badges in Drupal similar to StackExchange sites?

texts:
Earning badges on StackExchange is, well, fun. But aside from that it promotes quality interaction from users and helps weed out spam (I have never seen a spam post on the site).

I have a community website with about 500 active users, but the spammers are starting to become more prolific.

I would like a way to make the site more engaging while promoting the same quality of interactivity.

How would you recommend to put in a good reputation system, as well as a goal achievement system?


texts:
My Drupal 8 site occasionally (maybe once a week) gets a redirect loop for an url. The redirect sends a 301 Moved Permanently for that url to the exact same url; not even a to and fro redirect loop. Clearing the Drupal cache will fix the problem.
It is not always the same url - it seems pretty random.

I'm including the full anonymized http response:

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 13 Jun 2017 11:41:56 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/7.1.5
Cache-Control: must-revalidate, no-cache, private
X-Drupal-Route-Normalizer: 1
X-UA-Compatible: IE=edge
Content-language: nl
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Expires: Sun, 19 Nov 1978 05:00:00 GMT
X-Generator: Drupal 8 (https://www.drupal.org)
X-Drupal-Cache: HIT
Location: http://www.domain.ext/lang/parts/of/url
X-Powered-By: PleskLin
MS-Author-Via: DAV
Content-Length: 488

<!DOCTYPE html>

        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="1;url=http://www.domain.ext/lang/parts/of/url" />

        <title>Redirecting to http://www.domain.ext/lang/parts/of/url</title>

        Redirecting to http://www.domain.ext/lang/parts/of/url.


texts: I'd like to add a new taxonomy term and assign the node while adding or editing the node. I don't want to use any of third party modules. I'd like to do it by myself in code. Maybe some of you have faced this problem. Anyone know how to do it?


texts: Pass node id to custom access denied panel page and/or view pane

texts:
Rather than display an "access denied" page, I want to over-ride the standard 403 with a panel page that contains several views which take the original node id as a contextual filter.

I can create a view which handles contextual filters easily.
I can create a panel which over-rides the standard 403 with custom message.

However, there is no panels context that allows me to pass the original node id into the view, and the view doesn't get the "Content ID from URL" because the url passed to the view is "access-denied". PHP code in the panel confirms that when outputting $_GET['q'] and arg() using a custom content with PHP filter.

$_SERVER['REQUEST_URI'] DOES return the original path with the node ID, which I can parse, but I still don't know how I could pass that as a context to the view.

What is the best way to I pass the originally requested node id to the panel, and how do I pass that as context to the view? Alternatively, how can I directly pass it to the view, if doing through panels is not possible.


texts:
I have a content view of user images. They have a 'flag user' flag attached to them. I suppose it all works just the same if I had the user flag in the user page.

I wanted to create a block view (or page) that shows who has flagged a logged-in user when that user is viewing their own profile.

I have tried every relationship under the sun. I alwasy seem to end up of a list of users the logged-in user has flagged, not the other way around.

Could anyone help put me out my misery?

I am using the latest releases of the Views and Flags modules.


texts: How to display uploaded files as images in Views?

texts:
Is it possible to display uploaded image files (not File Entities or Image Fields) as images inside a View? When I create a file View I can either choose to format it using fields, which allows me to display the file name etc, or as a rendered entity which does not display anything at all. I would like to be able to display a list of uploaded images via Views, as oppose to a list of file names. Can this be done?

Here is why I am trying to do this. I have CKEditor module enabled and I am using One Click Upload module to allow users to upload image files into their text areas. I have tried using Media and File Entity with CKEditor but they were very unstable and caused a great deal of database errors on my website. I also prefer One Click Upload's minimal interface, as the name of the module implies. The problem of course is that One Click Upload does not use File Entities or File Fields for uploading, which is why I am trying to work out how to format the files in Views to show up as rendered images. Is this possible?


texts: From my child theme, how can I remove a library loaded by the parent theme?

texts:
I have hit an issue which I think is quite unusual or peculiar when settingup a child theme.

A commercial parent theme I have bought loads the Slick library like this in its theme.libraries.yml:

slick:
  version: VERSION
  css:
    component:
      css/vendor/slick.css: {}
      css/vendor/slick-theme.css: {}
  js:
    js/vendor/slick.min.js: {}

But I don't want the Slick library to be loaded by the parent theme because I will be installing the Slick module, and will be using Slick Views. I found the Slick library loaded by my parent theme was (of course it was) conflicting with the same library loaded by the Slick module.

My idea is somehow in my child theme's childtheme.libraries.yml file override and tell Drupal to ignore the instruction by the parent theme to load the Slick library. If that is not possile, then may I do that in my childtheme.theme file?

The only workaround I could find so far was to hack the parent theme and comment out the lines where Slick library is loaded, but I know this is a bad practice in case I need to update the parent theme in the future for some reason.

What is the best approach for this problem? Thank you.


texts: Select Panel Node Layout on Node edit form

texts:
I have multiple different layout variations all for the same node type, is it possible to select which one will be used from the node edit form?

For example I have a node type of product which has the following layout variations:

2 Column
3 Column
2 Column Hybrid

On the node edit for I would have then have a drop down (or something else) which allows me to select one of the variations listed above. Is this possible?


texts: How to disable the first option of select form element

texts:
I created a custom module that contains a form with select element
I tried to disable the first option like this, but failed to get it work

'#options' => $terms,
                '#empty_option' => '- Select category -',
                '#empty_value' => 'none',
                '#disabled_values' => array('none'),

How could this be achieved without removing the option?


texts: Drupal 7: Custom content types become un-editable and do not output correctly

texts:
I've had the following problem a few times and can't find a satisfactory answer to it anywhere.

I create a new content type
add content for this new type
then, when the system displays the finished content after save, all of the new fields are missing (yes I made sure they were set to 'display' in the manage display tab)
on editing this new node, none of the fields display, all I get is the node title field and the tabbed options (eg comments, create version, menus etc)

I've read that this is caused by a permission problem. That sounded good, so I checked the permissions after creating the new content type and sure enough, there were no boxes checked for the new content type.

I checked all of the boxes for the admin role for the content type and still nothing. I've rebuilt the permissions and cleared the cache. Still nothing.


texts:
I ma trying to add foundation classes to my #user-register-form fields in D7

  Username *
 <input class="username form-text required" type="text" id="edit-name" name="name" value="" size="60" maxlength="60">

Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.

I have tried using template overrides like I have with my other custom fields

field--field_homepage_body.tpl.php

But with no luck any help would be appreciated.


texts: Preferred way of loading a specific entity revision

texts:
In drupal 7 you can do this to load an entity revision using

entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)

like this:

$old_revision = entity_load('node', array(), array('vid' => 123));

However now $conditions is being deprecated.
Pretty much wherever you go you see people saying that you should use EntityFieldQuery instead of conditions, however that doesn't help in this case.
You can use age() to query revisions using EntityFieldQuery however it doesn't give you fully loaded node results so you then still have to load the entity and how do you load that revision of that entity without the conditions.


texts: Inform user with account creation email, for existing users to

texts: Is there a way(It doesn't matter if passwords need to be recreated/generated) to send all the users an email about there account being added to the website after they are already added?


texts: In the OG API, which hooks are available when a group admin adds or removes a user from a group?

texts:
Question:

In the context of Organic Groups API, is there a hook that fires when an group administrator adds or removes a user from the group (or when a user self joins or self-removes their account)?

Ultimately, I was hoping for a hook that was fired around og_group() and og_ungroup() as that's how I best understand the API so far.


texts: Is it Possible to Change "Edit Permissions" Based on a Field Value on that Node?

texts:
I have users that need to be able to edit a piece of content they created until the status field on the piece content is updated to a particular value.

I've done some research and it looks like there are questions that are similar to mine but different enough that their solutions don't seem applicable.

I realize this question might be vague but I don't know how else to phrase it.

Are there any solutions to my problem?

Edit: I am using Drupal 7.


texts: How do I use an HTML5 element for my field widget?

texts:
I have found lots of resources about using HTML5 elements in custom forms (via Form API or using elements module). What's the standard technique which implements HTML5 field widgets (e.g. for a node field)?

For example, I have an "integer" field on node type "article" for which i want to use an HTML5 "number" input type. The only widget available to Fields API for data type number_integer is "textfield".


texts:
I have created a Panels Everywhere variant that uses a single View with a contextual filter (Content Type). The Panel variant is set to page paths. These paths are related to content types. For example:

Path:

drivers (list of 'driver' Content Type)
lawyers (list of 'lawyer' Content Type)

So if I go to /drivers the Context of Content Type 'driver' should be passed to the View, etc. I know this is possible as %user context is a variable object; therefore, I should be able to create another variable object and pass this to the View. The problem is that I don't know where to start :( Any ideas?


texts: Use entity reference to target revisions of an an entity

texts:
I'm building a custom entity document which supports revisions. Revisions are seen as versions of the document (v1.1, v1.2, ...), the title field is revisionable as well.
Then there is a custom entity customer, which needs to accept documents. On creation of a customer, I need to point out which revision of the document is suitable for this customer.
I have an entity reference field on the customer to target a document. However, I'm not achieving to target revisions of a document.
I tried entity reference display in views (with a view that supports revisions) but I'm not able to select it in the field settings (no eligible view found). Probably because I can only select 'Document' as target type and not 'Document revisions'.
I tried entity reference revisions module but gave me the same results. This module just keeps track of changes in parent vs child revisions (I guess).

I would expect document revisions being available in the settings above!

Any suggestions on how to do this properly, am I missing something? I want to make use of core as much as possible for this one.
Update: I ended up creating a custom field plugin to get the required solution.


texts: How can I update text_format value in Ajax callback?

texts:
I have a Drupal 8 form that includes the following fields:

// Comtainer for message fields and preview.
$form['email'] = array(
  '#prefix' => '
',
  '#suffix' => '
',
);

// Template selection drop-down.
$form['template']['template_select'] = array(
  '#type' => 'select',
  '#title' => $this->t('Select template to use (overwrites message)'),
  '#options' => $options,
  '#default_value' => 1,
  '#ajax' => array(
    'wrapper' => 'email',
    'callback' => array($this, 'updateEmailTemplate'),
    'event' => 'change',
  ),
);

$form['email']['message']['subject'] = array(
  '#type' => 'textfield',
  '#title' => $this->t('Message subject'),
  '#default_value' => $params['subject'],
  '#ajax' => array(
    'wrapper' => 'preview',
    'callback' => array($this, 'updateEmailPreview'),
    'event' => 'change',
  ),
);

$form['email']['message']['body'] = array(
  //'#type' => 'textarea',
  '#type' => 'text_format',
  '#title' => $this->t('Message body'),
  '#description' => $this->t('Text for the email body. you may use the following tokens: @tokens.', ['@tokens' => SimpleConregTokens::tokenHelp()]),
  '#default_value' => $params['body'],
  //'#value' => $params['body'],
  '#format' => $params['format'],
);

My Ajax callback function is:

  // Callback function for Template drop down - load message fields with template.
  public function updateEmailTemplate(array $form, FormStateInterface $form_state) {
    $form_values = $form_state->getValues();
    $templates = $form_state->get('templates');

    if (!empty($template = $form_values['template']['template_select'])) {
      //Code here to determine new form values.

      $form['email']['message']['subject']['#value'] = $params['subject'];
      //$form['email']['message']['body']['#type'] = "textarea";
      $form['email']['message']['body']['#value'] = $form['email']['message']['body']['#default_value'];
      $form['email']['message']['body']['#format'] = $params['format'];
    }
    return $form['email'];
  }

So what's happening?

When the user chosen selects a template from the dropdown, the text_format doesn't update.

If I change the #type of the field from text_format to textarea, it will update without any problems, which suggests the callback should work.

I though there might be something in the text editor JavaScript preserving the text_format field from being updated, but if I explicitly set the #value in the form building function, it starts updating in the callbacks. The problem with this is that it also overrides the value when the form is submitted.

Finally, I've tried adding a line to the callback to set the #type to a textarea, and this is also getting ignored. The callback is still getting called, however, because the supbect textbox does update.

Any ideas where I'm going wrong? I'm particularly confused as to why the textarea version works perfectly but changing to text_format doesn't.

James


texts: Reset a form element value through AjaxResponse

texts:
I have an AjaxCallback which returns AjaxResponse(). I need to change some form element properties like (disabled to true, remove some css class etc which works). But I'm unable to reset the particular form input element value to null.

Something like this -

public function calbackfunc(array &$form, FormStateInterface $form_state) : AjaxResponse {

  $response = new AjaxResponse();

  $element = $form_state->getTriggeringElement();

  $element_value = $element['#value'];

  if ($element_value === 'hit') {
    $response->addCommand(new InvokeCommand('.hit-container input', 'attr', ['disabled', FALSE]));
    $response->addCommand(new InvokeCommand('.hit-container div', 'removeClass', ['form-disabled']));
    $response->addCommand(new InvokeCommand('.hit-container input', 'removeClass', ['error']));
    //apart from these steps I also want to set the input value to null.
   }

   return $response;
 }
}

This question is a follow up to the earlier question I've posted Form element replaced via Ajax callback doesn't seem to be submitting or the values are not appearing in buildForm .

I tried like this -

$response->addCommand(new InvokeCommand('.hit-container input', 'setValue', ['myfield', '']));

But no luck. Any help would be great.
Thanks.


texts: External software documentation authoring system and user access permission

texts:
We have a scenario where we would like to integrate an external software documentation authoring system that serves the 'Help' about our software with the current website.

The software users based on their user group permission within the cms should only be able to access the documentation meant for them.

For e.g there is one type of permission set for industrial customers, so if an industrial customer while working on the software clicks on 'Help', he/she should then be directed to this external website to the industry specific documentation. One thing to note that our software doesn't distinguish on different customer type.


texts: Drupal Webform Select 2 options instead of unlimited

texts:
I have a list of 150 products on my select a sample list on my webform. Customers are supposed to select only 2 products, not 3, 4, etc....

I chose "Multiple" so how can I have them select only 2 products from the list instead of 3 or more?

Thanks!


texts: Is it possible to bypass form validation, but still save form data?

texts:
I have an ECK (Entity Construction Kit) form with several required fields. The form contains a series of submit buttons.

The 'complete' button does a regular form submit, triggering the appropriate validation & submit handlers.

The 'save & close' button needs to submit the form & save the data without doing any validation, and this is what I'm having trouble with. I know I can use the #limit_validation_errors property on the 'save & close' button to remove validation, but that also removes the submitted data from $form_state['values'] in the submit handlers.

I tried rebuilding that data in a custom submit handler, re-inserting it into $form_state['values'], and then triggering ECK's original submit handler (which, in theory, should save the data), but that doesn't work:

function my_custom_form_submit($form, &$form_state) {
  if (isset($form_state['values']['no_validation_submit'])) {
    // make copies of the form variables, since they get passed by reference & modified in form_builder();
    $form_copy = $form;
    $form_state_copy = $form_state;

    // rebuild the data to get correct ['values'] in $form_state_copy;
    $form_copy = form_builder($form['#id'], $form_copy, $form_state_copy);

    // place the rebuilt ['values'] into original $form_state & call ECK's submit handler
    $form_state['values'] = $form_state_copy['values'];
    eck__entity__form_submit($form, $form_state);
  }
}

Any ideas for how to achieve this?


texts: Table Pager Rendered in an Ajax Callback Shows White Page

texts:
I have the callback function below that renders a table with a pager. Every page of the table is 20 rows. Below is the code:

function myid_print_all_submitted_id_callback($form, &$form_state){
    $table_html = '';
    $rows = array();

    // Build the sortable table header.
    $header = array(
        'idnumber' => array('data' => t('ID Number'), 'field' => 'idnumber'),
        'student' => array('data' => t('Student'), 'field' => 'student'),
        'status' => array('data' => t('Lacking ID Information | Status'), 'field' => 'status'),
    );

    $query = db_select('student', 't1',array('target' => 'import'));
    $result = $query
        ->fields('t1', array('idnumber','student','status'))
        ->condition('t1.studid', 1 ,'=')
        ->extend('TableSort')->extend('PagerDefault')->limit(20)
        ->execute();

    foreach($result as $record){
        $rows[] = array(
            'idnumber' => $record->idnumber,
            'student' => $record->student,
            'status' => $record->status,
        );
    }

    $table_html = theme('table', array('header' => $header, 'rows' => $rows)) . theme("pager");

    //Build the table
    $form['table'] = array(
        '#type' => 'item',
        '#markup' => $table_html,
        '#empty' => t('Table has no row!'),
        '#prefix' => '
',
        '#suffix' => '
',
    );
    return $form['table'];

}

It looks like the image below:

When I click the next page it shows a blank page:

Where did I go wrong? It was redirected to http://19.46.1.13/myid/system/ajax?page=1, when it must be redirected to http://19.46.1.13/myid/user/1/myid_print?page=2.

I was guessing it is because the table pager was not loaded yet because it was rendered by a callback function. Any suggestions/solutions on how to solve it?


texts:
While upgrading to Drupal 7.39 from 6.37, after copying the new files over into the site's directory, when I tried to navigate to the website I see a blank page with the following error: Fatal error: Cannot redeclare template_preprocess_block() (previously declared in /home2/mccotter/public_html/test/includes/theme.inc:2042) in /home2/mccotter/public_html/test/modules/block/block.module on line 1038

I have not yet run update.php, and when I try to the page appears blank.  I was unable to sign in as the maintenance user, but I set $update_free_access = TRUE.

For reference, the site that I am attempting to upgrade is jailtraining.org/test


texts: Force Drush8 to Download Drupal 8 Module on a Remote D7

texts:
Anyone happen to know, how to force download d8 module to remote d7? I tried doing the following and still letting me to choose 7s.

$ drush @remote.dev dl --default-major=8 composer
There are no stable releases for project composer.                     [warning]
Choose one of the available releases for composer:
 [0]  :  Cancel
 [1]  :  7.x-1.x-dev  -  2013-Sep-30  -  Development, Recommended

$ drush @remote.dev dl composer-8
There are no stable releases for project composer.                     [warning]
Choose one of the available releases for composer:
 [0]  :  Cancel
 [1]  :  7.x-1.x-dev  -  2013-Sep-30  -  Development, Recommended

How does drush detect the version of the remote drupal, where maybe i can edit that real quick an put it back after the download?
Maybe some drush override parameters to forcefully show all realeases?

Any help please. TIA


texts: "Check boxes/radio buttons" Widget is NOT displaying content in Drupal7

texts:
In Drupal 7 Admin, I added a choice field of Type "List (text)" and widget "Check boxes/radio buttons", in which I see the list of check boxes in the Admin.
But I don't see anything in the Live Website (it does not show up)

Below is the code that I am using in the node-view-VIEWNAME.tpl.php page:

<?php if ( render ($content['field_choice']) ): ?>
Choice(s): <?php print render ($content['field_choice']); ?>
<?php endif; ?>

The code above works fine for Fields of Type Text.
How would I modify the code to render the content for check-boxes?


texts: Why does changing date portion of a datetime string on node presave subtract an hour from the time portion?

texts:
I have two datetime fields, one only accepts date input and the other is only accepting time input (via the technique where you set the ['#date_date_element'] = 'none' as described in this answer). In hook_node_presave the date field shows a value like 2018-10-11 and the time field shows a value like 2018-10-11T23:36:01-0400. I'm altering the latter string - I'm changing just the date portion to match the value from my date only field. The problem I'm running into is that, for some reason, every time I save the node the time field goes back an hour, e.g. 10:00:00 to 09:00:00 to 08:00:00. This does not happen when I comment out my code in presave AND it also does not happen on my local machine, only on the remote development environment.
function MYMODULE_node_presave($node) {
  $time = $node->field_time->value;
  $node->field_time->value = $node->field_date->value . substr($time, strpos($time, 'T'));
}

What can be causing this behavior?
(FYI: I'm abandoning this approach and I'm going to use the time_field module)


texts: View in views header still displaying when no result

texts:
I tried this question:
Empty view is rendered even though there is no result

And it didn't work

I have a view of Judge nodes that displays using a contextual filter. Inside that view I have embedded a view block into the header that displays a Featured Judge, passing it the contextual filters and left 'Display even if no results' unchecked. In the Featured Judge view I have set it to not display empty fields. Also I have added a filter to a field as suggested in the question above.

Still I get the following output in the views header:

I have dpm'd the views array in preprocess view, and results is empty. I have set it to NULL and it still displays. At present the only solution appears to be to check if the results array is empty and if so add a class to display: none; which is frankly ludicrous.

Anyone have any ideas?


texts: Is there a way to add meta description to views in Drupal 8?


texts:
I have a product catalog that I would like to categorise into different categories (and subcategories).
I would also like to have a grouping of the products by brands (which of course are orthogonal to the categories).

The ideal thing is that a customer can search for products belonging to a category, and/or to some brand.

Until now I have only managed to create the main categories.
I created also subcategories, but they do not get displayed in the products page, i.e. having something like

CatA

Sub1
Sub2

CatB

If I try to show all the products in CatA only those belonging directly to it (and not to Sub1 or 2) get displayed.

Of course I do not have any idea on how to implements the brands.

EDIT:

I've tried some options in the mean time.
Regarding the brands, I understood it is a completely different taxonomy.
I created it, and associated it with the products and I added a new search facet in the All Products page. Probably I'll need some more advanced stuff in the future, but for now it is ok.

Instead, I'm still struggling with the sub-categories problem.
I watched the following discussion & video: https://drupalcommerce.org/discussions/9017/product-catalog-terms-and-nodes
They do something similar to what I need, but I need to put some modifications.
I do not need multiple pages to navigate the categories.
I simply want that if a user navigates a page like products/CatA all the products in Sub1 and Sub2 are shown.


texts: Programmically displaying imagecache presets no longer works

texts:
I have noticed that recently imagecache no longer displays images when used programmatically. I have seen this happen on an existing site in which it did work at one time and on a new site (that I am currently developing). I am using the command:

print theme('imagecache', 'listing_thumbnail', $node->field_photos[0]['filepath'],
    $node->field_photos[0]['data']['alt'], 'Listing thumbnail', '');

I have tripled checked that the preset name is spelled correctly, the node attributes field_photos are correct so it should work. I have searched high and low to see if anyone else is having this problem but can't find anything. What am I missing? Why does this no longer work?

I am using Drupal 6.25 and imagecache 6x-2.0rc1


texts:
I need to alter the "Webform AJAX" module's JavaScript code.
Is this possible without hacking the module, and risking losing it all upon module updates?


texts: Is it possible to programmaticaly change the HTML rendered by Drupal 7?

texts: Imagine that we have a project completely finished, with lots of modules, themes, etc. Is it possible at all to have a module, which will be called at the last stage, and change the HTML output. For example, we want to make a ereg_replace of a img tag, and we don't want to deep into the modules. Is there a simple hook which can accomplish this extremely simple task ?


texts: How to add a field default to bulk user records

texts:
I've added a field to the user profile page, and set the default. I can see that when I create a new user, the default is set, however for existing users the field is empty.

Is there a way to apply the default to all existing user records?

I've tried View Bulk Operations, but that didn't seem to have an action to update a field.

I'm about to write the mySQL script to update the field, but surely there is a better way........


texts: How to pass an argument to be used in the view called by rules

texts:
Context: drupal 7, views, Rules, Views_rules

Goal: to send an email to all users that have the same taxonomy-term as the newly posted node

Possible solutions known to me:

(1) A Rule calls the view with mailadresses and terms of each user. I would need to evaluate a condition within the view loop, which is possible, using a component of type rule or ruleset that will be executed for each item in the loop. This will be inefficient (give a lot of “skip this”).

(2) Or I could make a view for each term, as proposed in the comments of
How to send out email based on matching taxonomy terms in user profiles?
However, I would prefer to give my users more flexibility then just a few options.

Question: How could I pass the taxonomy-term to be used in the filter-criteria in the view? The view would then only return the records where actually something has to be done (i.e. send a mail to).
Is there a way to  send an argument when calling the view loop?


texts: How to add condition for 1st Iteration in views-view-fields.html.twig file

texts:
I am trying to implement a carousel , inside my views-view-fields--block_1.html.twig , I want to add  active class inside the div for the first Iteration . I have added the code in twig file but every time it is adding active class for all the iteration.

code snippet:

{% if fields.counter.content == 1 %}
{% set tag = "active" %}
{% else %}
{% set tag = "" %}
{% endif %}

In my view title,body,image and result counter fields are there . From result counter i am getting the value and comparing inside the above twig file. Can anyone give suggestion, how to achieve this.

Thanks,


texts: Create a RSS using Views of a content type

texts:
How to configure Views to display a RSS feed of certain content types, which contains several articles?

I would like the RSS to have 1 news feed for 1 content type. How to config it?

I can only set the feed to display all article titles in 1 news feed, which does not make sense.

The sample XML is like this:

<news>

        <title>Some Title Here</title>
        <content><![CDATA[Some Contents here]]></content>
        <pubDate>2011-09-20 10:01</pubDate>

        <title>Another Title Here</title>
        <content><![CDATA[Other Contents here]]></content>
        <pubDate>2011-09-20 11:01</pubDate>

</news>

where the 2 articles above is in certain content type.


texts: Show block for specific content type programmatically

texts:
How can I show a block on a specific content type programmatically? I want in my image the 'basic page' selected.

I used the xxx_block_info() function, should it set in here?