texts: How to package menu links as configuration?

texts:
As a site builder I am looking for a module to package some menu links as configuration. I have looked at Config Menu Link, but it does not seem very active and appears to have some critical bugs. Can anyone suggest an alternative please?

Note: the menu links would mainly be for admin purposes and have known paths. The intention is to simplify updates and add new features to multiple sites sharing the same configuration.


texts: How to orderBy joined table after ordered main in db_select

texts:
I have 3 joined tables - The query search some string on main table then join other by entity_id. I want to orderBy records in order first second third tables result, but no success now. At this time I have order by only for main table.

My query:

$query = db_select('field_data_field_cg_w', 'w');

$query -> join('field_data_field_cg_h', 'h', 'w.entity_id = h.entity_id');
$query -> fields('h', array('entity_id', 'field_cg_h_value'));

$query -> join('field_data_field_cg_g', 'g', 'w.entity_id = g.entity_id');
$query -> fields('g', array('entity_id', 'field_cg_g_value'));

$query -> fields('w', array('entity_id', 'field_cg_w_value'))
  -> condition('w.field_cg_w_value', $options['string'] . '%', 'LIKE')
  -> orderBy('w.field_cg_w_value', 'ASC');

$records = $query->execute();

EDIT:
The result (last part of query) after Clive's answer:

$query -> fields('w', array('entity_id', 'field_cg_w_value'))
  -> condition('w.field_cg_w_value', $options['string'] . '%', 'LIKE')
  -> orderBy('w.field_cg_w_value', 'ASC')
  -> orderBy('h.field_cg_h_value', 'ASC')
  -> orderBy('g.field_cg_g_value', 'ASC');


texts:
I am trying to use Advagg module. All's ok, but unshit.com states that all its css and js files Cache-Control is set more that a year.

In .htaccess

# Requires mod_expires to be enabled.
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
    ExpiresDefault A29030400
    Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
    ExpiresDefault A2419200
    Header append Cache-Control "public"
</FilesMatch>

# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
    ExpiresDefault A7200
    Header append Cache-Control "private"
</FilesMatch>

# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
    ExpiresActive Off
    Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
    Header set Pragma "no-cache"
</FilesMatch>

mod_expires and mod_headers are enabled.

I would be very grateful for any help.


texts:
I have a hook that i wrote to include the elements fields (i.e, telfield) in a webform. The field doesnt take on the same css as the rest of the fields which means I probably need to add a style to the CSS for it. However, I'm trying to figure out a way to implement this globally so that I will be accepted as a regular form component since I have over 40 different themes that this will be applying to.

This is an attempt to avoid having to go into each them and adding the style.

Thanks,


texts: Programmatically removing value from multi-valued field of a content type

texts:
I have a custom content type with a field (id is field_link_to_persona) that is multi-valued text.  In my UI I have checkboxes that correspond to values in that field and if I uncheck the box and save I want to remove the value from the field.

I load the node like this:

$nodes = \Drupal::entityTypeManager()
            ->getStorage('node')
            ->loadByProperties(['type' => 'document', 'nid' => $docID ]);

            $node = reset($nodes);

I can add new values like this:

$node->field_link_to_persona[] = $newValue;

But how do I remove one?  I tried

$node->field_link_to_persona->removeItem($id);

But I keep getting exceptions about the index not existing.

Any help would be appreciated.  I'm somewhat new to drupal so no detail is too trivial :)


texts: How to create a responsive views block in bootstrap?

texts:
I created a content type with one field collection field using Field collection module which accepts up to 4 values.

Field Collection: Field collection field has 3 fields (text1(40 char), text2(255 char), link). I added one content. Now I have one content with 3 field collection items.
View: I created a views grid block. Grid settings > number of columns = 1.
I selected the above field collection item as field.
On the block configuration page, I gave class col-xs-12.

When I visit the page in mobile, I have to scroll to right to see the full content. I gave bootstrap class col-xs-12, why does it not fit into into mobile screen. Can you please help?

Image-1

Image-2


texts: When passing a variable from a render array to JavaScript how do you reach that variable in your Javascript

texts:
I add a variable in the backend to a render array like so (removed superfluous code):
$some_var = 'Hello World';
return [
  '#attached' => [
    'drupalSettings' => ['someVar' => $some_var],
  ],
  '#theme' => 'core_portal_customer_subscription_edit',
  '#data' => [
    'namespace_something' => $some_var,
  ]
];

I would then like to use that variable in my JavaScript but I can't seem to access the drupalSettings.
I tried doing the following but that console.logs undefined.
(function($, Druapl, drupalSettings) {
  Drupal.behaviors.escrowPortalCore = {
    ...
    console.log(druaplSettings.someVar);
  }
}());


texts:
Currently I am building a module by reusing the 'page callback' function in an other module. The data array are successfully rendered. However The presentation is poor.

I suspect that after page callback it doesn't successfully load the theme (probably css?), but I don't know how to do that.

------update------

Here is the code. I add node_add_page from node module to a new menu named 'node/add/add-art'. The data is rendered successfully, however the format is broken. Is it possible to not only reuse the data process function, but also reuse the theme it is using?

$items['node/add/add-art'] = array(
  'title' => 'Add art work',
  'parent' => 'admin/commerce/manage-products/actions',
  'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
  'page callback' => 'node_add_page',
  'access callback' => TRUE,
  'file' => 'node.pages.inc',
  'file path' => drupal_get_path('module', 'node'),
);


texts:
I see only e-mail and textfield, but no URL.

How can I add to my form URL field with the validation rules for URL? e.g.

http://somesite.com

or

somesite.com

or

www.somesite.com

?


texts:
I'm putting this question in the Drupal forum rather than a CSS forum as I don't know if I just have a CSS issue or if the issue is more Drupal, maybe how I'm using the .info file.

I'm using Drupal 7 with UberCart and the AT Commerce sub-theme of Adaptivethemes.
If I put my CSS in styles.base.css they take effect. However, it I put my CSS in a separate CSS then they do not.

I edited at_commerce.info so I have this

// CSS
stylesheets[all][] = css/styles.custom.css
stylesheets[all][] = css/styles.base.css
stylesheets[all][] = css/styles.modules.css
stylesheets[all][] = css/styles.settings.css
stylesheets[all][] = color/colors.css
stylesheets[all][] = css/uc_product.css

I tried styles.custom.css as the first in the list as shown above and the last in the list and it make no difference. styles.custom.css is empty except for the 2 styles I'm trying to put there. When I put the 2 styles in styles.base.css I am putting them at the bottom of the file.


texts: How do I theme a block created with the Views module?

texts:
I'm Newbie user in drupal, i need to custom design theme block created for views module.

Example HTML:

title1

content1

title2

content2


texts: hide certain fields on the edit form of content profile

texts:
I would like to hide certain CCK fields on the edit form of the user's content profile. Showing them without editing is done by a custom page. The problem is that if the user edits his content profile node all fields are displayed.

Already tried these:

field permissions module
content permissions module
profile permissions module

but no one worked as expected..

do you have any suggestions what to do?


texts: Drupal validation for nested field element

texts:
I have written some custom validation for each element in a form. I use the following method to display errors. It automatically highlights the required fields.

form_set_error('field_athletes_male', 'Athletes Male field is required.');

My problem is that there are nested element names like this:

 field_coaching_programme[und][0][field_organisation_delivered_by][und][0][value]

The validation message is shown successfully but the element is not highlighted.


texts:
I'm currently using PathAuto in my project to automatically create aliases for nodes which I'm sure many of you do. But my problems lies with Purl (Persistent url) which is supposed to add a prefix to my url.

For example /blog/some-blog should become /kiosk/<id>/blog/some-blog. The purl provider does this without any issue (I use Path pair) meaning if I go to /kiosk/<id>/blog/some-blog it will show me the correct page, my issue here is that links within the /kiosk/<id>/ context should be rewritten to contain /kiosk/<id>/ to make sure I stay in the same context.

This works, as long the link has not been rewritten by an url-alias.

For example: I have a link inside the blog which refers to another blog post, let's say node/15. If node/15 does not have an alias the link would simply be /kiosk/<id>/node/15. BUT if node/15 has an alias, let's say my-other-blog-post, the link does not contain the prefix.

The link should be /kiosk/<id>/my-other-blog-post but instead becomes /my-other-blog-post .

So my question is, how do I force url-alias to accept the path prefix without removing it?


texts: How to display list of nodes by number in views

texts: I want to put my custom list of ids to views filter but is seems to work only for one id. How can I do it for this list for example (1, 5, 9, 12, 455)


texts: Trying to add a class to a menu in a preprocess function

texts:
I want to add a class to a menu - doing it in hook_menu won't work because I'm adding an icon with the icon API, and this seems to override any classes put on the menu items.

I have this preprocess function:

/**
 * hook_preprocess_page().
 */
function MYMODULE_preprocess_page(&$vars) {
  $vars['main_menu']['menu-1914']['attributes']['class'] = array('message');
}

But it doesn't seem to add the css class "message" onto my element.

How do I reliably add a css class to a menu item before display, but before icon API would display it. Theming has to be my weakest Drupal skill.


texts: Modify the display of one field by the value of another field

texts:
We have a content type with a date range element on our D8 site. I got a request to hide the display of the end date if the content editor decided so.

From testing, the content editor can't delete the end date-- the field fails validation if an end date has already been specified. And anyways, they don't want to delete the end date-- they want to maintain that information-- they only want it not to display to the public audience, in certain circumstances.

I started to approach this by adding a second field to the content type, a boolean checkbox "Hide End Date". I wrote a hook_preprocess_field in our .theme file in order to change the display of the date range value. But after debugging the variables, I realized that the date range field doesn't have any information about the value of the "hide end date" field, of course.

I'm not sure how best to proceed. Is hook_preprocess_node the place where I can look at both field values, and alter the value of the date range field? Will that affect display of the field throughout the site, including views?


texts: Is it possible to create a rule on the event "after saving an existing block"?

texts:
The reason of such a rule would be that there is just one block a certain user can edit. And when he does so, after saving he is redirected to the blocks management page, which he has not the permission to see and manage. So I wish there would be a rule that allows to redirect "after saving an existing block" (combined with a condition of a certain user) to some other page.

I can't find any information about it in the documentation.


texts:
I want to move the drag and drop handle to the other side of a form, to the same location as the row weight selections.  I am talking about the tabledrag handles, as shown below:

I am using Corolla if it makes a difference.


texts: approach custom module userlogin via ajax

texts:
for several reasons I try to develop my own module in order to have a fully customizable user login via ajax. Later on I will integrate this in a modalbox.

I already wrote the basics of the module, the form, as well as a js-file. But I don't know how to go on from here. Concrete questions:

How to login the user in case of success instantly without making a full new http request(asynchron)?
How to validate without reload?
How to fire certain js events in case of login success?
How to improve my existing code?

Enviroment: D7, with plain and unedited starter theme called framework, Devel is the only module I installed.

Thanks in advance, existing code follows right here:

<?php

function ajaxforms_page_build(&$page) {
// drupal_add_js(drupal_get_path('module', 'ajaxforms') . '/js/jquery.validate.min.js', array( 'scope' => 'footer', 'group' => JS_THEME, 'weight' => 20));
// drupal_add_js(drupal_get_path('module', 'ajaxforms') . '/js/additional-methods.min.js', array( 'scope' => 'footer', 'group' => JS_THEME, 'weight' => 20));
drupal_add_js(drupal_get_path('module', 'ajaxforms') . '/js/ajaxforms.js', array( 'scope' => 'footer', 'group' => JS_THEME, 'weight' => 20));
}

function ajaxforms_menu() {

$items['ajaxforms'] = array(
    'title' => 'Ajax Login',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('ajaxforms_basic'),
    'access callback' => TRUE,
    );
return $items;

}

function ajaxforms_basic($form, &$form_state) {

$form = array();

$form['username'] = array(
    '#title' => t('Nutzername'),
    '#type' => 'textfield',
    '#required' => TRUE,
    );

$form['password'] = array(
    '#title' => t('Passwort'),
    '#type' => 'textfield',
    '#required' => TRUE,
    );

if(isset($form_state['values']['username'])) {
    $form['password']['#description'] = 'Test ' . $form_state['values']['username'];
}

$form['password']['#prefix'] = '

';
// $form['password']['#suffix'] = '
';

$form['submit'] = array(
    '#value' => t('Login'),
    '#type' => 'submit',
    '#ajax' => array(
    'callback' => 'ajaxforms_user_login_credentials_user',
    'wrapper' => 'ajaxforms-basic-wrapper')
    );

return $form;
}

function ajaxform_basic_validate($form, &$form_state) {
if ($form_state['values']['username'] == 'KingKong'):
    form_set_error('username', t('FALSCHER NUTZER'));
endif;
 };

function ajaxform_basic_callback($form, &$form_state) {
dpm($form_state);

if ($uid = user_authenticate($username, $password)) {
  global $user;
  $user = user_load($uid);

  $login_array = array ('name' => $username);
  user_login_finalize($login_array);
  drupal_session_regenerate();
}

return dpm($form);
}

And the js:

(function ($) {
Drupal.behaviors.Ajaxforms = {
attach: function(context, settings) {
    var message_field = $('#ajaxforms-basic-wrapper');
    $("#edit-submit", context).once(function(){
        $(this).click(function(){
        var user = $('#edit-username').val();
        var pass = $('#edit-password').val();
        var error = 0;
        // if (user=="") {
        //   message_field.html("Bitte geben Sie einen Nutzernamen ein");
        //   error++;
        // }

        // if (pass=="") {
        //   message_field.html("Bitte geben Sie einen Passwort ein");
        //   error++;
        // }

            $.ajax({
                  url: Drupal.settings.basePath + 'ajaxforms/user-login',
                  type: 'POST',
                  data: {
                    username: user,/** Pass the User Name **/
                    password: pass/** Pass the Password **/
                  },
                  success: function(response) {
                    message_field.html(response);
                    Drupal.attachBehaviors();
                  }
            });
        });
    });
}
};

 }(jQuery));


texts: How to check if field of type reference revisions is paragraph or others?

texts:
I am creating paragraph field programmatically dynamically from array.

The logic for creating a paragraph field is different from others entity revisions.

Is there a way we can identify if field of entity type revisions is paragraph and not others?


texts:
<?php if (isset($custom_links)) { ?>

<?php print theme('links', $custom_links) ?>

<?php } ?>

I've create a custom menu (machine name: menu-secondary-menu). And I want to display it in page.tpl. My condition is to show this this menu only if it has links added. I searched and found the above code. Please help me in customizing to my need.


texts:
I have drupal 6 with mobile-tools module and idrupal theme for iphones. sometimes my website starts displaying mobile theme (idrupal) for desktop, and the only way to return back to normal theme for desktop is to flush all caches.
is there a permanent solution to disallow idrupal theme from being used for desktop?


texts:
I have a module that will be used as a location finder, and it needs to create a table on install that will hold zip codes and their location. That's easy to do. However, I also need to populate that table. Seeing as it's quite a large dataset, and I already have it in a .sql file, I would like to be able to run that file instead of embed the query into the module_install function.

I looked over the documentation for db_query(), but I don't see a way to run a file.

Is this doable, or do I need to pull the database username and password out and run it manually?


texts: Send custom user fields to twig template

texts:
I'm writing my first Drupal 8 theme.

Now for a block I need all some custom fields of the user. So that I can use it in my theme.

I create a theme file with collectionmanager_preprocess_html method.

use Drupal\Core\Session\AccountProxyInterface;
use Drupal\user\Entity\User;

/**
 * Implements hook_preprocess_HOOK() for HTML document templates.
 *
 * Adds body classes if certain regions have content.
 */
function collectionmanager_preprocess_html(&$variables) {
// Load the current user.
$user = User::load(\Drupal::currentUser()->id());

// get field data from that user
$firstname = $user->field_first_name->value;
$lastname = $user->field_last_name->value;

$variables['custom_firstname'] = $user->field_first_name->value;
$variables['custom_lastname'] = $user->field_last_name->value;
}

If I'm correct I can access the variables in twig with {{custom_firstname}}. But it show always a null value. Can someone help me with this? I can't find my issue on this. The variable $firstname and $lastname contains the correct values.


texts:
I have two content type A and B in which B content type node is reference in A content type node. In B content type node there is status field. I want to fetch the A content type node in which the status of B content type node is something.

Can you please guide me how can I use this?

Thanks


texts: Avoid the preprocess/hook function defined from the Zen theme is called for its sub-theme

texts:
We are using a theme that inherits from the Zen theme. the Zen theme implements zen_process_html_tag() and zen_html_head_alter(), and we want these functions not to be called; we tried to override these functions in our theme, but then Drupal call zen's functions first, then the functions in our theme.

How can I avoid this happens?


texts: Drupal equivalent of WordPress' page templates

texts:
I'm developing my first Drupal site, having built my CMS experience on WordPress. I've managed to wrap my head around many of Drupal's paradigms, but I can't figure out how Drupal accomplishes the functionality of page templates in WordPress.

By "page templates" I mean the option in WordPress to set a specific template (written in PHP) to use for a given page:

For reference, I use the templates in multi-site deployments to create standardized pages for subsites (e.g. "contact", "about us"), but a subsite has the ability to disable the template and create their own content.

What would be the best practice to accomplish this?


texts:
Is it possible to search content by date in combined field filter views?

I have created a view in which content title ,content body and content date field is showing of node news type,i have added combined field filter for searching node in views but its searching by body and title but not by date .

What is the solution for this issue?


texts: How to create an RSS or Atom Feed in Drupal (source)?

texts:
I have a website with Drupal 8 CMS and I have a second website without CMS.
I want to create an RSS or Atom Feed on my Drupal site (this will be the source).
I want to display the RSS or Atom Feed on the second site.
How to create an Atom or RSS Feed in Drupal 8 nodes to display it on the second site ?


texts:
I have SQL Query and I want to execute it in Drupal. My SQL Query is like this.

select cat.tid as cat_tid, cat.name as cat_name, cat_parent.parent as cat_parent_tid,
count(deals.nid) as no_of_deals
from
taxonomy_term_data as cat

left outer join taxonomy_term_hierarchy as cat_parent on cat_parent.tid=cat.tid

left outer join field_revision_field_categories as store_categories on
store_categories.field_categories_tid=cat.tid

left outer join field_revision_field_store as deal_stores on field_store_nid=store_categories.entity_id

left outer join (select * from node where type='deal' and status=1) as deals on nid=deal_stores.entity_id

where cat.vid=5

group by cat.tid, cat.name, cat_parent.parent

I converted this query with the help of this module https://drupal.org/project/query_coder

and got the resulted query as

$query = db_select('taxonomy_term_data', 'cat');

$query->addExpression('count(deals.nid)', 'no_of_deals');

$query->fields('cat', array('tid', 'name'));

$query->fields('cat_parent', array('parent'));

$query->leftJoin('taxonomy_term_hierarchy', 'cat_parent', 'cat_parent.tid = cat.tid');

$query->leftJoin('field_revision_field_categories', 'store_categories', 'store_categories.field_categories_tid = cat.tid');

$query->leftJoin('field_revision_field_store', 'deal_stores', 'field_store_nid = store_categories.entity_id');

$query->leftJoin('', 'deals', 'nid = deal_stores.entity_id');

$query->condition('cat.vid', 5);

$query->groupBy('cat.tid');

$query->groupBy('cat.name');

$query->groupBy('cat_parent.parent');

$result = $query->execute();

Now how can I execute this query in drupal, I tried to import this query in views 3 but got some unexpected error, Also I tried to add this query into the block but again getting the same error. I also created a custom block in a custom module that too did not worked. Please help me how can I execute this query. Answer will be greatly appreciated.


texts: How can I add this image plugin, on a new clean/new texteditor?

texts:
When I want to add a texteditor admin/config/content/formats
4 editors; basic,restricted,full and plain are pre installed.

The basic.HTML CKEditor is with image plugin installed

When I create a new text format, the image plugin is not enabled and there is no obvious way to open it. How do I get the image plugin when configuring a new text format?


texts:
I would like to modify the look of a user registration page that I am creating. It contains content profile fields and a recaptcha area. I have created a user-register.tpl.php file and updated my template.php file so that this template file is recognized.

I would like to pull out the pieces of the registration form and place them with specific divs for styling. The problem I am having is that I cannot get the fields. I have tried using

print drupal_render(drupal_get_form('user_register'));

but that creates a white page. When I try to just print drupal_get_form('user_register') I get nothing as well. So I am stumped as to what I am doing wrong. It would appear that the drupal_render command is not returning anything so I can't figure out why that would be.

Here is my modification to my template theme:

function mytheme_theme($existing, $type, $theme, $path) {
  return array('user_login'=>array(
    'template'=>'user-login',
    'arguments'=>array(
        'form'=>NULL),
    ),
    'user_pass'=>array(
        'template'=>'user-pass',
        'arguments'=>array(
            'form'=>NULL),
    ),
    'user_register'=>array(
         'template'=>'user-register',
         'arguments'=>array(
            'form'=>NULL),
    ),
  );
}

This would seem it should work but it doesn't. It is almost like that form does not exist.

I am using Drupal 6.26. Any help would be appreciated!

Thanks


texts: How to filter latest 10 days from the current date in Views

texts: I have created a listing page for News in Views. I wish to filter the news, just to show the latest 10 days from the current date. I wonder how to achieve this through Views.


texts: Is it ok to move the page-title outside of the content div? Or is there a better way?

texts:
I've got a couple of blocks which I would like to appear above the main content area on one particular page...
These two blocks are sitting above 'Main page content' blocks in admin/structure/block.

After enabling the page titles to be displayed, I realised that this isn't going to work, because I still want the page title to be displayed ABOVE these two blocks. So in between these two blocks and the main page content.

Is it ok for me to modify the template so that the page-title is outside of the content div? Or is there a better way to solve this problem?


texts:
Use case: This content type offers an Approval Status with three radion button options, Submitted, Approve, and Reject.

A node from this content type can go through all three in its lifetime.

And that "history" should be displayed at the bottom of  the page.

How do I do this?


texts: How to override some text in the login form located in a block put on a panel?

texts:
I create a subtheme base on bartik theme.

Then I create a panel, and put the user login block to the panel.

I want to change some text in the default user login from.

I find the theme suggestion about how to override block: block--[region|[module|--delta]].tpl.php

So I try to create block--user--login.tpl.php, And try to type whatever word to this file:

111

when I visit the login form, still default, not changed.

I try to clear cache, can not work too.

EDIT:

I paste the follow picture for better explain.

the 111 is a login form block in page, the right form is a login form block in a panel.

this is my block--user--login.tpl.php file


texts:
I'm creating a module that is basically a form but needs to use information from a table in the database to react the some of the button presses. Rather than executing the database query each time the button is pressed in the callback function, is there a way to retrieve all of the information from the database when the module loads and store it in a variable so that other functions in the module can use/access it?

Thanks in advance

Code: An example module that is similar to my current one. I need to use results from the database query in the copy_text function, and as I build the form up the same results in the callbacks for the other functions, so I don't see a point in putting the same db_query in each callback - surely that's just unnecessary querying of the database:

<?php

function playground_menu() {
  $items['playground/form'] = array(
    'title' => 'Form',
    'description' => '',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('playground_demo_form'),
    'access arguments' => array('access content'),
  );
  return $items;
}

function playground_demo_form($form, $form_state) {

  $form['input'] = array(
    '#type' => 'textarea',
    '#title' => t('Input text'),
    '#prefix' => '
',
    '#attributes' => array(
      'placeholder' => t('Enter some text here... '),
    ),
    '#suffix' => '
',
  );

  $form['buttons'] = array(
    '#type' => 'fieldset',
    '#title_display' => 'invisible',
    '#attributes' => array(
      'style' => 'border: 0px; text-align: right',
      'class' => array('container-inline'),
    ),
  );

  $form['buttons']['copy'] = array(
    '#type' => 'button',
    '#value' => 'Copy text',
    '#ajax' => array(
      'callback' => 'copy_text',
      'wrapper' => 'out-text',
//          'method' => 'replace',
//          'effect' => 'fade',
    ),
  );

  $form['buttons']['reverse'] = array(
    '#type' => 'button',
    '#value' => t('Reverse text'),
  );

  $form['buttons']['clear'] = array(
    '#type' => 'button',
    '#value' => t('Clear text'),
  );

  $form['output'] = array(
    '#type' => 'textarea',
    '#title' => t('Output text:'),
    '#prefix' => '
',
    '#value' => '',
    '#attributes' => array(
      'placeholder' => t('Your text will appear here...'),
    ),
    '#suffix' => '
',
  );

  return $form;
}

function copy_text($form, $form_state){
  $form['output']['#value'] = $form_state['values']['input'];
  return $form['output'];
}


texts: Where do these version numbers come from "module-name-1.0-alpha1+13-dev" with plus?

texts:
I've started to work in an existing drupal development project and wanted to do some module updates and found modules with versions like this:

Universally Unique IDentifier 7.x-1.0-alpha3+47-dev
Taxonomy CSV import/export 7.x-5.10+17-dev

I've never seen this before. According to drupal version number guidelines this is not wanted.

Now, our head developer says they never modified any contributed modules and only took them from drupal.org ... Where do that version numbers come from?

Did I miss something?


texts:
I've installed the Ajax comments module.

I am not able to modify comment form. I want to modify the comment form which one is coming when click reply link.

Note: When I click add new comment the form will show subject, name, comment field. In reply option also showing same form. But I don't want subject and name in reply comment form.


texts: tabledrag submit - $form_state missing values

texts:
I have built a draggable table using this tutorial (halfway down page is the Drupal 8 code):

https://www.drupal.org/node/1876710

In the submit function I would like to look through all the rows and create an array for each row. I am using the following code:

foreach ($form_state->getValues(['mytable','rows']) as $tablerow) {

And then running db_update on each item using this:

$tablerow['label']

But this returns an error "undefined index". Is there something wrong with the foreach line?

UPDATE: My table is generated using this code:

  foreach ($entities as $id => $entity) {
    // TableDrag: Mark the table row as draggable.
    $form['mytable'][$id]['#attributes']['class'][] = 'draggable';
    // TableDrag: Sort the table row according to its existing/configured weight.
    $form['mytable'][$id]['#weight'] = $entity->get('weight');

    // Some table columns containing raw markup.
    $form['mytable'][$id]['label'] = array(
      '#plain_text' => $entity->label(),
    );
    $form['mytable'][$id]['id'] = array(
      '#plain_text' => $entity->id(),
    );

    // TableDrag: Weight column element.
    $form['mytable'][$id]['weight'] = array(
      '#type' => 'weight',
      '#title' => t('Weight for @title', array('@title' => $entity->label())),
      '#title_display' => 'invisible',
      '#default_value' => $entity->get('weight'),
      // Classify the weight element for #tabledrag.
      '#attributes' => array('class' => array('mytable-order-weight')),
    );

    // Operations (dropbutton) column.
    $form['mytable'][$id]['operations'] = array(
      '#type' => 'operations',
      '#links' => array(),
    );
    $form['mytable'][$id]['operations']['#links']['edit'] = array(
      'title' => t('Edit'),
      'url' => Url::fromRoute('mymodule.manage_edit', array('id' => $id)),
    );
    $form['mytable'][$id]['operations']['#links']['delete'] = array(
      'title' => t('Delete'),
      'url' => Url::fromRoute('mymodule.manage_delete', array('id' => $id)),
    );
  }

I have run dpm($form_state->getValue(['mytable','2'])); on submit for each of the rows, but only the operations and weight column values appear in $form_state. How do I get the id and label columns to appear?


texts:
I've got a website with lots of content that has been migrated. For each node I've added the original date as the Authored on date. However, search snippets show the date a node was last updated.

I've read the search-result.tpl.php file and can't figure out how to change the $info_split['date'] variable so that it shows the publication date instead.

How can I display the Authored on date instead of the updated date in the search results?


texts: Can't access value of dropdown modified by Ajax

texts:
I have two dropdown fields, #2 is modified by Ajax based on #1 selection. When I try to access #2 value in the submit handler, I get an empty result. I've checked this against the docs and examples and I can't see what am I doing wrong here?

The code:

function admin_select_meeting_type_form($form, &$form_state) {
  $meet_types = get_meeting_types();
  $form['meet_types']=array(
    '#type' => 'select',
    '#title' => t('Select meeting type:'),
        '#options' => $meet_types,
    '#required' => TRUE,
    '#ajax' => array(
      'callback' => 'ajax_select_meeting_type_callback',
      'wrapper' => 'meetlist-div',
      'effect' => 'slide',
    ),
  );
  $form['meet'] = array(
    '#type' => 'container',
    '#prefix' => '
',
    '#suffix' => '
',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save')
  );
  return $form;
}

function admin_select_meeting_type_form_submit($form, &$form_state) {
    drupal_set_message('You selected:' . $form_state['values']['meet']);
}

// Implement ajax update of meeting select field
function ajax_select_meeting_type_callback($form, $form_state) {
     if ($form['meet_types']['#value']) {
        $dispmeet = array(); // truncated for brevity, my array processing is done here
        $form['meet'] = array(
           '#type' => 'select',
           '#prefix' => '
',
           '#suffix' => '
',
           '#title' => t('Select meeting:'),
           '#values' => array_keys($dispmeet),
           '#options' => $dispmeet,
           '#required' => TRUE,
        );
        return $form['meet'];
     }
}


texts:
I am having trouble creating a new View. I am just testing out the module, but when I click "Save" after setting everything up, I receive the following error:

  PDOException: SQLSTATE[HY000]: General error: 1267 Illegal mix of
  collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT)
  for operation '=': SELECT s.uid, c.updated FROM {ctools_object_cache}
  c INNER JOIN {sessions} s ON c.sid = s.sid WHERE s.sid <> :session_id
  AND c.obj = :obj AND c.name = :name ORDER BY c.updated ASC; Array (
  [:session_id] => 3nTvCCvx2_Zopg07JqIBReKxL3TzvilIkwmHjFKZ93o [:obj] =>
  view [:name] => recently_posted_jobs ) in ctools_object_cache_test()
  (line 145 of
  /home1/mt/public_html/mtnet/sites/all/modules/ctools/includes/object-cache.inc).
  The website encountered an unexpected error. Please try again later.

Any ideas why this is happening?


texts: I have a pantheon account and a Drupal site installed on it. I wanted to work on my project via localhost, so I have the WAMP server setup, with the Drupal code and downloaded & imported the Drupal Database. However, I also have pantheon "files". What do I do with these files if I already have the code & database? I downloaded them to my computer in a zip file, but not sure what to do with them or where to put them?


texts: Core patching and version controlling across multiple versions of the same site

texts:
How can I propagate core updates from an installation of a Drupal site to other installations of the same site?

I maintain a private Drupal site which the owners now want to make public. As a result, there are concerns about hacking due to lapses in the core.

In addition, there is a DEV, STAGING and a LIVE version of this site. Nothing makes it to the LIVE site without having being tested in staging and those changes always initiate in the DEV site.

Code changes are only made within the sites/all directory, nothing in Drupal core is tampered with. The changes are version controlled via GIT.
So I push up changes to the sites/all files and subdirectories to STAGING and then the LIVE sites.

This is where my problem begins: how can I patch the core code for the DEV site and propagate those changes to my STAGING and LIVE sites?

I am aware, I can of course apply the patches directly on STAGING and LIVE but those two sites are very tightly controlled by firewalls so they don't have unrestricted access to the Internet like DEV does.

Can I only accomplish this by using more version control and push up core OR is there another way?


texts: how to hide particular comment programmatically

texts:
not sure why:

function MY_MODULE_comment_view_alter(&$build) {
    $build['#comment'] -> status = 0;
}

does not work. It displays comment on the red background, however comment is still visible for all users with 'view comments' rights. What I would like to achieve is simply hide comment so it's not visible.


texts: Install sub-theme without creating blocks

texts: Currently when installing a sub-theme (not sure if this applies to a theme too) blocks from existing themes are copied to the new sub-theme in the Blocks layout section. Is there a way to prevent this from happening? I want to install a sub-theme and then manually add just the blocks I need.


texts: Let anonymous view dpm() when using Omega subtheme

texts:
I need to debug a D7 site from the anonymous user. What settings need to be changed to allow anonymous to view dsm(), dpm(), krumo(), etc. commands?

Note: I have already enabled Access developer information under the Devel module for all roles.


texts:
Am using views to display the comments below my node types in drupal 7.

The view works fine but i can't find a way to hide the regular drupal comments above the form.

How do i just display the comment form and the comments using views.


texts: Automatically turning a profile to unpublished if membership is unpaid and v.v

texts:
I am creating a website for a society, where members pay an annual fee. When members pay for the first time (through ubercart and 2checkout), they automatically receive a user role that enables them to create a member profile. I have set the membership to end a year after they have paid. I have also set up an e-mail reminder to be sent to the member, a week before, reminding them to renew their membership.

I've been playing with rules and relationships in views, unsuccessfully, to answer the following two questions, so I hope someone here has advice.

How do I automatically render the member profile invisible to other members once the payment due date has passed?
Is it possible to automatically render the same invisible profile visible should they renew their membership by paying and if so, how?


texts: Latest tweets from a specific user (bonus: rotating slideshow)

texts:
I want to display the latest 3 tweets on my homepage from my Twitter account for all users. A rotating slideshow of the tweets would be cool and it looks that with the Twitter module it might be possible but I can't get it working.

I have tried Twitter Block (http://drupal.org/project/twitter_block) but that is still under development and it seems the only thing not working with it is display a specific user (which is what I need).

I have searched far and wide, tried and tested a lot of modules and cannot find one that actually allows this. Does anyone have anything to point me at? Tutorial, walkthough, functioning module?


texts: Content types on "Add Content" randomly re-sort themselves

texts:
Does anyone know why sometimes the content types on "node/add" in the admin will list differently every so often?

Example, say I have Article, Job, Page, Product, Resource, Webform. Sometimes they are listed alphabetically (preferred), but I just noticed after creating some content, some of the items are out of order - Drupal 8.2.7.


texts: Perform "Add to cart" through web services

texts:
I am working with Drupal 7 web services.  I created few services on my project but now stuck in the commerce's services.

I could not understand how can I add an item to cart with some line item values through web services.  What will be the json structure ?

The commerce's cart, checkout, review perform many functions through rules and hooks, so are we going to write code for all of those steps in our custom services module?


texts: How do I remove taxonomy links from nodes?

texts:
Lately, I've noticed an interesting situation related to my Drupal site.  When I enter the name of my site in Google's search engine, a list is retrieved with my site maintaining the first position in search results.  When I click the link that says "See more results from .com," it lists my Home page first followed by links to three Taxonomy pages.

/taxonomy/term/1
/taxonomy/term/2
/taxonomy/term/3

When I click the pagination links at the bottom of those taxonomy pages, I am taken to the following link locations :

/category/categories/<category_name>?page=<page_num>

I have nodewords installed to control metatags. I have set the NOINDEX and NOFOLLOW metatags for all taxonomy terms (and for taxonomy itself).

I don't mind using CSS to hide taxonomy terms. I use the taxonomy terms to determine which category to highlight via CSS by using jQuery's addClass/removeClass functions. I need to remove the link surrounding the taxonomy term so that it's not indexed in search engine results. Using jQuery to remove this link is ineffective and the results remain in search engine results. It's my understanding that there is a way to remove the link using the template.php file and the template_preprocess_node(&$vars, $hook) function.

I don't know how to go about doing this. All help is very much appreciated.


texts:
Is there a way to hide menu links on the main menu based on the URL?

For instance, if my URL is 'example.com/undergraduate', the main menu links would be different than if I were to go to 'example.com/graduate'.

This obviously can't be too hard? A module would be awesome.


texts: How can I hide the "day" in a date field?

texts:
I have a date field, but I only want to collect the year and month, not the day.  How can I hide the day part?

There are instructions for Drupal 7, but I am using Drupal 8.


texts: Is it possible to filter content  displayed by the  Views module using a regular expression?

texts:
Is there a way to filter content displayed by Views 3 using a regular expression?

I have a large list (10K items) of content of a custom type on my site and I want to create preset views for my users.  The default views filter is not selective enough.  I need to select with a regular expression such as /M [0-9][0-9]?[0-9]?/ in one of the fields.

Is this possible in some other way, not using a regular expression?

I'm using Drupal 7.  Thanks!


texts: Little ecommerce: 1+ seller, payment via Paypal based on seller configuration

texts:
I need to create a little e-commerce site where I can have more than one seller, but the payments are made via Paypal, with seller's data.

I cannot have different products from different sellers in my cart (and this is OK).

Is there a little e-commerce module for this? I don't want use Drupal Commerce or Ubercart, if possible.

Which module could I use for payments?


texts: Filter a view displaying nodes of one type using a user entity reference field on that node

texts:
I have a vocabulary (Countries) listing all countries. I added an entity reference field to the User entity (Nationality) referencing the Countries vocabulary. To the Article content type, I added:

An entity reference field (article_countries) for the Countries vocabulary
An entity reference field (article_owner) for the users

Currently:

Every user created on the site has the Nationality field set to a taxonomy term value related to Countries
Every article created on the site has the article_countries field set to a taxonomy term value related to the Countries taxonomy vocabulary as well as the article_owner field set to a user
I have also created a view displaying the Article nodes as below:

The view is displaying all articles for which the article_countries is equal to the nationality of the currently logged-in user.

I want to add an exposed filter to filter the list of articles basing on the article_owner value. The filter must only contain all article_owners values referring to users for which the nationality is equal to the nationality of the currently logged-in user.

Finally the view will be similar to below screenshot.


texts: filter with taxonomy-term-alias instead of term-ID?

texts:
I've my view filtered by taxonomy term ID.

http://aelasoca.cat/web/

(in the main menu I've links to taxonomy ID's 3 to 8). How can I filter with the taxonomy term alias instead of it's ID ??

(not sure if it's the same issue as in: Views, Taxonomy, Block and Context... What am I doing wrong? )


texts: Add additional fields to the postal address

texts:
How can I add additional fields to the Address Field module's Postal address field? I would like to add a field for the county.

The default fields for the United States are the following.


texts: EntityQuery condition for multivalue fields

texts:
I need to select some entities that have a certain field (user reference) empty or that field does not contain the current user as a reference.

I tried this, it works ok if the field is empty or if the field contains exactly one value. For multiple values it displays a wrong output:

$query = $this->entityTypeManager()->getStorage('my_entity_type')->getQuery();
$group = $query->orConditionGroup()->notExists("my_field")->condition("my_field", \Drupal::currentUser()->id(), "<>");
$query->condition($group);
$query->condition("type", "my_bundle_id");

$ids = $query->sort(...)->execute();

Any thoughts on how to make this work?


texts: how do i create a site that allows users to create and view events?

texts:
I'm creating a site where users should be able to create events that are accessible by all users of the site on an "events" page.....whats the best way to do this?
thank you very much!


texts: How to add discount for final subtotal in ubercart?

texts:
I am using Ubercart in Drupal 7. I need to add discount offer based on price.

For example:

if total purchase price $100 then 25% discount.
If total purchase price $200 then 45%.
and so on.

I used the uc_discount module but it's not working according me.


texts: Creating a form thats gives user chance to filter nodes

texts:
Im quet new to Drupal and i dont know how to search for the module i need.

So the idea is...
I made a content type with the following fields: Name, Description, Country, Category.
The Country field is a list item and the Category is a checkbox item.

So the idea is that the users can submit they nodes. I undestand that part.

The problem is i want to display the nodes based on the Category and Country items.

When the user comes to the home page, they should first see a form in witch they chose the Category and Country, so the nodes get displayed based on that pick.

It should be a filter sistem where they can pick one country, and multiple categorys to display the Name and Description fields.

Can anyone give me a idea how to make that form?


texts: Guidelines on customisation options when using hook_views_default_views?

texts:
Are there any good instructions for the customisation options available when creating a default Views files using hook_views_default_views()?

The API for the function can be found here:
http://api.drupal.org/api/views/views.api.php/function/hook_views_default_views/7

However I have yet to find any explicit information on the values that can be used and the options that are available when using the display_options array.

As an aside, here is an example where the lack of instruction become a problem for a novice Drupal developer: it's hard to know what to put for:

$handler->display->display_options['access']['type'] = 'none';

Do you add just add the name of a permission, or a role, if you want to restrict access? Is this even what the option means?


texts: Filtering among Exposed Filters : Parent/Child relationship between two Exposed Filter in Drupal View

texts:
I wanted to make a page with exposed filter search app in Drupal for a list of people.

I started by creating content type Bio and populated it as following:-

Then, I continued making a view with exposed filters of the fields of content type Bio. With the help of Better Exposed Filters, I am showing both Filters through Checkboxes through AJAX, as below:-

Now, until now, it's working fine. when I select a region or/and any city, the content updates according to that.

What I am hoping to create is a dependency between the region and city. All I want is that when I select any region in the Filter by Region, the lower filter values in the Filter by City automatically adjust and show me only the cities for which the region field in Bio is the selected city.

As an example, If a user selects EMEA, the city exposed filters should only show European cities.

I have been stuck in this for hours now. I have tried various solutions (View Dependent Filtersand Filter Fields) but to no avail.

I'll be therefore very thankful for any help whatsoever.


texts: 9 rows is just way too small by default. Is this a text-editor for ants?


texts:
I am using Quicktabs to format the results of a view and it works fine. I created my layout so that my results will look like a table (with 3 columns).

I need to add a header at the top of the rows but before the tabs.

Any ideas how can I do this?

I am relatively new to Drupal.


texts: How to add prefix (label) and postfix to commerce price field

texts:
I am trying to implement Drupal Commerce in an existing site with existing nodes. In this process I need to replace the existing price field with the commerce price field. Since this field is locked, I cannot change the label.

So I thought I could use the raw price format and just add a prefix as a label in template.php or possibly in a hook in *.tpl.php file. But after spending hours googling without finding how to do this, I give up and post this question here. Anybody got an idea?


texts: How to enable CkEditor for "Global: Custom text" in views fields?

texts:
How can i easily enable CKEditor for "Global: Custom text" fields in views - Drupal 8? CKEditor is only visible in a global text fields in HEADER or FOOTER. I need to change text input format in "views fields" also, but there i see only "You May include HTML or Twig" description.

Thank you!


texts: How to get Responsive Image Styles to work with existing images?

texts:
We have existing images that never had an image style applied to them. As part of the cleanup, we are now using Responsive Image Module to do this per breakpoint. AFter creating the different image styles, we created the appropriate Responsive Image styles and applied them to the image fields through the View Modes. However, when we load the page after the Responsive image styles is applied, we get a 404 error for the image's URL. Looks like it did not create one.

How can we create the necessary images with the appropriate image styles such that we only need to modify/clear the images for that image style? We attempted to re upload the image and deleting it and adding it, but neither worked.

We even attempted the following Drush commands but they did not work. According to Drush Commands for image flush the images would be regenerated on the fly but that is not happening.

drush if --all
drush if max_650x650

Updated solution:

I simply changed themes and then switched back to my desired theme and it seemed to work. It was very odd, but effective. I did not have to make any other changes.


texts: How to execute the code at certain time without relying on Cron

texts:
I have a custom entity with a timestamp field which can be populated by the user.

At these specific "times" I have to "react" and update(execute some code) on some other entities related to this time.

First thing coming to mind is to implement it as a Cron job but, I'm not satisfied with this solution as I need to execute the code at a very specific time(any minute) while I don't want to set up the Cron(even a specific Cron job) to run every minute as it's sound quite overwhelming.

Are very any other ways to smartly manage a code execution based on specific(not hardcoded interval) time?


texts: Theming Views problem to print view fields

texts:
I was trying to edit my view theme with php in the file
views-view-field--homepage-banner--block--field-site-image.tpl.php
and try to print view fields, but values come's empty. any ideas?

Code example:

<?php
$link=$fields['field_site_image_link']->content;
$src=$fields['field_site_image']->content;
$link2 = '/' . strip_tags($fields['field_site_image_link']->content);
print $src;
print $link2;
?>
<a href="<?php echo $fields['field_site_image_link']->content; ?>"><?php echo $fields['field_site_image']->content; ?>


texts: How to build a simple data comparison rule?

texts:
I am working on Drupal 8.7.10 and I have installed a fresh Rules 8.x-3.0-alpha5.

Could someone help me to start a very simple rule? I am still struggling with the "new" Rules.

All I need is to send an email to a specific role when a specific field has changed.

"Rulesly" speaking, after a node has been updated, if the unchanged field value is different from the changed field value, then send an email to the manager, with a link to the updated node.

P.S. : I have also started to work with Business Rules so if someone can build this with this module, that sounds good too!


texts: Database query to check if current user has created a node reference?

texts:
I have a content type B with a node reference field (from url) pointing to content type A.
When current user is at "node/add/typeB/nid_of_type A" page then how can i check the database if he has already created a B node for that A node?

I am trying the following code in my template php:

function theme_name_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'b_node_form') {
global $user;
if (arg(0) == 'node') {
 $nid = arg(3);
}
$query = db_select('node', 'n')
->condition('type', 'b', '=')
->condition('uid', $user->uid, '=');
$query->join('field_data_field_a_ref', 'ar', 'n.nid = ar.entity_id');
//field_a_ref is the node reference field from B to A type
$query->condition('field_a_ref_nid', $nid, '=');
$query->groupBy('ar.entity_id')->execute();
if(!empty($query)) {
drupal_goto('/');

    } else {

   }
  }
 }

But i get this error:

  PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM node n INNER JOIN field_data_field_a_ref ar ON n.nid = ar.entity_id W' at line 1: SELECT FROM {node} n INNER JOIN {field_data_field_a_ref} ar ON n.nid = ar.entity_id WHERE (type = :db_condition_placeholder_0) AND (uid = :db_condition_placeholder_1) AND (field_a_ref_nid = :db_condition_placeholder_2) GROUP BY ar.entity_id; Array ( [:db_condition_placeholder_0] => vote [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => 7 ) in theme_name_form_alter() (line 109 of C:...\sites\all\themes\theme_name\template.php).

Any help?


texts: Gaining access to hooks in contrib modules: Webform Validate

texts:
Imagine the scenario: You installed Webform and Webform Validation. You got a Webform. You set some validation rules. Say, question #1 must be answered "True" and #2 must be "False" or else you failed and you can't submit your form.

So then, you want to override the validation. But you don't want to change the validation criteria, just the actions. Instead of just tossing out a drupal_set_message for each one, you want to count up how many validated and how many didn't. You want to display to the user the correct validation condition for some, but not all, and you want to do it depending on the count.

So where does Webform hide its validation criteria once they've been set? Node_load doesn't show them to you. The Webform API don't give you no love. Because they're stored away by a separate contrib module.

Where do you go?


texts: Drupal 8: Performance Impact of frequently clearing all caches

texts:
I have a relatively large production site that uses some custom views to filter by taxonomys and other factors through dropdowns. I have come across the issue that adding a new taxonomy does not allow it to appear in these dropdowns until the cache has been cleared.

I have had a read around and it seems like the most specific thing to do would be to locate the cache tags for these views and invalidate them on creation of a new taxonomy term. However this could be quite complex for me and I was hoping there would be something like cache_clear_all('*', 'cache_view', TRUE); from Drupal 7 so I could just rebuild by views cache when in a hook but this doesn't seem to be the case.

I have come across the D8 drupal_flush_all_caches() method however this appears to clear and rebuild ALL caches with no options to limit its effect. My first question is, what would be the performance effect on my site if I used hook_cron to flush all caches every ~3 hours? Would it be noticeable for the users?

Also, if anyone has a D8 method for clearing specific caches for views/custom blocks etc. I would love to hear them?


texts: Drupal Search - Not searching for menu items

texts:
The default search module inside Drupal works perfect my project but the client wants to search for menu items too. The search module won't find menu items and I can't find a normal description or tutorial that demonstrates how to search them.

Has anyone done something like this?


texts:
I have a small question.

If I use Node::Load on the route of the same node for example:
I go to site.com/node/125 and in preprocess I use Node::Load(125), would Drupal load that node all over again? Or is there some part in the code where it loads it without any performance impact?


texts: Is it possible to display the site UUID on a Drupal 8 module?


texts: How to add a book page: material types empty

texts:
I run a Drupal 7 website since a year and have been always upgrading it - up to the version 7.10.

I have 2 Books and users' Blog at my web site. One of the Books is holding "Site Help" and "Imprint" stuff.

Now there have been a need to add to add 2 new pages "Terms of Service" and "Privacy Policy" to that book.

I go to /node/add but there is a message that no "material types" have been defined.

But I don't remember deleting them. And when I go to /admin/structure/types I see both "Machine name: blog" and "book" defined there:

Thank you


texts:
How to hide views search filters on results page with quicktabs I would like to have the search fields hidden when a user clicks on apply on the advanced tab.

Is there a way to do this?

I can get this done with setting exposed filters form to yes, but it doesn't work in quicktabs.

This site in question is:

http://www.vuxi.com


texts:
In a module, entity_save is being called 2 times. Each time it's called, an extra alias row is being added to the url_alias table. I couldn't find any paths being saved in node_save.

Is this expected behavior?

The entity type I'm dealing with are nodes.


texts: Add a class to a field based on the page regions

texts:
I have my field tpl file which sets in a div classes 'field-item', 'odd/even' etc. I need to dynamically assign a class to it based on the regions that exist on the page. I am using bootstrap theme and the class I need to add reflects the column span count, so f I have a sidebar on the left I will have less space for that field and need a narrower column class.

Bootstrap already comes with a function doing it for page preprocess:

function mytheme_preprocess_page(&$variables) {
  // Add information about the number of sidebars.
  if (!empty($variables['page']['sidebar_first']) && !empty($variables['page']['sidebar_second'])) {
    $variables['columns'] = 3;
  }
  elseif (!empty($variables['page']['sidebar_first'])) {
    $variables['columns'] = 2;
  }
  elseif (!empty($variables['page']['sidebar_second'])) {
    $variables['columns'] = 2;
  }
  else {
    $variables['columns'] = 1;
  }

So basically what I need is to make my field aware of that page variable. How can I use this variable on my field tpl file?


texts:
I have an SQL CREATE TABLE.

CREATE TABLE myid_template_1
(
template_id int NOT NULL,
template_description character varying NOT NULL,

);

I want to know its equivalent query structure in Drupal 7 to create tables at run time. I tried the code below, which it didn't return any error. I wonder if it successfully creates a table, since I could not find the location of the table I created.

function myid_create_db_fields(){
    $template_id = 1;
    $schema['myid_template_'. $template_id] = array(
        'description' => t ('Contains a particular templates data inputted from the MyID Inputting System'),
        'fields' => array(
           'template_id' => array(
               'type' => 'int',
               'not null' => TRUE,
           ),
           'template_description' => array(
               'type' => 'character varying'
               'not null' => TRUE,
           )
        ),
    );
    db_create_table('myid_template_' . $template_id, $schema);
}

PS: I don't want to use hook_schema() because the table is not created when the module is installed.


texts: Set default value for Enity Reference using View and Entity Reference View Widget Checkbox

texts:
Basically i have a field (in line item(commerce custom product)) with Field type: Entity Reference and Widget:View. The view is a list of terms and has an aditional field type:Entity Reference View Widget Checkbox to provide a checkbox in so user could configure the product.

The whole chain works fine from user point of view but there is no option to set the default value (in UI) and the option to set the default value from hook_form_alter() is not giving the needed result.

This is hook_form_alter:

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

    $form['line_item_fields']['field_pesonal_data']['und'][0]['field_cover']['#default_value']=6;

}

Please provide a solution. Thx!


texts: The issue at hand is to change the display of one of a View's fields, based on a condition in another field of the same View. The field to be affected is the display of checkboxes associated with Flag Lists/List Operations. The conditional field would have a value "yes" or "no" and would be excluded from display. Ideally, the checkbox would simply be absent if the value is "no." Alternatively or additionally, it would be helpful to display a message explaining why the item can't be selected to include in a list. Can anyone provide suggestions for a general approach? Thank you for any help and suggestions.


texts:
I came across this other question and wondered whether it was compatible with Drupal 6/UC 2:  Add multiple items to cart

I would like to create a page that shows the thumbnail and title of all products in a category, with a checkbox next to each one. Then, when a shopper checks three, four, five products and clicks "add to cart", those products are all added to the cart.

Or... even better would be if the product automatically gets added to the cart when they click the checkbox, and they can then click a link to go to the cart and finalize their order after they have added all of the products they want... but I know that may be asking a bit too much. ;)

I'm thinking it would be nice for the mobile environment too... the phone/tablet user could simply tap-tap-tap the products they want and then proceed to their cart.

Can anyone point me in the right direction for this?


texts:
I wonder if (and how) it is possible to have dynamic markers on a geofield map created by views. I'd like to have different colors of markers depending on a field value, and also a count of matches from a proximity filter direktly printed into the markers (not the popup). I'm using the google map layer and cannot find an option to even have (e.g.) green instead of the default red markers. Google search on this topic didn't wield any solutions.

I'm using the following modules: address field, geofield, geophp & geofield maps for map display.

Has anyone done this already? Thanks!


texts: I want to put values from additional database in drupal 7. How can I do it?

texts:
I wanted to include additional values to the drupal site. Since it has around 3000 records and it is divided into categories ( a:1, a:2, a:3, b:1, b:2, c:1, c:2, c:3), I had set additional database and connected to drupal.
My question is:
How can I get those values into drupal? views? They have to be included in two forms as a checkboxes and value lists on other form to choose.

Thank you.


texts: Sales Tax Exemption for an Authorized User?

texts:
I have my Drupal Commerce store set up to apply my state sales tax on appropriate purchases. I also have an authorized user who has a state-approved sales tax exemption. I'm trying to configure my tax type such that no sales tax will be applied on their orders, but I'm not having much luck.
I've installed the Commerce Product Tax Conditions module, which appears to support a customer role condition. The module documentation doesn't identify that condition as "apply sales tax for this role" or "exempt this role from sales tax", though, and I haven't been able to apply an exemption.
How can I make this work?


texts: What is the best alternative to using taxonomy terms

texts: If I have a content type that is something like a skateboard design and I need to have attributes that relate to it, such as, skater, year, series, brand, etc.  What would be the best way to implement these if I want a view  where I can sort based on each of these attributes.  I tried using taxonomies but it seems that it creates a query that has 12+ left joins.  The query is taking over 8s with only 1024 designs.  Any help would be greatly appreciated.


texts: subscribe to nodes with entity reference

texts:
I'm building a music site and have an 'artist' content type that are referenced in product displays, articles etc. I want to enable users to subscribe to these artists and get notified whenever there's a product display, article, event etc. that references the artist.

I've been looking into the Message Stack module to achieve this (http://www.jacksonriver.com/news/message-stack), but haven't been able to make it work with entity reference.

Is this something anyone feels like helping me out with? Could be a very powerful feature IMO.


texts: Consider, I have created two pages using Views for content types Activites and Articles viz. Latest Activities and Latest Articles. I have made a view to display the grid structure for these contents. However, if I modify the views-view-grid.html.twig, it affects the both views. What twig file I should create so that I work on separate view for each pages? eg. something_view1.html.twig for Activities and something_view2.html.twig. Thanks.


texts: How to see all keys for a PrivateTempStore?

texts:
The Drupal class PrivateTempStore allows for setting and getting key-value pairs within a temporary data store. The class includes the $storage property which then has a getAll() method for retrieving all items in the store. However, this is protected, and so cannot be used by an instantiated PrivateTempStore object.
Is it possible, given a PrivateTempStore object, to retrieve a list of all keys currently used in the store?


texts: #states doesn't work with exposed filters

texts:
I have two exposed filters Contry (name=field_country_tag_tid) and City (name=field_country_tag_tid_option_limit). Reference limit option Module limet avaliale options in city but not when page with filters loaded at first time. That why I wanted to desable City Filter by using #states

function mymodue_form_views_exposed_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'views_exposed_form' && $form_state['view']->name == 'map') {
   $form['field_country_tag_tid_option_limit']['#states'] = array(
  'visible' => array('select[name="field_country_tag_tid"]' => array('value' => '1')),
       );

    }
}

I used the following example http://api.drupal.org/api/examples/form_example!form_example_states.inc/function/form_example_states_form/7

But there are no any changes in my exposed filter, where is my mistake? Thanks


texts:
How can I add Help text to the Title in D7?

Perhaps adding an 'edit' button similar to the other normal fields.

Ideally the solution integrates with Label Help.


texts: Drupal 8 Menu Block is not showing in left region for dynamically created routing page

texts:
I created some menus under 'Main Navigation' and assigned into the side bar region. I selected the depth level starting from 2 to 4.(See the screenshot)
The menu block is not showing for dynamically created routing(multiple routing) pages but for normal pages like node is showing fine.
Screenshot:


texts: Language Hierarchy module bug or is it me?

texts:
Not sure if this is the right place to go with this question: However, before I file an issue with this, I'm wondering if it is something I'm missing or doing wrong.
The problem. Given a language (lets say Spanish), I have defined another custom language (Spanish, Mexico)
From /admin/config/regional/language, I nest Spanish, Mexico with Spanish as a fallback.

Next, I define a translation for Spanish, Mexico.
Expected Result: a translation for that term unique to Spanish, Mexico, and a separate translation for Spanish.
I have created a fresh install of Drupal 8.9.9 and have only installed https://www.drupal.org/project/language_hierarchy (V.2.0.0-rc2). Also tried 2.x-dev (same error)
Actual Result: the Spanish, Mexico translation overwrites the Spanish.


texts: Views Exposed Filter with Specific Values

texts: I have a view that requires an exposed filter of years starting at 1980 and incrementing every 4 years (1980, 1984, 1988, etc) all the way to the last year of that meets this criteria, i.e. 2012.  Is there a way to do this?  So far I have only been able to create a select element with every year from 1980 to today.  I've also tried using a global php field but cannot figure out how to expose that to the end user.


texts: What's meaning of %contact in this menu path?

texts:
$items['admin/structure/contact/edit/%contact'] = array(
    'title' => 'Edit contact category',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('contact_category_edit_form', 4),
    'access arguments' => array('administer contact forms'),
    'file' => 'contact.admin.inc',
);

How does it get the path admin/structure/contact/edit/%contact and what does it mean by %contact?


texts: Get fields to appear in fields list, arguments list and filters list in view

texts: I am using hook_form_alter and adding a extra form field to drupal node form. All works fine, but in view this field is not show up. How do i add this field?


texts:
When the checkout process is complete I'd like to record the SKU and the user ID in a separate table in my database.

Is the best approach to use the Rules module, using the 'Completing the checkout process' event and writing a custom action?

If so, how would I be best going about this?

Advice on how best to achieve the above would be appreciated.


texts: How to show a message instead of hiding the webform when user reaches the limit?

texts: I have a webform which every user can submit it once. when the user submits the form the webform gets hidden from him next time he visits the site. I want to be able to show a message or something which describes why the visitor can not see the form anymore. How can may I do this?


texts: Conditional Fields inside Paragraphs not working

texts:
Am able to get the configured conditional fields in hook_field_widget_WIDGET_TYPE_form_alter() and trying to apply them for Paragraph fields but not working, below is the code(most of it copied from Conditional Fields module file):

$dependencies = conditional_fields_load_dependencies('paragraph', 'paragraph_machine_name');

    if (!empty($dependencies)) {
      foreach ($element['subform'] as $field_name => $field_details) {
        if (isset($dependencies['dependents'][$field_name])) {
          foreach ($dependencies['dependents'][$field_name] as $id => $dependency) {
            if (!isset($element['subform']['#conditional_fields'][$field_name]['dependees'][$id])) {
              conditional_fields_attach_dependency($element['subform'], ['#field_name' => $dependency['dependee']], $field_details, $dependency['options'], $id);
            }
          }
        }

        if (isset($dependencies['dependees'][$field_name])) {
          foreach ($dependencies['dependees'][$field_name] as $id => $dependency) {
            if (!isset($element['subform']['#conditional_fields'][$field_name]['dependents'][$id])) {
              conditional_fields_attach_dependency($element['subform'], $field_details, ['#field_name' => $dependency['dependent']], $dependency['options'], $id);
            }
          }
    }

  }
}

Can someone please help me in it?


texts: Why does YAML parser strippes out underscore?

texts:
In my Drupal project I have a yaml configuration file which contains an id with the value 16_9 (more precisely it is part of the Crop module configuration). When checking differences between the active Drupal configuration and this staged one, Drupal lists this config, although it should be identical:

As you can see, the YAML parser processes the id as an integer and stripes out the underscore.

This problem only exists in my Drupal-VM. In our testing and production environment (non Drupal-VM) with the identical code and data base the config sync is fine. It does not show any differences.

There might be different YAML parser (and/or extensions) in use which behave not the same way. But I don't know if this is a Drupal or VM issue. I don't think that it is specific to the Crop Module.

My Environment

Vagrant 1.9.2
VirtualBox .1.18 r114002 (Qt5.6.2)
Drupal VM 4.5.0 (with Ubuntu)


texts:
We have a product that is being sold with Drupal Commerce (using Drupal 7). This specific product is going to be advertised in more ways than just the Drupal site (e.g. email, other sites).

These other sites can have a form in which the user enters some basic information (Name, phone, email). This data is sent to Drupal (curl), a cart and session is created (anonymous unless the user is logged in our site) and the session ID is sent back to the calling website.

The user is redirected to our Drupal site, and the session is restored using the id that was passed.

Everything is working fine, but the user has enter the name, phone and email twice because Drupal tries to pre-populate the checkout fields with the user data, and in this case the user is anonymous, even though I have the user data from the first call.

Is it possible to add this information (name, email, phone) after calling commerce_cart_product_add() for anonymous users? The fields in checkout should get pre-populated even if the user is anonymous.


texts:
I'm experiencing some odd behavior with D7's update report. When I view the update report it can only determine the status of roughly 5 or so modules/themes. The ones that it finds are random and each refresh reveals a different list of statuses that it can determine. The list reveals all enabled modules but majority of them are grey with "No release found" for the status. Drush up behaves the same, except that it only returns the random 5 or so modules that it can find a status for.

Has anyone experienced this issue? Could it be that drupal.org is not responding and the issue is with drupal.org? It's really painful because the elegance and ease of drush up is no longer relevant when you have to run it 20 or so times to update modules.


texts: I have unsuccessfully attempted to find how to use the Coder module with Drush. Does anyone know how should I use it?


texts: Hide a block from the "Place block" list

texts:
I have a custom module that defines a series of blocks.
Depending on the configuration of the module, I'd like to hide blocks from "Place block" block layout list unless they're enabled.
Is that possible?


texts:
When I look at $user like this

global $user
dpm($user);

I do not see the user account fields I added. How can I access them?


texts:
I'm using unlimited image upload option in my content type. Upload image and remove the uploaded image options are working fine with the unlimited option.

Usually, the uploaded images will be displaying one by one (Last in Last - Image1, Image2, Image3,..ImageN). But, I need show the uploaded image at first/top place (Last in First - ImageN,..., Image3, Image2, Image1).

Can you please help me in this?

UPDATE:

PFA for bulk node edit page in admin section. I used image upload as nested objects (unlimited). You can see two nodes display in edit mode (Title 1 and Title 2).

New upload field should be add before the exiting uploaded image section when I click the "Add another item" button OR
Ok. It can display under the existing uploaded image section. But, the image should be reorder as per my above requirement when I click the "Upload" button.

Note: I saw some hook in ajax.js file that will handle the ajax process. But, I don't know, how it's help to solve my problem.

 *  Drupal.behaviors.myCustomAJAXStuff = {
 *      attach: function (context, settings) {
 *        Drupal.ajax['edit-submit'].commands.insert = function (ajax, response, status) {
 *          new_content = $(response.data);
 *          $('#my-wrapper').append(new_content);
 *          alert('New content was appended to #my-wrapper');
 *        }
 *      }
 *    };


texts: Having the NOT IN SQL query equivalent in a view

texts:
I have a site in which user can choose three programmes between 9. I would like to have a view that gives me the 6 programmes a user didn't choose. I've created programmes using taxonomy so each of my users have a term reference on programmes that contain the 3 programmes.

Any idea would be appreciated, Thanks


texts: Why is my subtheme screenshot not appearing?

texts:
I have created a subtheme, and it shows up correctly on the admin/appearance page, but I can't seem to get my screenshot to appear.  It only displays the screenshot from the base theme.  I have declared the screenshot in mytheme.info, and the PNG file is sized to exactly 294 x 219.  Any ideas?

Thanks!


texts: Integrating Commerce Feeds and Physical Field. (Drupal Commerce)

texts: I'm importing over 40K of products from a .csv file.  The file includes weights and dimensions (height,width,length).  I use physical field module to define my fields for weight and dimension. I'm having problem mapping weights and dimensions from my .csv file to my product table where I define the weights and dimensions as Physical Field (Physical Field Module) because it's not showing as the target field.  I will appreciate any help. Thank you in advance.


texts: Is there a module that would allow authenticated users to save stories they like and store them in a page containing all their personalized content (something similar to a delicious.com type service)?


texts: How can I export shortcut sets and shortcut links in Drupal 7?

texts:
I am using Drupal 7 and I have some shortcut sets (per role using the shortcut per role module) and shortcut links in them and I would like to export them either using the features functionality or with any other exporting mechanism.

But I do not find any relevant exportables in the features exporting options not even in the Strongarm section. Is there a way yo do this or should I manually recreate them in the other site installations?

I have also seen a relevant question but it does not have any answers regarding the shortcuts part.


texts: How to make the autocomplete term widget (tagging) case-sensitive?

texts:
I notice that although the Autocomplete term widget (tagging) happily autocompletes terms with their right letter case, after saving the terms are changed to lower case. E.g. I have two tags "Drupal" and "drupal" and although I autocomplete "Drupal" and save the node, what gets saved is "drupal".

Is there a way to force case-sensitivity for this widget -- or vocabulary?


texts:
Need to be able to disable taxonomy term, but maintain legacy. Attempting to populate a drop down with taxonomy term, but have a required to disable a specific term, but still maintain the data.

Another way to describe what i'm trying to do. Is not allow a user to select a specific term in the drop down.


texts:
I've set a custom homepage url at example.com/welcome.
The user comes to the example.com/ and logs in on that page. Drupal redirects to
example.com/welcome

Now the user clicks on the home page which loads example.com/ from browser cache (which has the login form on it).

I guess if Drupal would reload the homepage at example.com/ instead of example.com/welcome I wouldn't have that problem. How would I do that?

What else could I be doing?

Btw, anonymous pages are getting cached by varnish.


texts: Can we create a sub-theme with multiple parent themes?

texts: As title. I installed multiple 3rd party themes on my website. I'll activate them in random instance. Can I write a sub-theme which has multiple parent themes, but not ALL?


texts: How do I edit individual meta tags on a panelized page?

texts:
Setup I have: Drupal 7, Panopoly 7.x-1.30, Metatag 7.x-1.13

I've installed and enabled both the metatag and metatag_panels modules. Perhaps I'm just not looking in the right place, but I don't see any way to add custom metatags (title and description) to an individual panelized landing page.

On an individual node page (which isn't panelized), I can click the "edit" tab, and at the bottom is a form that lets me customize the metatags for just that node. But if I click the "edit" tab on my landing page, there is no such form. Clicking the "customize this page" button which invokes the panelizer doesn't seem to offer any way to edit the metatags, either.

I've read the documentation and searched the drupal.org forums, but nothing has made a solution clear to me.


texts: Using IN queries or joining to a temporary table inside views for data managers to use with VBO for one-off updates

texts:
Our data managers routinely analyze Drupal content in external mapping and analysis programs and generate lists of nodes that require updates.  I'm looking for a solution that will allow them to update this arbitrary list of nids, preferably within a friendly UI.

Background

We've recently migrated from a custom database application to Drupal.  In the past our data managers would perform a sql in query (SELECT * FROM table WHERE ID IN (27, 83, 99, ....)) or upload a temporary table to the database, do a join and perform updates.  I'm looking for a way for them to do the same thing, but inside of Drupal so the proper update hooks are fired.

So far my Google skills and searches on drupal.org are failing me.  It seems this should be a common problem?  Is there a best practice when performing these sorts of one-off query/updates?

Some related solutions I've considered

Views contextual filters using either default arguments or arguments in the url (Create a view from specific Node ID's) - This is limited to only a few dozen nid's as a default argument or maximum url length.  Not suitable for long lists of nid's
Researched using Node Queue with the solution above but the UI doesn't seem to allow bulk adding of nodes, but perhaps I'm overlooking something.
Custom module to expose a table to views (Join a custom table on a View) - not ideal since requires programming every time a new update needs to be performed
Write a custom query and update to perform IN queries (Using IN clause in db_query) - again requires code, which I'm not opposed to if I can work up a reusable solution that our data managers (not programmers) can use to maintain our data.

An ideal solution would be a fiter criteria that allowed our data managers to paste a long csv string.  Something like "In list" which operates similar to the "Is between" functionality.

I'm overlooking something obvious! Ideas?


texts: How to include the Title field of a content type inside of a Group?

texts: When creating a new content, is it possible to have the field Title inside a Group defined by me?


texts: How to timestamp last block access to profile cck field

texts:
I need to log when a user last accessed particular areas of my site (a content type and some views pages), to do this I have added a block using PHP filter with the below code. This block is only visible on the required pages so I was hoping it would mean when a user accesses these pages it updates the users profile with the timestamp.

global $user;
$uid = $user->uid;
$node = content_profile_load(profile,$uid);
$pid = $node->nid;
$node = node_load($pid);
$changeLastAccess = mktime();
$node->field_changes_last_access[0]['value'] = $changeLastAccess;
node_save($node);

The problem is this date always shows the CURRENT time, not the time when a user was last on one of the pages on which the block is active. I am totally stumped...

EDIT:
This was working all along, i had created the wrong CCK field type of "Date" rather than "Datestamp", changed this over and it works fine.


texts: I've made a site where users can create accounts. Lots of spam accounts are being created and I am not sure why. The form at mysite.com/user is mollom CAPTCHA protected, what other paths should I check?


texts: What alternatives exist for Autologout in D7

texts:
Since the autologout module isn't ready for prime time for D7, what are some alternatives out there?

Is there any snippet out there already that can be used in a sample custom module that will logout users for x minutes of inactivity?

Update 1:
The suggested snippet here keeps D7 from crashing, but does not logout the user.

Thanks!


texts: Authentication to Drupal REST Server returns unauthorized

texts:
I am working on a Drupal CMS configured as follows:

Code base: Drupal 7.54

Modules:
Services 7.x-3.19
Services API Key Authorization 7.x-1.12
REST 7.x-3.19

I have setup an endpoint under services and when I have authentication turned off I have no issues accessing the endpoint.

When I turn on API Key Authentication and when I attempt access I get a 401 unauthorized access.

I have the API Key access type set to Header. Here is the result when I run this curl command with the -v from the command line:

curl -v -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: HTTP_API_KEY=ahfs-7fp-AGq_e97Gps8Zg" http://dev00.chgo.pat.com.local/api/skus

* Trying 192.168.0.53...
* TCP_NODELAY set
* Connected to dev00.chgo.pat.com.local (192.168.0.53) port 80 (#0)
> GET /api/skus HTTP/1.1
> Host: dev00.chgo.pat.com.local
> User-Agent: curl/7.51.0
> Accept: application/json
> Content-Type: application/json
> Authorization: HTTP_API_KEY=ahfs-7fp-AGq_e97Gps8Zg
>
< HTTP/1.1 401 Unauthorized : Unauthorised access.

HTTP/1.1 401 Unauthorized : Unauthorised access.
< Date: Thu, 04 May 2017 20:05:53 GMT
Date: Thu, 04 May 2017 20:05:53 GMT
< Server: Apache/2.4.18 (Ubuntu)
Server: Apache/2.4.18 (Ubuntu)
< X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
< Expires: Sun, 19 Nov 1978 05:00:00 GMT
Expires: Sun, 19 Nov 1978 05:00:00 GMT
< Cache-Control: no-cache, must-revalidate
Cache-Control: no-cache, must-revalidate
< X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
< Content-Location: http://dev00.chgo.pat.com.local/api/skus
Content-Location: http://dev00.chgo.pat.com.local/api/skus
< Vary: Accept
Vary: Accept
< Content-Length: 24
Content-Length: 24
< Content-Type: application/json
Content-Type: application/json

<
* Curl_http_done: called premature == 0
* Connection #0 to host dev00.chgo.pat.com.local left intact
["Unauthorised access."]

I get the same result using Postman.

I've also tried using HTTP_API_KEY: ahfs-7fp-AGq_e97Gps8Zg

Is my error an incorrectly formatted request or do I have something incorrectly setup on the server?


texts: geolocation_views: show combined data in tooltip

texts:
I have two content types that work together:

"place": a place on a map (via a geolocation field)
"object": an object that is in a specific "place" (referenced via an entityreference field)

Several "objects" can be stored in the same "place".

Now I want to display a map showing the location of each object (via geolocation_views).

My problem:

either the view shows OBJECTS, but then if there are several objects in the same place, several "pins" will appear on the exact same spot on the map, which doesn't work well (you can only click on the topmost pin)
or the view shows PLACES, but then the information about what object is stored in that place is absent.

For now, I have the following:

the main view is the map and shows places
and then I added a second view, as an attachment next to the map; this view lists (textually) all objects, grouped by places.

This works, but it means that the map is pretty much useless: you can click on a place, see its name, but you have no information about the objects and so you have to search the name of this place in the second view and then you will see the objects. Since there are several dozen of places, it's really cumbersome.

Ideally, I'd like that when the user clicks on a "place" on the map, the tooltip shows not only the name and address of the place (it's already the case), but also the list of objects stored in that place.

How can I achieve that?


texts: Drupal 6 failing to login user in IE7 but forwarding to user account page

texts:
We have just updated a Drupal 6 website to Drupal 6.22 for a client. However, the client is now no longer able to login to their account when using IE7. After clicking "Log in" the client is correctly being forwarded to their user account page, but is getting a "You are not authorized to access this page" message and remain unauthenticated. The client has now choice but to use IE7 at work, so switching browser is not an option.

We have tried testing this in various browsers in our office (Chrome, Firefox, IE8 - we don't have access to IE7) and can successfully sign-in to the site every time.

We have tried repairing the sessions table (in case that was corrupted) and still no luck. Our cookie domain is being set in settings.php as: $cookie_domain = $_SERVER["HTTP_HOST"];

Any suggestions?


texts: How to create a user with field collections programmatically?

texts:
This is what I use to create the user:

    $new_user = array(
        'name' => $form_state['values']['email'],
        'status' => 1,
        'access' => REQUEST_TIME,
        'roles' => array(),
    );

   user_save('', $new_user);

Now I want to add values to the field collection items.
I have a field collection called field_personal_details and a field collection item called field_firstname, but I have no idea how to access it. Can someone help me get started?


texts: How to add an entity reference field value on Behat Test

texts:
My Behat test starts like this:

@api
Scenario: Testing user
Given users:
    | name | pass | mail    | status | roles  | field_lines_ref |
    | test | test | t@t.com | 1      | Tester | Line Name       |

field_lines_ref is an entity reference to a node.  The user gets created but the Lines Reference field never gets populated.  I also tried using the node id but it also didn't work.

One thing to note is that I already have a node created "Line Name" and I have to use that exact node because of logic in place (Based on node id).


texts: What causes EntityMetadataWrapperException: Unknown data property?

texts:
I have added new field to my bundle in one of entity type. I used the Group audience as field type and Group Audience as widget type.
This is to make the field to select multiple records.

While adding the new record with all the values it gives following error:

  EntityMetadataWrapperException: Unknown data property og_membership.
  in EntityStructureWrapper->getPropertyInfo() (line 354 of
  /var/www/vhosts/test1.3blmedia.com/httpdocs/sites/all/modules/entity/includes/entity.wrapper.inc).

I am not getting where it is wrong. Any hints?


texts: Default Bartik theme not theming any pages

texts:
I enabled the Bartik theme and made it the default, but the home page of the site, or any other pages I add, do not have the theme applied to them. The most noticeable difference is that the regions do not have any background colours that the Bartik theme is meant to define.

I tried clearing the cache and using a different browser. i'm new to Drupal, but have tried reading the documentation and this just gives the impression that once you enable a theme and make it the default, it should apply to your pages.

Here's a screenshot of the top of the home page:

and here's what the Bartik theme is meant to look like:


texts: Is there a way to add managed_file field to theme-settings.php?

texts:
Anytime I add a managed_file field to theme-settings.php, the field works, however, it gets saved with a status of 0 in the database.

When I add a submit handler to the theme settings form, I get a " Call to undefined function" error.

Of course, when I remove the managaed_file field, the undefined function error goes away and the submit handler fires as normal.

Has anyone tried doing this? Is there another way around this problem?

thanks!
david


texts: Progress bar freezes during Drupal installation

texts: When I install Drupal 8via composer on Centos7 with php7 the Progress installation bar does not budge unless I refresh the browser (Tried Chrome, opera and Firefox)but it does not install properly. I can install Drupal 7 via composer with no problems. Any suggestions please?


texts: Changing image styles in a node view (Drupal 7)

texts: In the node view of my custom content type I would like the image to stretch across the screen or at least be centered.  As can be seen in the below screenshot currently the image does not get resized and is left justified.  Would this be done through theming or some other means?


texts: Token Content Access blocks access for author too

texts: I use the Token Content Access module to hide member created nodes from public view and allow them  to share private links with private links (URL tokens). My problem is when a user restricts access to individual nodes using URL tokens, he cannot access them without the token either!


texts:
I have written this hook in my custom module, just to track the status changes of the users.
/**
 * Implements @see hook_user_presave
 */
function mycustommodule_user_presave(&$edit, $account, $category) {
$account_user_id_=$account->uid ;
 $new_status=  $edit['status'];
 $previous_status= $account->status;
watchdog('attention',
     'User  %ui changed status to: %newstat, previous status was %previousstat',
     array('%ui' => $account_user_id_, '%newstat' => $new_status, '%previousstat' => $previous_status, WATCHDOG_NOTICE));
}

I noticed for example that when a user activates his newly created account by clicking on the link sent by email, the status moves to 1 which is good .
But I also noticed other message that I couldn't know its cause:
"user 34 changed status to: , previous status was 1" . What makes the status of a user moves from 1 to  null ?


texts:
I've enabled Fivestar and added it to the comments field and made sure its in the comment display as well.

I've allowed anonymous and other users the ability to use Fivestar in Permissions. I've changed comments permissions so users can leave them and see their own.

I've created a new content piece and flushed caches to check if it only provides the field on NEW items.

In firebug on FF it says the rating field is in there but for some reason it's not showing up on the screen. Here's the code from Firebug:

Any idea what might be going on here or ways to fix it?


texts:
Hope that someone can help me with this question.

I am using the latest version of Drupal 7.

I appreciate that what I am trying to do can in part be achieved with Views, Panels, combinations of the aforementioned or other things like taxonomy and CCK. Perhaps I am not understanding them fully enough to get their full power. However, I am hoping that there is perhaps a module to do what I want to do. As I said, I know I can do some of what I want to do using Views and Panels but I can only figure out how to do what I want to do on a specific 'page' by 'page' basis by using the interface provided in the views and/or panels sections for each specific page. What I am want is a more dynamic way of creating a view without having to go through the process of creating a view each time.

I know that nodes are not traditionally used as I want them to be. However, I want to be able to give an admin user the ability to place multiple content types (multiple nodes) on the same 'page' without having to design their own view and/or panel set up for each 'page'. For example on one page they may want to put a content type called Article, then beneath that article they want to put a Video, under that a basic page, then an Image, then an image with a text wrapped around it and then another specific article and so on. There could be any combination of the content types (nodes) on each page and any number of pages.

I appreciate that generally speaking a "basic" node is generally considered or rendered as an individual "page" or grouped together in some way to display as a blog BUT I want to give an admin user the ability to dynamically combine any node not just the type with an easy to use interface. Even it is just drop down menus of the different content types. I also want to give them the ability to move these up and down the page preferably using drag & drop or at least a text box to put in the weight of each item.

I have found the command "node_view" and can sort of see a way of using that but I wouldn't know how to use it in a dynamic way or how to set it up for use on user created "pages". I am fairly new to Drupal and I maybe barking up the wrong tree. Perhaps there is already a module out there that I haven't found.

Thanks in advance for any help...