texts: Pass value of form field in the url (params/$get)

texts:
I have created a form (with entityform) and wants to pass the value of the first field in the parameters of the url. This value is useful for update the other fields of the form.
Is there a method to achieve this ? I have read several posts with the ajax callback subject, but exactly I don't see how to process...

Thanks for your help.


texts: "Please select category" as default value in a select list

texts: Similar to how the search box on many sites has a default value of "search", how do I give a select list a default value without making that value a valid option in the list of options. See example below:


texts: Drupal 7 Commerce - What permissions do I need to set to give access to a specific role to view ANY order for administration?

texts: In drupal 7 commerce i setup a staff role to access and manage commerce orders, but they are getting an access denied even though i have all the Orders permissions checked off. Is there somewhere else I need to check off to enable permissions for a specific role?


texts: How to display a views block on pages with a specific combination of URL patterns?

texts:
I'm using the Group module (1.0-alpha7) on a Drupal 8.1.5 and I want to display a view of recent article in my groups.

I want to display the view on groups page (mywebsite/group/x where x is id of group) but only this pattern of URL. For example when I create an article in a group the URL is : mywebsite/group/x/node/create/article and I don't want to show the view on this page.

I'm trying to use Blocks Visibility Groups module module to do it but for the moment I don't find the conditions to make it work.


texts: How to stop download in hook_file_download

texts:
I'm building a page with different download buttons linked to private zip files. Users have to log in to download. I am using module Permissions by Term to manage who can see which button.
I added a field to user entity to log each download. In hook_file_download() I check, if and how often this file is already downloaded by this user. Up to here everything works fine.
I want to stop or block the download and show a message to the user, if download counter reaches 5 or 10. Is hook_file_download the right hook to achieve this?


texts: How to hide install new module link on http://localhost/admin/modules page?

texts:
I want to hide install new module link on http://localhost/admin/modules page?

I have created a new user role he/she have all admin rights(Editor Role), but I don't want to show install new module link to that user so that user should not be able to install any module in the website.


texts: Is there any backport of "Grouped filters" available in Views 6.x-3.x branch?

texts:
In Views 3 (Drupal 7), there is a nice feature when you expose a Views filter, you can select
"Grouped filters" option and define a set of conditions.

Is there any module that backports this feature to Drupal 6 Views 3.x branch?


texts: I am using Node Gallery Module, just want to know if there is a way we can open the images in Lightbox or Colorbox? I know this can be done in Media Gallery module but can not find any way in Node Gallery.


texts:
I'm using the "AJAX Login/Register" module for Drupal 7, and the three links it outputs are 'Login', 'Create new account', and 'Reset your password'.

What I'm looking to do is replace the outputted text (such as 'Login') with a button in the form of a
. What would the PHP look like to accomplish this?

(EDIT #2: Added PHP showing $options and $links)

function _ajax_register_ajax_links($links_enabled, $form_id = NULL) {

  $links = array();

  // Build classes for ajax modal link.
  $classes = array();
  $classes[] = 'ctools-use-modal';
  $classes[] = 'ctools-modal-ctools-ajax-register-style';

  // Provide default options for ajax modal link.
  $options = array(
    'attributes' => array(
      'class' => $classes,
      'rel' => 'nofollow',
    )
  );

How the link is constructed:

  // Add login button.
  if (in_array('login', $links_enabled) && (stripos($form_id, 'user_login') === FALSE)) {
    $options['attributes']['title'] = t('Login');
    $links[] = l(t('Login'), 'ajax_register/login/nojs', $options);
  }

Assume that the
 I'm looking to create would look like this:

(EDIT #1: Corrected to show  encapsulating the
)

 // Note that I do not want the 'Login' text visible


texts: how to pass variables from a views style-template to the row-template it invokes

texts:
I created a custom style-plugin for views, and a corresponding style-template (my-style-template.tpl.php).
Similarly, I created a custom row-plugin for views and a corresponding row-template.

The style-template loops through the views-rows, and invokes the row-template on each row:

print $row;

What I am trying to accomplish:

The style-plugin defines certain settings in the $options variable, which gets passed to the style-template.  The row-template needs access to some of these settings.

My question:

Is there a way to pass variables from my style-template to my row-template?
For example, rather than invoking print $row from the style-template, is there some other way of invoking the row-template, which allows me to pass variables to the row-template?

Thanks very much!


texts: How to allow user login only once at a time?

texts:
I want to allow a user login to the site only once at a time. User should not be able to login at other machine/place while he is logged in.
I want to user password should get destroyed once used and should promt user to "request new password".
I also want to show user login time,logout time, number of visits, last visit time...etc in a block for user.

How can i get these in Drupal?


texts: How can I prevent cache on any page where a paragraph appears?

texts:
I am using the paragraphs module with a custom theme I created. I want to figure out how to clear the cache for any page that a specific paragraph appears on. The custom theme is composed of a bunch of templates (i.e. paragraph--paragraph-name.html.twig) and a *.theme file where I preprocess each of the paragraph types.
THEME_preprocess_paragraph__paragraph_name

I don't want to disable the entire site's cache. Can I clear the cache in this file? In this way somehow?


texts: hook_entity_base_field_info() vs. creating a new entity

texts:
I need to create a fairly extensive user/account management section of a site.

I'm wondering whether to just extend the existing user entity, or whether I should create a completely new entity to house all the extra stuff I need...

Are there any pro's/con's I should bear in mind when making this decision?


texts:
Should one avoid lots of use statements in a custom modules .module file?  Or does it not matter?  To quanity "lots", let's say, using 7 to 10 "use" statements.

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\views\Views;
use Drupal\views\ViewExecutable;
use Drupal\Component\Utility\Html;
use Drupal\node\NodeInterface;
use Drupal\Core\Cache\Cache;

I suppose for organizing code, it may be more elegant to create a service to hold custom functionality, rather than to put it directly in a custom module's .module file, but are there any performance implications for many use statements in a .module file?


texts: Where are the "Publishing options" for a node stored in the database?

texts: I need to order a column in a custom module by whether the node is published or not. Can't figure out where this is being stored in the database.


texts: How to set Rules event for "Content is viewed" from excluding Teaser view?

texts:
I set up a Rule that will execute during the "Content is viewed" Event and the action was to show a system message.

It worked and was triggered when I viewed the node. However, when I went to the home page, it was triggered N times, where N is the number of nodes on the /node page.

How do I stop this from happening? The Rule should only fall through on content full view, and exclude the teaser view.


texts:
One of an entity properties is a timestamp, set when it was created.

I want to use the EntityFieldQuery class to load entities that were created today.

Normally, I would write a query using DATE_FORMAT(FROM_UNIXTIME(created_timestamp), "%Y-%m-%d") = "2014-03-17".

I'm not aware of any method to use any MySQL functions in EntityFieldQuery. I have tried with the following code.

$day_start = strtotime(date('Y-m-d 00:00:00', $created_ts));
$day_end = strtotime(date('Y-m-d 23:59:59', $created_ts));
$query->propertyCondition('created', $day_start, '>')
  ->propertyCondition('created', $day_end, '<');

Whilst this works, it doesn't seem as efficient and certainly less succinct. Is there a function that I can use with EntityFieldQuery similar to SelectQuery::where() that would allow to write code similar to the following one?

$query->propertyWhere('DATE_FORMAT(FROM_UNIXTIME(created), "%Y-%m-%d")', "2014-03-17");


texts: Adding website logo as the first top level menu item in tb megamenu

texts:
I am usting tb megamenu module to get a main menu on my site.
Is there a way to add the website's logo as a top level menu item (NOT SUBMENU ITEM)


texts: Field API field_schema for text field error

texts:
I've built a custom field using the Field API. I've defined the following element:
  $element['tabcontent'] = array(
    '#title' => t('Tab content'),
    '#type' => 'text_format',
    '#required' => $required,
    // use #default_value to prepopulate the element
    // with the current saved value
    '#default_value' => isset($item['tabcontent']) ? $item['tabcontent'] : '',
    '#tree' => true,
    '#rows' => 10,
    '#format' => 'full_html',
    '#base_type' => 'textarea',
  );

I've got the following code in the install file:
function tabfield_field_schema($field)
{

  $columns = array(
    'tabtitle' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE),
    'tabcontent' => array('type' => 'text','not null' => TRUE,'size' => 'normal','description' => 'Question prompt','length' => '1000'  ),
  );

  return array(
    'columns' => $columns,
    'indexes' => array(),
  );
}

However, I get the following error when saving a new node:

Warning: preg_match_all() expects parameter 2 to be string, array
given in _media_generate_tagMap() (line 186 of
C:\Workspace\RnD\drupal1\sites\all\modules\media\includes\media.filter.inc).
Warning: Invalid argument supplied for foreach() in
_media_generate_tagMap() (line 187 of C:\Workspace\RnD\drupal1\sites\all\modules\media\includes\media.filter.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array
given in check_plain() (line 1572 of
C:\Workspace\RnD\drupal1\includes\bootstrap.inc).
PDOException:
SQLSTATE[21S01]: Insert value list does not match column list: 1136
Column count doesn't match value count at row 1: INSERT INTO
{field_data_field_tab} (entity_type, entity_id, revision_id, bundle,
delta, language, field_tab_tabtitle, field_tab_tabcontent) VALUES
(:db_insert_placeholder_0, :db_insert_placeholder_1,
:db_insert_placeholder_2, :db_insert_placeholder_3,
:db_insert_placeholder_4, :db_insert_placeholder_5,
:db_insert_placeholder_6, :db_insert_placeholder_7_value,
:db_insert_placeholder_7_format); Array ( [:db_insert_placeholder_0]
=> node [:db_insert_placeholder_1] => 17 [:db_insert_placeholder_2] => 17 [:db_insert_placeholder_3] => tabbed_page
[:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und
[:db_insert_placeholder_6] => ss [:db_insert_placeholder_7_value] =>
ss [:db_insert_placeholder_7_format] => full_html ) in
field_sql_storage_field_storage_write() (line 448 of
C:\Workspace\RnD\drupal1\modules\field\modules\field_sql_storage\field_sql_storage.module).


texts:
In GIMP there is a very useful operation "Colors > Color to alpha..".
It lets you specify a color (e.g. white), and then replaces this color with transparency.

The effect is written such that if you would display the resulting image on top of a background of the chosen color, it would give you the original image back.
(or this is how I understand it)

I was trying to achieve the same effect with Drupal 7 image styles.
There is an effect "Alpha transparency", but the explanation is horribly confusing. Otherwise there doesn't seem to be anything close.

EDIT: Some useful links:
https://stackoverflow.com/questions/9282714/how-to-change-the-alpha-of-a-pixel-without-changing-the-resulting-color
https://stackoverflow.com/questions/9280902/what-algorithm-is-behind-the-gimps-color-to-alpha-feature


texts: Get the URL to use it in an  tag in a file field

texts:
I'm looking to print out the url for a file in a Drupal File field in the twig template. I'm doing this inside a paragraph twig file.
I've followed a similar answers on stack overflow but to no joy.
The field is a File field with no other specific configuration.
...

I've tried setting the link display as URL to File as that's all I need, but it still wont render out the URL.


texts: Submit to external url via Ajax & get return

texts:
I need a Drupal form to submit a file to an external server using ajax. I have done the form using Form API and I am able to submit it via Ajax, But the Drupal throbber never stops and I am not able to get the returned value. But in firebug I can see it to be returned.

My Code:

function upload_video_episode($form, &$form_state){

     $form['files'] = array(
        '#type' => 'file',
        '#title' => t('Video'),
        '#description' => t('Upload a file, allowed extensions: mov, mp4, avi, mkv'),
      );

     $form['submit'] = array(
           '#type' => 'submit',
           '#value' => t('Submit'),
           '#ajax' => array(
           'path' => url('http://web.com/test.php', array('external' => true)),
           'callback' => 'upload_video_test',
           ),
      );

    $form['#action'] = url('http://198.199.95.235:8080/dev/test.php', array('external' => true));
    return $form;
}

function upload_video_test(){
    return "Done!";
}

The throbber just keep rotating non-stop.

However, in firebug I can see the form have been submitted and values returned.

Console seems to be showing some error, possibly related to Non-Origin. But in my case the data is already submitted.

Error: Permission denied to access property 'document'

Is what I have done so far correct?
I want to get the returned value and store it in a hidden form field or something.
Or is Drupal Form API not capable of handling external urls?

Any help would be highly appreciated.


texts: drupal_mail_system is returning empty object

texts:
I have installed mime module for sending html mails. Im receiving Drupal security update on my site but not sending/receiving any mails through my code.

$settings = array(
  'id' => $my_module . '_' . $my_mail_token,
  'to' => $email_to,
  'subject' => $email_subject,
  'body' => $email_message,
  'headers' => array(
    'From' => $conf['FROM_email'],
    'Sender' => $FROM,
    'Return-Path' => $FROM,
    'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
  ),
);

$system = drupal_mail_system($my_module, $my_mail_token);
if ($system->mail($settings)) {
  print 'success';
}
else {
  print 'failed';
}

I tried to print_r($system) which is supposed to return object of mail system interface but all I received was HTMLMailSystem Object ( ). What am I missing?


texts: Drupal 8 separate pages for separate taxonomy terms

texts:
I have two taxonomies. I want different page templates for each taxonomy term page. Lets call the taxonomies as taxonomy_one and taxonomy_two.

When I go to taxonomy term twig debug suggests following names:

<!-- FILE NAME SUGGESTIONS:
* page--taxonomy--term--2.html.twig
* page--taxonomy--term--%.html.twig
* page--taxonomy--term.html.twig
* page--taxonomy.html.twig
x page.html.twig
-->

Is there any way to override the taxonomy term page template by adding twig file such as:

page--taxonomy-one--term.html.twig?


texts: Show more in Autocomplete reference content than the title (id)

texts:
In the Edit Content Page I try to see in the autocomplete field of type reference not only the title (node reference + ID) but also another field of my chose. Can I do that in Drupal 8 trough a view?

I tried already this with a view and now i can search the right reference but i cant see the other field. I write in the autocomplete field the content of the other field and I can see the right title (ID), but I can't visualize the other field itself.

I want to do this because I have many content with the same name and when I have to choose a reference to the right one I need to distinguish them trough another field directly in the autocomplete.

I already tried what this other answer suggested but without luck: Show node IDs along with titles in Entity reference Autocomplete list
And also this one: Node edit form with entity reference - show more than just the title in the autocomplete box

Can be a bug in Drupal 8, or am I missing something?


texts: Display message-form in between two forms (without user-interaction)

texts:
I have an application where I can show forms depending on the flow of the process.
The managing process lets the forms communicate via de Session-data, the forms are rendered in the Controller on a standard-way.
Sometimes the period between two forms is long and I want to inform the user that his data are being processed, without having the user to confirm this step.
I managed this by introducing an other form which is shown in between. This form submits itself by using Javascript (
window.onload = function autoSubmit(x){
        try{
            document.getElementById("myobita-busy-message-form").submit();
        }catch(e){
            alert(e);
        }
}
)
To make it more perfect I would like this form to be a modal.

Can someone tell me/hint me how to invoke a form via the controller as a modal (po-up)??


texts: I need to control access to a Views-generated JSON feed with OAuth (Drupal 6)

texts:
I'm looking for a way to control access to a Views-generated JSON feed via OAuth, so individual users from a partner site can authorize access to certain of their profile data for use by the partner.

At this point, it seems clear that I need to use the services module with its attendant OAuth authentication to create a server that can hand over JSON. Is there some way I can use views to drive a server?

Is there a better way to approach this?


texts:
I have 2 fields that each can have multiple values. I want to count the number of values for a given content type (Actions). Using aggregation everything works fine when the display/view has one field but when I add subsequent fields the results do not come close to adding up.

Record 1 => Field a has 2 values selected, field b has 4
Record 2 => Field a has 4 values selected, field b has 6

Result should be ... Field a = 6 and Field b = 10


texts: Adding a field to users from a module.install file

texts: Is it possible to add a custom field to users from a module.install file, as it would be done from admin/config/people/accounts/fields?


texts: Different image for markers and cluster markers Openlayers

texts:
I want to display different markers for different event types eg. skiing (little guy on skis), sailing (little boat). I am using views so this shouldn't be hard.

The fun starts when clustering. I want to use a marker with a the number of "sub" markers clustered. Also easy. But how to do this and then swap to the icon markers when zoomed past the clustering?


texts:
I upload multiple images to a node using one content type image field. I need to render the file name for each image under the image when viewing the node, all I get at the moment is just a page of images. Tried a view but that REALLY screws everything up. Any ideas how this can be done on the node?

Thanks.


texts:
is it possible to include multiple jquery files like this one ?

(function ($) {
  Drupal.behaviors.mymodule = {
        attach: function(context) {
    //my code
        }
    }
}(jQuery));

I use this to include the files

drupal_add_js(drupal_get_path('module', 'mymodule') . '/js/mymodule.test1.js');
drupal_add_js(drupal_get_path('module', 'mymodule') . '/js/mymodule.test2.js');

both files are loaded but it seems that only the first is executed while test2 is ignored

can you help me with that ?

thanks


texts: Views date field does not follow custom date format

texts:
I have a custom date format defined (via code), and this is what I see in the administration pages:

Custom Date Formats (png screenshot)

In views, I've attached a field, and trying to use a formatter, but they're all showing up like this:

Views Date Format (png screenshot)

I can't seem to select my m/d/y feature, and even the default (short, medium and long) are strange. I have tried clearing caches, and the usual. The view is being exported with a feature, and I have not tried recreating it, yet. Any ideas?

Here's the code generating the custom date format:

/**
 * Implements hook_date_formats().
 */
function custom_date_formats()
{
  $formats = array();

  $formats[] = array(
      'type' => 'm_d_y',
      'format' => 'm/d/Y',
      'locales' => array(),
  );

  return $formats;
}

/**
 * Implements hook_date_format_types().
 */
function custom_date_format_types()
{
  return array(
      'm_d_y' => t('m/d/Y'),
  );
}


texts: How can I change label visability for fields with BaseFieldOverride in hooks?

texts:
I have a hook where I change label visibility on each field, however I'm not able to do it on fields with BaseFieldOverride (like "Authored by" and "Authored on"). Their fields are always hidden, but I want to have them displayed.

Example

my_module_form_alter(&$form, FormStateInterface $form_state) {
  $build_info = $form_state->getBuildInfo();
  $entity_form = $build_info['callback_object'];
  $entity = $entity_form->getEntity();
  $field_definitions = $entity->getFieldDefinitions();
  foreach($field_definitions as $field_name => $field) {
    // For some fields I will render them as display instead of as form field, like this
    $form[$field_name] = $source_field->view();
    // But for the once that have field definitions instances of BaseFieldOverride, I can't set the label to be put above.
  }
}


texts: Node Add / Edit Options Vertical Tab Problem

texts:
For just one of my content types -- the built-in Article content type -- the node option vertical tabs at the bottom of the add / edit form are not displaying correctly.

As shown in the attached screenshot, the first node option for whether to create a menu link for the node is displayed as a tab. All other node option fieldsets are displayed WITHIN the first vertical tab as collapsible fieldsets, not as additional tabs. This only happens for the Article content type.

I cannot figure out why this is happening. Clearly, some module is form_altering the node add / edit form, but I have no idea which one or why only for Article.


texts: I have added two new fields (a Viewfield and a simple text field), and I would like to display these fields in the Inbox (/messages) along with the existing Subject, Participants, and Last Updated data. How can I add those fields to that page ? Is there a tpl format I could use ?


texts:
We all know that its possible in Drupal to set different language on different nodes, but is there any option available from which we can set the language on the basis of URL?

For an instance, we can switch themes in Drupal on the basis of URL:
https://drupal.stackexchange.com/a/816/3808


texts:
I have a multilingual Drupal site in english & french. At the bottom of every page is the content translation link, however I want to place this in a custom location on page.tpl.php.
So if I hide the content translation links in the configuration, how do I call it via a function on the page template?


texts: How to show menu items depending on the user's roles and the node type?

texts: I would like to show some menu items (merged with the main navigation menu) when viewing a node (full content) of a custom content type. Also, this menu items depend on user's roles. It could be something like contextual menu, but with the main menu. For example, I have a custom content type "invoice" and when an user is viewing an invoice, some new menu items should be shown, like "send by email", "pay",...


texts: Remove search form from search result page in Drupal 8

texts: What's the best way to remove the search form from the search result page in Drupal 8?


texts: Drupal function to convert node into Json object

texts:
I would like to know if any drupal function is readily available which converts the node object into Json object so that i can return it in the menu callback function in Ajax call.

thanks,
Ahmad


texts: Print ALT tag from an Image FIeld in a Custom Field Template

texts:
I'm attempting to create a custom field template for an image field with mutliple values. My field name is field_photo_slidshow

My field template name is: field--field-photo-slideshow.php and I've got it coded like this to produce a Flexslider slideshow:

<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
<?php if (!$label_hidden): ?>
<div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;

<?php endif; ?>
<div class="flexslider"<?php print $content_attributes; ?>>

<?php foreach ($items as $delta => $item): ?>
<li class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?>

<?php endforeach; ?>

And this does what I want so far -- creates and unordered list of the rendered images. But now, I want to add an optional caption, derived from the Image fields alt tag -- but I have no idea how to render the ALT tag from a given image in the above code in the field tempalte. That part of the code, in theory, would something like this:

<?php foreach ($items as $delta => $item): ?>
<li class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?>

ALT TEXT FROM IMAGE FIELD

<?php endforeach; ?>

Doe anyone have any idea out to print out that alt text in the field template code?

thank you,
Nathaniel


texts: Cannot seem to get hook_preprocess_page to work in 8.4.2

texts:
Why do I get to the breakpoint in MYMODULE_preprocess_page_title but not in MYMODULE_preprocess_page?

What I am tying to achieve is to update page title both on the top of the page and in the browser title bar/tab name.

The following code only affects the title on the top of the page.

function MYMODULE_preprocess_page_title(&$variables) {
  $variables['title] = 'Something Different!';
}

I've read some people are saying hook hook_preprocess_page instead to update both.

I tried to find what are the available hooks like hook_preprocess_blabla starting here, but couldn't find my way in the documents to the list of available hooks.


texts: Render a content type bundle in a custom module template

texts:
How do I render/display an existing content type form in a custom twig template for a custom module in drupal 8?

I've tried using getform() function, but I dont think that is the correct function.

I have set a preprocessor variable in my custom module and can see the variable on my custom page via the twig syntax {{dump()}}. Just for simplicity, I would like to know, which class function will allow me to simply render the content type 'article' form , once I can see the article form, i can change it to my custom made form.


texts: Problem with image styles : access denied

texts:
I'm getting a problem with image styles being created. The files are there but the styles are not getting created. I have tried changing permissions recursively on the folder (udo chmod -R 777 /Applications/MAMP/htdocs/geoslate/sites/default/files/)but this isn't solving it. I've tried deleting the styles folder but it doesn't get recreated. There is an error in  the log:

access denied
Date    Wednesday, May 1, 2013 - 11:03
User    admin
Location    http://localhost:8888/geoslate/sites/default/files/styles/thumbnail/public/image-file-name-325x250.jpg?itok=zPXsGtyX
Referrer    http://localhost:8888/geoslate/node/1
Message sites/default/files/styles/thumbnail/publicimage-file-name-325x250.jpg
Severity    warning


texts: How to change the logo image dynamically when user change language?

texts:
How to change the logo image dinamycally when user change language by clicking in the flag?
Exist an easy way to resolve this problems?


texts: Is there a way to retrieve DRUPAL TWIG template's with core drupal 8 javascript functions like twig.js?

texts:
Is there a way to get precompiled twig templates from drupal 8?

Example :

Drupal.getTemplate('my-template.twig')(data);


texts: How to make 1 or more of total 4 fields mandatory

texts:
I have 4 decimal fields where user enters can enter price per day, week, month, year. He can choose to enter 1 or more. At least 1 has to be entered of those 4.

Goal is views exposed filter with around 10 filters, all fields in it are mandatory on node creation so there is always result from view, except those 4 mentioned in first place.

Problem is if i add exposed filters for fields day, week, month, year, "betwean" 0 and 100 for each filter, none of the nodes show up on search page (without using the filters yet), as for now, no node has all prices written, and rarely they do. Users usualy put day and week price, or week and month price, or only year price.

On main view page i would atleast like to have all nodes show up with exposed filters in BEF (like they currently do), and then let view when using filters, filter out those who does not have week or month if customers were using filters with those values.


texts: What would cause certain buttons to not appear on specific fields using the CKEditor?

texts:
I am using the CKEditor module for Drupal 6 (not the WYSIWYG module). It's successfully showing the editor on a variety of textareas.

However, on a certain content type the editor is behaving differently on the body field than on other CCK textarea fields. Specifically, several buttons are not appearing on the Body field editor that do appear on other textareas in that same form. Additionally, if I change the button order or appearance in the CKEditor Profile, it does update on the other textarea fields but no the Body field. That field keeps the same button set.

I've tried a variety of things:

Deleted and recreated the Global Settings and Profiles for CKEditor
Tried to forcefully show the buttons via CSS
Confirmed there is no config in sites/all/modules/ckeditor/ckeditor.config.js
Confirmed no JavaScript is acting on the CSS class wrapper of one of the buttons being hidden.

I'm stumped. What else could be causing CKEditor to load for the body field differently?


texts: I am using ECK module to create entity type. Now i want to show property of that entity to be show with views. Is there any way to do it?


texts: page-node-nid.tpl.php is not used as template file

texts:
I am using the following code.

function chgakitheme_preprocess_page(&$vars, $hook) {
  if ($vars['user']->uid == 0 && arg(0) == 'user' && (arg(1) == '' || arg(1) == 'login')) {
    array_unshift($vars['template_files'], 'page-login');
    $vars['body_classes'] .= ' userlogin';
  }

  if (isset($vars['node'])) {
   $vars['template_files'][] = 'page-'. str_replace('_', '-', $vars['node']->type);
  }
}

Now I can use page-nodetype.tpl.php, but I can't use page-node-nid.tpl.php because Drupal doesn't see it.

I need all types of template files. I want a template specific for a content type.

What can I do? Can I do this in Drupal 6?


texts:
Issue

Users will input text that need to be copied into (hidden) meta tag fields when the user have written them into normal fields on the input node.

What I am looking for is either a module to help me with this, a user guide to doing it or an alternative solution to the issue described in the background.

Background

I need to use Meta tags quick to annotate user submitted content on my website.

The user submit article information in normal fields (ie for example an Author field exposed on any node with the article content type). My plan is to to use the Meta tags quick module to create hidden fields and then have those fields filled in by copying content from the user input fields.

An alternative is of course to use the Metatag module but I find it harder to work with and I also need to copy some other fields.


texts: User submitted content in drupal (Drupal Noobie)

texts:
First off, I would like to state that I am a total noobie when it comes to Drupal and do not have a great deal of experience with web development in general.  On the other hand I have a good deal of experience programming in general and will not shy away from some serious PHP hacking.

I am trying to create a webpage that will allow users to submit project files (which will be .zip files) which need to be extracted, then analyzed, then stored.

I would like to have a main ladding page that will allow user to navigate to different types of projects or allow them to follow a link to submit their own project.

So far I have not been able to find many good resources that talk about challenges associated with user generated content.  Can anyone suggest any books, videos, tutorials, really anything that would help me get started on this specific topic?  I own the book Drupal 7 module development, which was a decent starting point but doesn't really offer much information about my specific problem.

Also, any modules that might be helpful for this task?

EDIT:

So far I have been able to create a new content type which can be added using add content and then will show up in one of the main tabs on my basic page.  So far I only allow the user to add screenshots and a title, one big thing I am wondering if how would I handle anything more complex?  So far I have created everything by using the GUI interface under structure->content types but I see no way that I could call some php code after the user has uploaded the project to unzip their project and do whatever else I need to do.  Am I going about this wrong?


texts: Is custom coding faster than Rules when reacting on user creation?

texts:
I'm granting an avatar to the users on my website, based on their gender (cf. this answer). I've been able to achieve this both programatically and with 3 Rules.

This is my custom module:

function custom_user_presave (&$edit, $account) {
    $tid = $edit['field_geslacht']['und'][0]['target_id'];
    if ($account->is_new OR !isset ($account->roles[3])) {
        $avatar = taxonomy_term_load($tid);
        }
        else {
            $avatar = taxonomy_term_load(8);
        }
    $edit['field_avatar']['und'][0]['fid'] = $avatar->field_avatar['und'][0]['fid'];
    $edit['field_avatar']['und'][0]['width'] = $avatar->field_avatar['und'][0]['width'];
    $edit['field_avatar']['und'][0]['height'] = $avatar->field_avatar['und'][0]['height'];
    $edit['field_avatar']['und'][0]['alt'] = $avatar->field_avatar['und'][0]['alt'];
    $edit['field_avatar']['und'][0]['title'] = $avatar->field_avatar['und'][0]['title'];
}

This is one of my exported rules (the second only differs in the action part and the third one checks whether the user has a certain role):

{ "rules_avatar" : {
    "LABEL" : "Avatar",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "avatar" ],
    "REQUIRES" : [ "rules" ],
    "ON" : { "user_insert" : [], "user_update" : [] },
    "IF" : [
      { "entity_has_field" : { "entity" : [ "account" ], "field" : "field_geslacht" } },
      { "data_is" : { "data" : [ "account:field-geslacht" ], "value" : "Man" } }
    ],
    "DO" : [
      { "data_set" : { "data" : [ "account:field-avatar:file" ], "value" : "35" } }
    ]
  }
}

I'm wondering which method is the fastest/most efficient. Can you help me?


texts: Add user note in CiviCRM on behalf membership page

texts:
I have a CiviCRM contribution page form that is :

on behalf of an organisation (required)
used for becoming a member

I need to add the possibility for the member to add a comment on the subscription form.

I tried 2 ways that seems not to work because of current limitations :

adding a custom field for contribution in the profile - doesn't work because of https://issues.civicrm.org/jira/browse/CRM-15787
adding the note field in the profile - doesn't work because the note displayed in the receipt is not always the one added by the user.

I need a quick way to fix this while those bugs are resolved.
My guess is maybe to remove the note from the receipt to avoid problems but how could i do that ?

Any better way of doing this is welcome.
webform is excluded because i am using paypal with redirection for now.


texts: Latest Best Practise: Reusing content/functionality between Drupal 7 sites

texts:
Many of the Drupal 7 websites I make have the same functionality (e.g. blogs, news section, special offers). At the moment, I have to re-create the content types, fields, blocks and Views each time.
I am looking for a better way of working.

There seems to be a lot of modules that can help me, but I'm not sure which is the latest best practice.

Features - The module seems great for exporting content types, fields, menus and views. However, it does not seem to be able to export blocks, block positions or content.

Features extra - This module is designed for exporting blocks. However, on the project page, it says that UUID Features Integration is the future.

UUID Features Integration - This module doesn't seem to work (although A patch is available to fix things). Apparently, it has been dropped in favor of Deploy.

Deploy - This doesn't seem to work with blocks and is designed more for exporting nodes. I'm not really sure how it is a replacement for UUID Features.

Default Content - Another module that seems similar to deploy. (i.e. exports  nodes)

Apps - This seems to be a completely new approach that is a replacement for features. There is very little documentation on how to use it.

StrongArm - A lot of articles state that this module is essential for getting the most out of Features. However, I'm not sure how it relates.

I have searched quite extensively, but there seems to be a lot of conflicting information,

What is the best practice for what I want to achieve?

I would also like something that would work with Drush or a GUI so I can just select if I want a new site to have a blog, news archive special offer etc when building the new site in the first place.


texts:
I currently have a user's profile set up with some extra fields and when that user obtains the role "paid user" an entity is created with a rule and a node that copies those extra fields in the profile is then published.  I'm having an issue however, that whenever I update the user's profile fields, it creates ANOTHER node and leaves the old one.

I'm looking for a solution that will either delete the duplicate node OR will update the current one.

Does anyone have any ideas for this?  I've tried the deduped module someone built for Drupal 7 but it doesn't seem to be working.

EDIT: Here is the second Rule I've created to try to unpublish the older node.

Event: Before saving a user account
Conditions: Entity exists by property(Entity type: Node, Property: Title, Value: [account:field-business-profile])

Data comparison(Parameter: Data to compare:[account:field-bus-name],Data value:[account:field-business-profile:title])

Actions: Unpublish content(Parameter:Content:[account:field-business-profile])

EDIT2: I've updated the second rule to rooby's edits.  The original content remains published though.  I've tried going back and forth between the account-business-profile:nid and account-unchanged-business-profile:nid to no avail.
Here are some pictures I've uploaded of the rule and the two pieces of content:


texts: Simple news from activate the user after email confirmation click in email

texts:
I'm using the Simplenews module after user received the subscription link through email,when click on the link user automatically subscription the news letter.

I don't know how to do this. I checked the setting there is no default activation option.


texts: How do I use message stack (or other) to send new blog post (nodes) to "email-only subscribers" like Wordpress?

texts:
How can we set up Drupal 7 to let someone simply put in their email and then receive an email notification every time a blog (node) is created?

In my ecosystem I already have rules, views, CiviCRM, and the message-stack/flag, but do not see a clear and easy way to do this without forcing the user to register an account, flag the content, and receive a rules-based email that way.

To summmarize: We want an anonymous user to put in only their email, and then receive an email every time a blog node is posted, automatically.

I am using Drupal 7.


texts: The Mobile theme module conflicts with the default cache

texts:
I am using the Mobile theme module in order to load a specific theme in the mobile devices. when I enable caching, the module does not work properly.

More specific, when a page is first visited from a a mobile device for the first time, it will always come up with the mobile theme, even when it is not visited from a mobile device. When a page is visited from a desktop device for the first time, it will always come up with desktop theme even for mobile devices.


texts:
I want to migrate taxonomy terms from a legacy database to my drupal 7 installation. This is working almost as desired. What I do is basicly define a mapping as described in any migration example, e.g.:

$this->addFieldMapping('name', 'legacy_name');

But when I try to migrate dates I totally fail. This does not work:

$this->addFieldMapping('field_date', 'valid_from');

After some digging I found out I had to enable the Date Migration module, allright. But still, this does not work at all. I discovered some date migration example code and found out I have to reformat the date field in the prepareRow() function. But that feature is very much undocumented. The linked example doesn't work at all.

My current code looks like that:

abstract class MyBasicMigration extends Migration {
  public function __construct() {
    parent::__construct();
  }
}

class MyMigration extends MyBasicMigration {
  public function __construct() {
    parent::__construct();

    #[...]

    $this->destination = new MigrateDestinationTerm('mystuff');
    # this works:
    $this->addFieldMapping('name', 'legacy_name');
    # this does not:
    $this->addFieldMapping('field_date', 'valid_from');
  }

  public function prepareRow($current_row) {
    # checks for malformed date strings in DB and converts to datetime type
    if (($current_row->valid_from = strtotime($current_row->valid_from)) === false) {
      $current_row->valid_from = strtotime('1970-02-01');
    }
    if (($current_row->valid_to = strtotime($current_row->valid_to)) === false) {
      $current_row->valid_to = strtotime('2037-12-31');
    }
    # converts the date to YYYY-mm-dd format
    $format = 'Y-m-d';
    $current_row->valid_from = date($format, $current_row->valid_from);
    $current_row->valid_to = date($format, $current_row->valid_to);
    # creates a date field for the valid_from/to migration mapping
    $current_row->valid_from = array(
      'value' => (string) $current_row->valid_from,
      'value2' => (string) $current_row->valid_to,
      'timezone' => DateMigrateFieldHandler::arguments('Europe/Berlin'),
      'timezone_db' => DateMigrateFieldHandler::arguments('Europe/Berlin'),
      'date_type' => 'datetime',
    );
    $current_row->valid_from = drupal_json_encode($current_row->valid_from);
    # debug result output
    watchdog("PW_TEST", $current_row->valid_from, $variables = NULL, WATCHDOG_DEBUG, $link = NULL);
  }

The date format in database is a string formated like this 2013-12-31.

The prepareRow() function seems to work at all and the watchdog() output looks very good:

{"value":"1970-02-01","value2":"2013-12-31","timezone":{"timezone":"Europe\/Berlin","timezone_db":"UTC","rrule":null,"language":null},"timezone_db":{"timezone":"Europe\/Berlin","timezone_db":"UTC","rrule":null,"language":null},"date_type":"datetime"}

As you can see the returned JSON string includes the correct dates. But at some point now the migration mapping fails at the fields valid_from and valid_to.

If I do a print_r() on a migrated taxonomy term, I get something like that:

[field_date] => Array
    (
        [und] => Array
            (
                [0] => Array
                    (
                        [value] =>
                        [value2] =>
                        [timezone] => Europe/Berlin
                        [timezone_db] => Europe/Berlin
                        [date_type] => datetime
                    )
            )
    )

The JSON object got mapped correctly, date_type and timezone just displays properly. But where the hell are my dates gone? Any ideas?

I've been working on this all day now and I can not see any issues with my code. Thanks for any hints!


texts: How can I force the user to select dates that have passed when using the Date picker in the form API?

texts:
I need to use a pop up date picker from the Date module in the Form API.  It's displaying OK, but I want to restrict the user to only have the option of selecting dates that have passed, and not future dates.

How can I achieve this?

Here is my code:

$form['fieldset_one']['date_field'] = array(
  '#weight' => '5',
  '#title' => t('Date of Birth'),
  '#type' => 'date_popup',
  '#date_format' => 'Y-m-d',
  '#date_year_range' => '-80:0',
);


texts: $.POST returns 302 status code with blank response

texts:
I have one field that as currency that is populated on basis of some condition.
I have created a menu_hook and ajax_callback_function which handle the $.POST request.

The request is:

$.post('https://www.somedomain.com/module/currency/' + argument1, null function(response) {
//Logic to handle the response
  $('#node_form_formfieldID').html(response);
});

But In response I am getting 302 status. Saying
https://www.somedomain.com/module/currency/11201    302 Found

How to solve this and get the desired response in the form field.


texts:
When you have a contextual filter in Views and the value is not in the URL, how do you make Drupal actually redirect browser to the default value that you provide, so that the value is reflected in the address bar?

Say you have a view of a company affiliates and the path is: company/affiliates/. If I provide a fixed value such as oregon, I would like the user (= the address bar) to be redirected to company/affiliates/oregon upon visiting company/affiliates/. Is there a way to do that?


texts: Is it possible to use a replacement kernel without hacking core?

texts:
I'd like to use a replacement DrupalKernel.

It looks like the default is hardcoded into index.php, despite the existence of DrupalKernelInterface:

$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');

I suspect the answer has to be no, but I thought I'd ask anyway: is it possible to use a custom kernel class without hacking index.php?


texts: adding data to an existing content type programmatically

texts:
I am sure this question has come up before, but right now my google skills are failing me.  I am trying to create a migration module since I haven't had any luck with either the migrate module or migrate_d2d.  Right now I am trying to populate a content type with the data from my field remap, but I can't find out how to do it.

would a simple db_insert work or is there something special I need to do to generate the field data?


texts: Show if there are 'new' comments on a view of terms?

texts:
I have comments on nodes that are categorised by terms. I need to show a view of the terms and if there are any new comments in any of the nodes that term is tagged with.

So if I have the following:

Term1
-NodeA (has new comments)
-NodeB (has new comments)
Term2
-NodeC (no new comments)
-NodeD (no new comments)
Term3
-NodeE (no new comments)
-NodeF (has new comments)
Term4

I need my view to look like this:

Term1 – new comments!
Term2
Term3 – new comments!
Term4

First I tried making a view of comments to include the new comments field and using relationships to show the terms. However if a term has no nodes or comments (Term4 in my example) I need the term to still be displayed.

So I then tried making a view of the terms. I added the relationships 'Taxonomy term: Content with term' and the field 'Content: New comments' which uses this relationship. This does show the number of new comments as expected. It gives me duplicated results (which I may be able to fix with grouping fields) but unexpectedly it also hides the terms that have no comments or nodes.

Am I going about this the right way and if so how can I stop the 'empty' terms being hidden?

UPDATE Ive updated D core and a few modules that had new versions (but not views). The view works fine with the relationship of 'Configure Relationship: Taxonomy term: Content with term' when the field is 'Content: Title (Title)'. However when I add the field 'Content: New comments' then terms that have no comments are hidden.

UPDATE Ive tried the following in a views field:

if(intval($data->node_new_comments) > 0) {
  if(!array_key_exists($data->tid, $static)) {
    print "new comments !";
    $static[$data->tid] = 1;
  }
} else {
  print "here you do whatever you want when there's no new comment";
}

UPDATE - by 'new comments' I mean comments that the logged in user hasnt read. This is a standard field in views. I need this rather than an arbitrary date cut off. Sorry for any confusion.


texts: Simple Twig conditional not behaving as expected with webform_views

texts:
I have a webform with a Checkbox (i.e. boolean) field called 'Paid'; I'm using webform_views to include and rewrite it in a view (there's some extra code which adds a link to the payment page, but I've stripped that out for these purposes.)

Replacement Pattern section:  {{ webform_submission_value_1 }} == Paid

Format: set to raw value (i.e. 0 or 1 rather than Yes/No)

Twig: (in 'Override the output of this field with custom text')

Value: {{ webform_submission_value_1 }}

Conditional:

{% if webform_submission_value_1 == 1 %}
  paid
{% else %}
  not paid
{% endif %}

Output:

  Value: 0   Conditional: paid

and if edit the form and toggle the value:

  Value: 1 Conditional: paid

NB: the view is more complicated that this and there are other fields, but they all seem to behaving correctly. Also there are access restrictions on the Paid field for non-administrators, but even with these on the View seems to be able to display the value correctly.


texts: Taxonomy child terms as Select options in CCK form

texts:
I have a vocabulary with parent-child terms. Every user is linked to a parent term in their profile field. And, I have CCK that the users fill in.

I need to add a Select Field with options as Child terms of a parent term that the User is linked to. (and save as term ref preferably)
How do I achieve this?

Vocabulary: "Sites"
ONE
 -a
 -b
 -c
TWO
 -d
 -e
THREE
 -f
 -g

User1 => profile field term ref => "ONE"
User2 => profile field term ref => "TWO"

CCK type: "Study"
node/add/study  =>  select field (term ref) => "Select Site"
for User1 => Select site options => a, b, c
for User2 => Select site options => d, e


texts: How to resolve the negotiated theme for any other user?

texts:
I have found How can I programmatically get the theme name?, which works for the current user, but would I apply such logic to learn what theme another user would use?

I can get the active theme for current user and the default theme by using:

$my_theme = \Drupal::theme()->getActiveTheme();
$default_theme = \Drupal::config('system.theme')->get('default');

I was hoping there would be something like \Drupal::theme()->getActiveTheme($other_user); to discover what theme another user would be using.

Is such a thing even possible and how?

UPDATE

To clear things up, I am attempting to figure out what theme was negotiated for a certain user. This could be the global default theme, but it could also be the theme that was negotiated based on a certain role, user selected theme, or any other contrib theme negotiator that might be in place.

So the better question would be, how can I discover what theme a user would be presented if he visits the site (no specific page)?


texts: How to use "user logged in" as an access argument for a MENU_CALLBACK?

texts:
I would like to require that users be logged in to access a particular MENU_CALLBACK.

The following works, but only for the admin account.  Regular users are still denied access:

'access arguments' => array('user_is_logged_in')

There must be an access argument that just checks for authenticated users?


texts: How do I use theme('links') with nested arrays?

texts:
I want to render the following output:

link 1

link 2

sub-link 3

link 4

I was expecting this to be pretty straightforward:

$list = array(
  'item1' => array('title' => 'link 1', 'href' => 'url1'),
  'item2' => array(
    'title' => 'link 2', 'href' => 'url2',
    array(
      'item3' => array('title' => 'sub-link 3', 'href' => 'url3'),
    ),
  ),
  'item4' => array('title' => 'link 4', 'href' => 'url4' ),
);

$output = theme('links', array('links' => $list));

This outputs the following however, ignoring item3:

link 1

link 2

link 4


texts: How to create a Pie chart using views google chart tools

texts:
I am using the Google Chart Tools module to create a pie chart of cricketers runs wagon wheel.

I am facing a problem with the creation of a pie chart for creation of wagon wheel. I have cricketer content type which has these fields:

Name
Mid-On-Score
Point score
Mid-off-score
Gully Score

Now I want to create a pie chart (i.e wagon wheel of scored runs by each individual cricketer). So that it shows me a pie chart which will have areawise score.

I have created a view for this and used Google Chart Tools trying to create a piechart for this. But it is not showing the pie chart correctly.

I have done correct configuration but the pie chart shows only first field in whole circle and other fields are not shown.

Here is an image with a Column chart:

And here is a similar image with a pie chart:

In the above pie chart, it should show me colored regions (slices) but it's not showing.

What am I doing wrong or does pie chart not have such functionality?

Note: it is showing other charts correctly.


texts: Assign menu programmatically upon saving node

texts:
I'm using Superfish module for my menu. I have product parent menu where I need to display the 3 categories as sub-menu. Those 3 categories has been added to the menu with the help of Taxonomy menu module.

I would like to assign a menu automatically based from the nodes category.

For example:-

"Node 1" has "Category 1" term, then the node menu will be assigned to "Category 1". Something like below:-

-Product
 --Category 1
    ---Node 1
    ---Node 2
  --Category 2
    ---Node 3
    ---Node 4


texts:
How do I get the URL alias of a node in views.

Here is a previous question, Get a url alias as a field value?
However, the Content: Link field outputs something along the lines of

view

I want to wrap the link around another field using rewrite results and tokens.  Something like

[product:image]

I was able to do this with

[product:image]

However, I would rather have it show the node alias than the node ID.


texts: ModSecurity problem: How to resolve that 404 error page?

texts:
I have installed Drupal 7 on latest version of Nginx web server which was completed with the support of the ModSecurity module. I have activated the core OWASP rule set, but when I active ModSecurity in my virtualhost configuration file for Drupal 7, logging in, registering, or resetting passwords cause this error:

  open() "/var/www/MY_WEBSITE/node" failed (2: No such file or directory), client: IP, server: MY_SERVER, request: "POST /node?destination=node HTTP/1.1", host: "MY_WEBSITE", referrer: "http://MY_WEBSITE/"

The browser gets a 404 error page.

I found some solutions for Apache Server which modify the .htaccess file, not used from Nginx; I didn't find any solution for Nginx.

How do I solve this problem? Is there any ModSecurity rule I have to disable, or change?


texts: Scheduling unpublish too complex for existing modules

texts:
I need a specific node type to automatically unpublish 3 months after publishing, but the date of unpublishing needs to remain constant even if the user unpublishes and republishes the node, unless the date is passed in which case it should start again.

Whenever the timer is reset a notice should be sent to the admins, and the date of scheduled unpublishing should be editable by the admins.

Needless to say this is too complex for any current modules, and when I think of writing a module to do it I don't know how to use the drupal api to schedule things with cron, or how to create an administration settings interface to handle the unpublish dates.


texts:
In a panel, I'm trying to add a view block and I'm trying to translate my views title  l but it's not displaying anything or translating. Below you can see my settings in my panels.

If I dont override the title, it's still blank. I dont see the English or the FR translations.


texts:
I want to migrate on my Drupal 8 website a file CSV which contains taxonomies terms.

Its a simple file with id,name.

I create a module:

name: 'Taxo Migration'
type: module
description: 'Migration taxo'
core: 8.x
package: 'Custom'
dependencies:
  - migrate_source_csv
  - migrate_plus
  - migrate_tools

and file : /config/install/migrate_plus.migration.migrate_csv.yml

id: migrate_csv
status: true
label: Migration test
dependencies:
  enforced:
    module:
      - krn_migration
migration_tags: null
source:
  plugin: csv
  track_changes: true
  path: '/modules/custom/krn_migration/data/test.csv'
  header_row_count: 1
  keys:
    - id
  column_names:
    0:
      id: Identifier
    1:
      name: Name
process:
  vid:
    plugin: default_value
    default_value: migration
  name: name
destination:
  plugin: 'entity:taxonomy_term'

I active module, i verify that configuration is imported, i rebuild cache but when i check migration

drush migrate-status

Nothing is shown

$ drush migrate-status
 ------- -------------- -------- ------- ---------- ------------- ---------------
  Group   Migration ID   Status   Total   Imported   Unprocessed   Last Imported
 ------- -------------- -------- ------- ---------- ------------- ---------------

Can you help me ?


texts: How do I add a suffix to the price field?

texts:
I'm using drupal commerce in my current project, I want to display the price like "$299 excluding tax/month", but the price field is not editable by default.
there is a way to add this suffix to the price?


texts:
I can't find a way how to get correct URL. Situation :
Lets imagine i have a webpage with 3 tabs/menu entries (views) with titles A , B and C.
Of course i have created  taxonomy vocabulary (lets say named : article_type) with 3 terms A,B,C .

Pattern for all Basic page : [current-page:title]/[node:title] // everything works fine (Page titles are A,B,C) ;

Pattern for Article path : [node:field_article_type]/[node:title] ;

Lets say I create article and choose in tax term A or  B or C , everything is fine ! URL www.example.com/A or B or C/ title of article , but if I want to assign article to not one but 2 or all 3 tax terms (pages) at the same time I am getting a problem with url because it look like : www.example.com/A+B+C/title of article whenever I am in tab A or in tab b or c. So what I need to change in article path to get correct URL path every time?

any other ideas how to solve this?


texts: How to eliminate extra Drupal Logout Link

texts:
Hi, there, I am working with Organic Groups on an existing drupal 7 site. For some reason, there are three log out links. I checked with User Menu, which is not even enabled in this site. How can I find out why there are three log out links?

Any ideas?
Thanks!


texts: Problem Setting up Drupal Site as OAuth Server

texts:
I've been going through OAuth2 Server module setup Documentation/Guidelines for almost 2 days now, and also referred with friend who has this working. But unable to get this working properly.

I've a Drupal 7 Site already in use for quite some time (3-4 years). We're building few more applications (in other PHP Framework - not using Drupal), where we want to use/share users from this existing D7 site. To achieve this, we're making existing D7 site as Authentication Server by implementing OAuth2 Server module and OpenID Connect Single Sign-on module. I've configured it as per documentation provided on OAuth2 Server Page.

As a Test client to quickly setup and test, I've setup Another fresh D7 setup and configured OpenID Connect Module and OpenID Connect Single Sign-on module.

Both these Server and Clients are setup/configured using the Steps provided on OpenID Connect Single Sign-on Documentation and also includes HTTPS in URL (self-signed).

Problem:

Now when trying to login on Client using "Log in with Generic" button provided by OpenID Connect Module, the authentication takes me to Server for login where I put my login details and it takes me back to Client. At this stage I'm logged into Server but not on client.
When debug more about this I found that in client, I receive below log in Recent Logs:

  Location :
  https://client.local.com/openid-connect/generic?code=026ebfd35389b9e3a667a03eb778cdab4d3cc3e4&state=iNaaCcI4pxxZXssUAIO9gdz2Nm8zG5RbhsQ25azigYw

  Message : Could not retrieve tokens (0 Error opening socket
  ssl://server.local.com:443). Details:

Now, if I go to Client OpenID Connect Module's configuration and change the 3 Endpoints URLs from https to http and try to login and follow the steps, I'm able to login. (Note: Server is using http and client is using https - In this case, it asks to login 2 times, one on http and another on https).
Another problem I'm facing after #2 is, when I'm trying to login/logout from client site, it takes me to server or vice versa and only one (either server/client) shows latest updates about login/logout, where I've triggered the event.

Other information:

OS: currently Windows 8 with XAMPP (production uses CentOS)
Drupal Version: 7.52/7.53
PHP Version: 7.0.3

Any help is greatly appreciated.

Edit 1:

Added debug info for #1.
I've also tried configuring another clean Drupal installation as OAuth2 Server, but in that also I'm facing similar issue.

Edit 2:

After some more research found this issue, which mentions that

  The behavior of drupal_http_request() changes, because PHP 7 has
  changed the defaults regarding the ssl options.

  This makes code fail that relies on issuing a http request to a https
  version of a site, which uses a self-signed certificate.

After applying changes in issue for 'context', Problem 1 and 2 seems to be fixed. i.e. User is getting logged in both Sites, and authorization is working with https enabled endpoint URL as well.

But Problem 3 remains there, i.e. when user try to login in client it take user to server for authorization and stays in server only. User is not re-directed back to client.


texts: How to add template suggestion for user--VIEW-MODE--ROLE.html.twig

texts:
I used hook_theme_suggestions_HOOK_alter:

function MYTHEME_theme_suggestions_user_alter(&$suggestions, $vars, $hook) {

  // Define the view mode.
  $mode = $vars['elements']['#view_mode'];

  // Create a theme hook suggestion which has the view mode name in it.
  $suggestions[] = 'user__' . $mode;
}

Now I can work with user--full.html.twig and user--compact.html.twig

But I have a role editor and I want to user--compact--editor.html.twig to be picked up. How can I add a template suggestion based on user roles?


texts: How to hide username displayed in code with Omega 3 theme

texts:
Drupal 7 with Omega version 3 theme generates a username class for the article tag in the HTML code, something like :

class="node node-page node-published node-not-promoted node-not-sticky author-USERNAME odd clearfix".

I'd like to avoid having the username displayed in the code for security reasons.

After investigating, this comes from the code "omega_alpha_preprocess_node()" in the "sites/all/themes/omega/omega/template.php" where you find the following line:

"$vars['attributes_array']['class'][] = drupal_html_class('author-' . $vars['node']->name); "

I copied the code of "omega_alpha_preprocess_node()" to the "template.php" of my Omega subtheme, I renamed the "omega_alpha_preprocess_node()" to "MYTHEME_alpha_preprocess_node" and removed the line "$vars['attributes_array']['class']". Unfortunatly, it does not work.

As of today, the solution I found is to remove the line "$vars['attributes_array']['class']" from the initial Omega template.php file, which is not the best practice, but it works and the username output as a class of an article tag is no longer displayed.

Can someone help me find a more elegant solution, as I'm not a very experienced Omega developer and I need guidance? Thank you.


texts: entity_load_multiple returns empty array although an eitity lives in the database?

texts:
I am trying to debug something related to an issue I am facing. The bottom line is that entity load is not returning the peroper values for some reason. For example:

$cids = array(119570363);
$comments = comment_load_multiple($cids);
dpm($comments);

return an empty array although the comment with id=119570363 exists in the database. I traced entity load function the the comment controller which inherits the load method from DrupalDefaultEntityController.While looking at the method I failed to notice anything that would cause this. Perhaps I am missing something. Are there implicit conditions on the load? Also, I tried with both $reset = FALSE and $reset = TRUE .


texts: Navigation block title no longer defaulting to user name in d7

texts:
The default behavior for the Navigation block in d6 was to replace the word Navigation with the user name.  It appears that this logic was removed from the core user module in d7.  My client stills wants the user name to display.  Is there a way to duplicate this same behavior in d7 ??

What complicates things a bit is that we are using a mini panel that includes that block but I haven't figured out a way to override the title with the user name.  I've tried using the user:name token as the Navigation block title and then overriding the title with %title but it displays the literal value 'user:name' instead of the actual user name.


texts: How do I put username into email when send mail to role in Rules?

texts:
I'm using Rules 7.x-2.11 and create new rules. I created additional fields in profile and when user select there from option list he got a new role.
Next, i created new rule. When create new node with certain type drupal send mail to all users with this role.

EVENT
Node insert

CONDITIONS
Node is of type

ACTIONS
Mail to users of role

It works, but i need put in email text username. In data selector i have only "node" and "site" selector's, how can i get "account" selector?


texts: Sign out not working properly in OpenID Connect

texts:
I have integrated OpenID Connect(Generic), where my Signin was successful(Redirects to destination server, provided credentials, redirect to drupal & authenticated).

While i make Sign out, it was successful. But what i found is, log out happens only at drupal side whereas my destined server session still exists(I have checked it by relogin in drupal, it was authenticated without providing credentials).

Is there is any option to log out from both Drupal & destined server?


texts: Image styles: Does not work with large images

texts:
The image styles, thumbnails and so on, are not created on my Drupal 7 site, when the original file is bigger than 5 MB. I did not find any error message in the log messages and the v-server, the site is hosted on, seems to have sufficient power to convert large files: I have 4 GHZ CPU and 4 GB RAM.
The original file is uploaded correctly and I have double checked the file permissions.

Does anybody know, what to do?


texts:
In one demo projects I have found that I need to place same block in two different regions.
I have the knowledge that one block can be placed to one region only.
Can anyone help me with this ?


texts: In views, what is the difference between Normal menu entry, Menu tab and Default menu tab

texts:
When adding a menu item in views I see three selections that are ambiguius

Normal menu entry

Menu tab

Default menu tab

What is the difference and when would I use each?


texts: Display last 3 articles in 3 columns layout in Homepage

texts:
I would like to erase the welcome message on my homepage and to do that I need to add the last 3 articles created which will be stored in 3 columns like : [article1][article2][article3]

Any ideas to do that? Maybe with Display suite or Mini Panels something like that?

Thanks!


texts: preventing access to php files using htaccess doesnot allow ajax to use php files

texts:
i am using the following code in .htaccess to prevent access to php files from the browser

<Files ~ "\.php">
Order allow,deny
Deny from all
</Files>

the problem whit that is that when i deny access to php files ajax cannot use those php files either... how can i solve this... any help would be appreciated... thanks in advance... :)


texts: Exclude taxonomy term from view display except its own?

texts:
I work on a news publisher site and I need help excluding a taxonomy term from view but still to keep it with its own page.

E.g. Our content is organised by theme and region. For one set of articles I've added a certain tag to it. I would like to exclude articles with this tag from all region and theme view display pages, but still maintain a page with only this tag's view display. So that these certain articles will not display on the theme and region displays (though they are organised into such categories), but still display on the tag page.

So exclude tag: xyz from all pages except www.site.com/xyz

My problem is that when I filter criteria for the tag, it removes all articles from the tag's own landing page.

It would be simpler to just not give these certain articles regions and themes, but we need these to be organised as such on the back end and for future use.

Thank you in advance!!


texts:
I wanted to add another submit/save button above a node form (for only one content type) and added the code below. The thing is that it messes up the submission, so I had to remove it.

Whats wrong with it and is ther a better way of doing this?

if ( $form_id == 'news_node_form' ) {
        $form['submit'] = array(
                '#type' => 'submit',
                '#value' => 'Save'
                );
        }


texts:
I have a few template node overrides in my theme using Drupal 7.

For example: page--node--53.tpl.php

This might be a lazy request, but is there anyway to name these files instead with the alias I have chosen rather then using the node number? That way I don't have to memorize all of the associated pages.

For example page--node--about.tpl.php


texts: How to Migrate static html files to Book - Migrate Module

texts:
I have almost 5000 static html files which belongs to different books.Please give me some direction How to migrate this html files to book.

I am able to migrate html files to Drupal.

But how should i update this Nodes to particular Book during migration.

Thanks a lot for the help!!


texts: Error: Call to undefined function in inc file

texts:
I searched for an explanation to this issue but didn't find anything. I have other sites where this is working but not in this one.
So, my module info file (draws.module):
name = draws
description = Draws custom module
package = Draws Modules
core = 7.x

files[] = draws.fixturesSavings.inc

In my draws.module I have this function (lines 289 to 231):
function saveToDatabase($response) {
    fixtures_saveToDatabase($response);
}

And then in the same folder of my draws.module I have the inc file (draws.fixturesSaving.inc):
<?php
function fixtures_saveToDatabase($response) {

And when I call function saveToDatabase, I get the following error:
Error: Call to undefined function fixtures_saveToDatabase() in saveToDatabase() (line 290 of /home/.../sites/all/modules/custom/draws/draws.module).

What am I doing wrong here?


texts: Is there any log or receipt or anything that message was sent to someone?

texts:
I'm in a situation where I'm supposed to testify (= proof) that a message (confirmation) was sent from our site (using Drupal 7).

Is it possible to see it from anywhere? Does it register into hosting provider or something like that?

I tried looking at the log files on the server, but they didn't include anything regarding this message; the Drupal system log was one month ahead that time when the message was sent.

A custom message (confirmation) is sent with Rules when user makes an order and registers as user (of which all is done via customized "Add node" form).


texts:
I migrated my reference module to the Entity Reference module and now i see we lost all the references to the nodes and since there with so much, i was thinking about doing it with rules and VBO.

We have the following content types that needed to be linked:
Album,
Band

Album has a node reference field that links to a band-type.

The thing is, a band has multiply albums linked to it, now that's where I got stuck, I need to get a list of albums(no issue with views) and then I need to select the band to link them to and then I should change it with rules, to link em back..

I've already looked at a few related questions, but non do exact what i need...

I'd be very happy if somebody could point me into the right direction.


texts: Is there any other way to store values in DB other than 'system_settings_form'?

texts:
On change(using AJAX) of Job title the text area will show and admin will enter text in admin form. By using system_settings_form I am storing values in DB using Variables.

PROBLEM:

I have more than 20 values in the dropdown.
For this I need to store the textarea values in a variable.
This leads to huge values stored in variable table.

Is there any other way rather than using this, or is this the best way of using?

I am just checking all the possibilities.

Any Ideas will be much appreciated, Thanks.


texts: How to import a template file with HTML markup to use for sending email notifications?

texts:
I want to send the email notifications to users of the site. I have a basic template file with the HTML markup I want to send in the email.

How do I import that HTML file (which is in the root folder of the project) in my module?


texts:
Hoping for some ideas on how I can create chapter titles to a group of videos that I have on my Drupal 7 site.

Currently each video series is shows with a custom view and grouped with a taxonomy term. I have each video weighted to then display them in the order that I want. Everything works fine. I just need to break them up and create "chapters" to better organize them.

An example of a page on my site can be seen here.

And example of what I am looking for:

Heading
-Video 1
-Video 2
-Video 3
Heading
-Video 4
Heading
-Video 5
-Video 6


texts: Show multiple drupal 7 'name field' in one view row?

texts:
Using this on D7: https://www.drupal.org/project/name

The name field is on a 'book' content type. 1-to-many authors.

In views, I want to see the name of the book, and the authors. Currently, it shows one repeat row per author. How do I consolidate them into one row? The field setting does not seem to include anything for this.

Thanks, sorry if this is noob of the century territory.


texts: Saving file not working with rules module

texts:
I want to execute some custom code when going from state A and B. I'm using the rules module and workflow module and trigger when changing state.

This works but the custom code that I want to run generates a PDF file and attaches the new file to the node which executes the state change. But the node is never saved? I have verified that my code works by calling it from devel, which works like a charm.

Is there any behavior in rules or workflow that prevents me from saving my node?

This is a short version of what my code does:

function my_module_my_function($workflow) {

$node = node_load($workflow->nid);

//////////////////////////////////////////////////
//////// Create PDF here
//////////////////////////////////////////////////

// Save generated invoice into drupal
$file_content = file_get_contents($pdf_filepath);
$file = file_save_data($file_content,'private://pdf-file.pdf', FILE_EXISTS_RENAME);

// Prepare invoice struct
$prepare_field_file_doc = array(
               'fid' => $file->fid,
               'filename' => $file->filename,
               'filemime' => $file->filemime,
               'uid' => $workflow->uid,
               'uri' => $file->uri,
               'status' => 1,
               'display' => 1,
               'description' => t('Some text here'),
               );

$node->field_bestallning_faktura['und'][0] = $prepare_field_file_doc;

node_save($node);
}

Lastly, here is my rule

{ "rules_test2" : {
    "LABEL" : "test2",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "php", "workflow" ],
    "ON" : { "WorkflowTransition_presave" : [] },
    "IF" : [
      { "data_is" : {
          "data" : [ "WorkflowTransition:workflow:name" ],
          "value" : "workflow_test"
        }
      },
      { "data_is" : {
          "data" : [ "WorkflowTransition:old-state:name" ],
          "value" : "statea"
        }
      },
      { "data_is" : {
          "data" : [ "WorkflowTransition:new-state:name" ],
          "value" : "stateb"
        }
      }
    ],
    "DO" : [
      { "php_eval" : { "code" : "my_module_my_function($WorkflowTransition);" } }
    ]
  }
}


texts: How to get rid of large classes with numbers from views?

texts:
Which is the purpose of classes like that one:

class="js-view-dom-id-0fc70eec09ba01f6b7c7867ee7e19f7dcec1ee8b64de9dc8b791865caf299ec7"

It's safe to change this class from twig templates?

Thanks.


texts:
Im using D7.24
I downloaded admin_menu module (I tried also previous releases) but when trying to enable it I can't, and I get this info message in the description module field :

  Requires : System (>7.10) (is incompatible with version > 7.x-1.0-beta3) Required for : Administration menu Toolbar style (disabled)

I searched about this problem but I did not found anyone has this problem before!

Thanks in advance

EDIT:
This is the info that I get in status report :


texts: Can add the new variable in the existing node--contenttype.tpl.tpl?

texts:
I have written the query in .Module file and stored the output in a variable.

Now, I want to pass this new variable in existing node--contenttype.tpl.php

My idea is to pass the variable for the existing node.tpl.php using hook_theme function

Is that a good way to achieve it or anyone has a better way for it ?


texts:
Why I can't access "Recent log messages" (via /admin/reports/dblog)?

It's not listed in the Admin Menu. And when I try to get there directly (via /admin/reports/dblog), I only see the "Reports", as shown via /admin/reports.

I've installed Drupal 7.15 with the OpenPublish Profile.

What could be the solution to this problem?


texts: Autocalculated price field depending on language

texts:
I need field for my own content type that will show price in currency depending on chosen language (from i18n module) calculated by currency exchange rate from currency module.

I've installed money field, but how to connect this to currency exchange?

I need some advice. I'm newbie.

Thanks for any hints, maybe I try to go wrong way?


texts:
I just installed D8, but when I try to reach the Front Page as an authenticated user, I got immediately redirected (302) to the user page. As a anonymous user, it works as expected.

I do not know exactly what additional data I should provide for debugging this issue, but will happly provided any information I can.


texts: I would like to send an email to some users, when i put my Drupal-7 website in maintenance mode. Are there any hooks that allow me to do this? I could not figure it out for myself.


texts: Relation: Translating a node removes its relation

texts:
I have a weird problem regarding the Relation module and translations in Drupal 7. I have types for companies and buildings and I have a relation between company and building that means that the company is situated in the building.

If I have a company A in the default language Swedish and translate it to English the new translated node will work fine, but old node in Swedish will kind of lose its company-building relation (it is still visible in admin, but I can't see it in my views and it has disappeared from the field_data_endpoints table. If I do some changes to the Swedish version and save it, the relation will become visible again, but the English translation will lose it instead.

Any ideas about what might be causing it, or how I should go about finding that out?


texts: Allow markup inside drupal 8 Link function

texts: I always try to use the core functions for linking in drupal, but I'm not able to add html markup like Link text. Any ideas?


texts: Why no alias record could be found when I'm trying to sql-sync the database?

texts:
I'm trying to synchronize a production database to two development installations at once, instead of having the production database dumped twice.

In aliases.drush.inc file I'm defining a site-list alias as following:

$aliases['dev'] = array(
  'site-list' => array('@dev1', '@dev2'),
);

$aliases['prod'] = array(
  'uri' => 'default/prod',
  'root' => '/docroot/prod',
  'db-url' => 'mysqli://root:pass@localhost/prod',
);
$aliases['dev1'] = array(
  'uri' => 'default/dev1',
  'root' => '/docroot/dev1',
  'db-url' => 'mysqli://root:pass@localhost/dev1',
);
$aliases['dev2'] = array(
  'uri' => 'default/dev2',
  'root' => '/docroot/dev2',
  'db-url' => 'mysqli://root:pass@localhost/dev2',
);

Running a Drush command against any of these aliases works fine.

Running drush @dev status works fine too, and displays the status for both @dev1 and @dev2.

However, trying to execute drush sql-sync @prod @dev gives me the following error:

  Error: no alias record could be found for @dev

Do you have any clues?


texts: Add two multiple image upload fields plupload

texts:
This is the problem that i am facing.
I have 2 content types which are company and vacancies. Vacancy has an entity reference of a company.
Company content has a multiple image upload field called "images" created using plupload. vacancy content type also has a field called "vacancy images" created using plupload.

When displaying company content i have written form alter hook to load vacancies content fields programmatically into company content and i have written this form field to load "vacancy images" field.

        $form['field_vacancy_images'] = array(
        '#type' => 'plupload',
        '#title' => t('Vacancy Images'),
        '#upload_validators' => array(
            'file_validate_extensions' => array('jpg jpeg gif png')
        ),
        '#id'=>'field_vacancy_images',
        '#name'=>'field_vacancy_images',
        '#weight' => 12,

  );

But when i do this, image field on company content stop working. and on vacancy field Start Upload button is not appearing. What can be the reason for that?

Can anyone help me? Hope i have clearly  explained the situation.

Thanks in advance


texts: How to customize Number of posts on front page in drupal 8

texts:
I went to URL:

admin/config/system/site-information

I can't find Number of posts on front page settings available there like Drupal 7 has.

I am using drupal 8 version : 8.0.0-dev

any help is appreciated.


texts:
I have two different content types, Computer and Chemistry, and taxonomy terms for all articles (content types) which store the methodology of the article. The taxonomy hierarchy is the following.

Articles

Computer

Arithmetic (Term ID: 1)
DMA (Term ID: 2) // abbreviation for "Direct Memory Access"

Chemistry

NGE (Term ID: 3) // abbreviation for "Noble Gas Elements"
DMA (Term ID: 4) // abbreviation for "Dynamic Mechanical Analysis"

When users are creating or editing a node of type Chemistry, just NGE and DMA (whose ID is 4) should be allowed to select.

I only need one taxonomy vocabulary, since there are too many content types, and if I want to add a vocabulary for each of them, then it leads too many vocabularies; more importantly it removes the ability of freely navigating in different types using taxonomy hierarchy.

How do I limit the allowed taxonomy terms basing on the content type?


texts: Get a message if insert into table works

texts:
The code I wrote that uses db_insert() and db_merge() works great. I can populate the database table well (also using a post http). Now I want to get a success/fail message.

How do I show a message after executing a query?


texts: Displaying image of type BLOB format stored in external database in Drupal 8

texts:
I have created external database on localhost with image stored in one of the columns in BLOB format. Then I interfaced this external database using View Database Connector, created VIEW. I could display other columns like  name, phone etc easily but I could not display the image stored in BLOB format. I used Rewrite Results and wrote <img src='{{ blob_image }}'> where blob_image is the name of the column. I see small green color image icon which we generally see when image is not available.
If I store image path in the column and use above Rewrite Result, it works fine. But I need to store image in BLOB format and display in drupal 8 Views.
If anyone has any suggestion, please let me know. Thanking you in anticipation.
Nilesh Kulakrni


texts: Address field validation-- how to allow only English/single-byte characters?

texts:
Using the Address Field module, I have created a country/state/city formatter to allow users to input their location.

On my site, about half of the users are Japanese.

Address Field provides a select list of countries by default, and I have added select lists for states/provinces.

However, users input cities in a standard text field.  I am using Location Taxonomize to tag users with their cities, so I want all cities to be in the same language (in this case, English).  I already have some help text on the form that asks users to input their data in English, but I'd like to add form validation to make sure.

Many Japanese sites do this by checking whether the user input is single-byte or double-byte; since Japanese characters are single-byte and standard English characters are single-byte, this is sufficient for my purposes.

Is there a function for checking this in the form API?


texts: how to display unique records between two table by using db_select query in drupal

texts:
The following two tables contained reg_no field. how to get unique reg_no records of the student_master table

for example

student_master table

reg_no

MA1001

MA1002

semester_appear table

reg_no

MA1001

but I want to get output only MA1002. how to get the output by using following code

Table : **Student Master**

$query = db_select('student_master');
$query->fields('student_master', array('reg_no','name','dob','dept_code','degree','batch_year'));
$query->condition('dept_code',$dept,'=') AND $query->condition('batch_year',$batch,'=');
$query->orderBy('reg_no','ASC') ;
$results = $query->execute();

Table : semester_appear

$sem_query = db_select('semester_appear');
$sem_query->fields('semester_appear', array('reg_no','batch_year','month','year','subject_code','sub_serial_no','semester_appear'));
$sem_query->distinct();
$sem_query->condition('year',$year,'=') AND $sem_query->condition('reg_no',$reg1,'=') AND $sem_query->condition('semester_appear',$semester,'=') AND $sem_query->condition('month',$month,'=') AND $sem_query->condition('marks_updated',$no,'=') AND $sem_query->condition('batch_year',$batch,'=') ;
$subject_results = $sem_query->execute();


texts: How do I automatically add links on the right sidebar in drupal 7?

texts: Let's say I have a few articles about weight training. How do I populate the right sidebar blocks with related links to current article?


texts: How can I display a page element based upon security?

texts:
If I want to hide or show a DOM element, say a button that can show further information because the logged in user is a manager, how can I do that in Drupal 8?  Do I need to create separate pages for each type of user role?

I saw this but wasn't sure if it was the same thing I was asking,

How can I change page elements (menu, blocks, etc) based on a chosen 'audience' link?


texts:
We are complete newbies to Drupal, so please forgive us if this is a stupid question.  We have googled and googled and cannot come up with an answer.

Basically, we've got a block that has been placed in a region (Hooray, we got that far!)  The problem is that we need to reference an image file that is in the sites/all/themes/[theme]/img directory.  We have hardcoded this for now, but is there a placeholder that we can put in the block content area that will automatically fill in that path?

Are we going about this in the completely wrong way?  We are both very impressed and very overwhelmed with Drupal all at the same time.

Thanks in advance for your help.


texts: How to set all-day date value in a Rules Component

texts:
I have a node with a Date field set to February 8th, 2020 but when I try to set a Date Value as 'Data to Compare' but the date/hour keeps changing. How do I set the data value for all day?

Drupal 7.69
Rules 7.x-2.12


texts: How to hide custom fields on the registration form?

texts:
I have added a lot of fields in the user profile, and sorted them using Gield Groups module tabs. Аnd now when registering the user, on the register form appears all fields and field groups tabs.

How can I hide all custom field and tabs on registration form and leave only email and one of custom field? Or can I create custom registration module with custom module?


texts: Views contextual filter on just ONE of the listed contenttypes

texts:
I'm not sure how I can accomplish this but I hope you can tell me.
I have a view that lists 2 different contenttypes that has different filters.

Now, I want to use a contextual filter on just one of the contenttypes.

Is there any way I can accomplish this?

Best regards,


texts:
i tried to use Taxonomy Term Permissions
module to set permissions on terms, but this module does not work.
After selecting the roles that i want to allow them selecting the specific term and saving the changes, nothing get saved, i tried also to search for a solution i found a version that worked in drupal 7, i replaced it with the first module.
this version has corrected to allow us to select the roles with saving the changes, but when i requested to create a node(go to create node page) the page did not open and show up a message that tell me an error happen in my site,
There is another module like that one above? or is there another way to set  permission on a terms?
thanks.


texts: VBO: Access denied to other users for the first content from the list of publishing content

texts:
While publishing a content (Alert that uses scheduler to publish its content) manually using Views bulk operation I am encountering an strange behavior.

When I selects a single or multiple Alerts to publish (Publish time has been passed ) the first Alert is not getting the right access permission in node_access table i.e.
select * from node_access where nid= 11713;
+-------+-----+-------------------+------------+--------------+--------------+
| nid | gid | realm | grant_view | grant_update | grant_delete |
+-------+-----+-------------------+------------+--------------+--------------+
| 11713 | 990 | nodeaccess_author | 1 | 0 | 0 |
+-------+-----+-------------------+------------+--------------+--------------+

due to that after content published successfully message, when I am opening the published node from any user excepts author and admin, it is showing "You are not authorized to access this page.". But once I rebuild all the permission node_access table is filled with right permission as following
select * from node_access where nid= 11713;
+-------+-----+-------------------+------------+--------------+--------------+
| nid | gid | realm | grant_view | grant_update | grant_delete |
+-------+-----+-------------------+------------+--------------+--------------+
| 11712 | 1 | nodeaccess_rid | 1 | 0 | 0 |
| 11712 | 2 | nodeaccess_rid | 1 | 0 | 0 |
| 11712 | 3 | nodeaccess_rid | 1 | 0 | 0 |
| 11712 | 4 | nodeaccess_rid | 1 | 1 | 1 |
| 11712 | 5 | nodeaccess_rid | 1 | 0 | 0 |
| 11712 | 6 | nodeaccess_rid | 1 | 1 | 1 |
| 11712 | 990 | nodeaccess_author | 1 | 0 | 0 |
+-------+-----+-------------------+------------+--------------+--------------+
and all authorized users are now able to access this node.

This issue is only happening when node is published as bulk operation and only for first selected item. Otherwise if page is published automatically by Cron run or it is in any position other then 1st in the list of bulk operation then its access permission are setting correctly and everything is working fine.


texts: file upload broken on node form on custom page

texts:
Possible Duplicate:
  D7 Image field upload errors with custom node_add() form

I have a custom page with a node form on it. The problem is that when I try to upload an image I get lots of errors.

The code is like this:

module_load_include('inc', 'node', 'node.pages');
$output = drupal_render(node_add('node_type'));
return $output;

Some of the errors I get are:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'node_form' not found or invalid function name in drupal_retrieve_form() (line 795 of E:\work\my_site\includes\form.inc).
Notice: Undefined index: #node in comment_form_node_form_alter() (line 1193 of E:\work\my_site\modules\comment\comment.module).
Notice: Undefined index: #node in menu_form_node_form_alter() (line 630 of E:\work\my_site\modules\menu\menu.module).

The funny thing is that if I return the form array everything works well.

module_load_include('inc', 'node', 'node.pages');
$output = node_add('node_type');
return $output;

Unfortunately this doesn't help me at all.

This is the same problem as in here but the solution there is not an option for me.

Any ideas?
Thanks


texts:
I have two list fields with select widgets and the second select depends on the first one.

How would you do this? Is there a module already doing this at least in code?


texts:
We are trying to integrate the drupal8 login REST api in react. And we are facing the  below issue.
Status code 500: Service unavailable.
And When we checked the error log, we are seeing the following issue.
Symfony\Component\Serializer\Exception\NotEncodableValueException: Syntax error in Symfony\Component\Serializer\Encoder\JsonDecode->decode() (line 86 of /var/www/html/headlessdrupal/vendor/symfony/serializer/Encoder/JsonDecode.php).
Note: The below api works fine both in postman and CURL. But we having the issue, while trying to connect via react.
http://domain-name/user/login?_format=json
content-type: application/json
username and password provided in the raw data as below:
{
"name": "admin",
"pass": "123456"
}
Please help on this.


texts: How do I add an external JavaScript file using a custom module?

texts:
I am trying to add an external JavaScript file to my site using hook_preprocess_page().

In Drupal 7, I used drupal_add_js().

function mymodule_preprocess_page(&$vars) {
  $uuid = trim(variable_get('variable_id', ''));
  drupal_add_js('//cdn.cookielaw.org/consent/'.$uuid.'.js', array(
    'type' => 'external',
    'scope' => 'header',
    'group' => JS_THEME,
    'every_page' => TRUE,
    'weight' => -1,
  ));
}

What function/method should I use in Drupal 8?


texts:
I'm designing a sensitive site and I want that login/passwd is not sent as plain text. I don't want to provide https connection or maintain a SSL certificate as it can easily be compromised on shared hosting.

For non-admin users login using openid will solve this issue but how do I do it for Admin(uid=1) ?

For admin login one way is to use a secured VPN of another country to login and once session cookie is placed I can close VPN and use my normal internet connection.

Any ideas?

Although this question isn't version specific but I need it for D6 site.