texts: Using node clone to copy content and delete parent content?

texts:
I want to use node clone to copy my old content and at the same time delete the parent content

for example i have a content called Item 1

I want to clone Item 1 want and then delete the original Item 1.
its because drupal views has only the sort by :creation date and I do not want my users to alter the publication date by themselves


texts: How to alter the date "All Day" checkbox value from form alter?

texts:
I am working on module that setting the default value for the date field with popup calendar. I am setting the default value from hook_form_alter(). In the date field settings i enabled the "Display all day checkbox".

So the "All Day" check box option will be there with date field.

My Requirement is to set the default value for the All Day check box as checked on the 50% of the time form loaded. I want to achieve this through pragmatically.
i printed the $form array()[dsm($form)] in the form alter, But can't find the element "All Day".

Any body have any clue to achieve this? Please find the screenshot for more details.

Thanks in Advance.


texts: Working with template suggestions on Drupal 8

texts:
I need Drupal to use a custom page template if the URL contains a particular _GET parameter.

In D7 I would do something like this in the theme's template.php:

function mytheme_preprocess_page(&$variables) {
      if($_GET['isCustomTpl'] == true)
        $variables['theme_hook_suggestions'][] =  'page__myCustomTpl';
}

It doesn't work in D8 though (I would have been surprised by the opposite, considering all the architectural changes in the theme layer).

Any ideas?

Bonus question: is it possible to define such a function in a module, so that i can release it publicly without having the users to edit their themes?


texts: How to add a file lock to all existing files in directory

texts:
I've just started using file lock to prevent images getting deleted, so we can build up a store of images for use at a later date. I think this module will solve a problem I've had, but only for images uploaded from this point forward.

How can I also apply this protection retrospectively to:

Images already in file fields
Images uploaded by FTP (well, you know, SFTP )


texts: Output menu using dpm() and zone template

texts: I am using dpm($variables) to output the array elements for the zone menu. How do I use what is provided to output the zone menu in my template file?


texts:
I'm still running some Drupal 6 sites (because I'm waiting for the Migrate module to work properly in Drupal 8), and I notice that there are some modules in rupal D6 (like Views) which are still bringing out security releases. However, since the code has been moved off drupal.org, these new releases are not getting downloaded by Drush when I do a pm-update to install security releases.

Is there any way to tell Drush to look on Github for certain modules? Alternatively, is there a git command to do this?


texts: In a custom module how do I get all the nodes of a certain type?

texts: Do I just do a direct db_query() on node/node_revision, or is there a function?


texts: How to delete a comment via an HTTP GET link in an email

texts:
On my site, moderators are notified of comments via email whenever a new comment is posted. I would like to offer them a one-click approve/delete feature directly from the email.

There is an approve comment link, so I can easily put that link into the email for them to approve the comment directly.

However comments are deleted via a form - an HTTP post - so I can't do that from a link in an email as far as I know. At least that's how it is on my site - not sure whether the form behaviour is normal or is because I have Mollom installed.

Is there a way to delete a comment directly from a link in an email?


texts:
I use ultimate cron to fill in a queue with some nids.

To add the items in the queue, I use something like:

$queue = DrupalQueue::get('my_queue');
foreach($urls as $nid=>$url){
  sleep(1);
  $response = drupal_http_request($url,array('timeout'=>3,'method'=>'head'));
  if($response->code=='404'){
    $queue->createItem(array('nid' => $nid));
  }

This works OK.

When the time comes, another cron job is executed that deletes those nodes. This is done like:

$queue = DrupalQueue::get('my_queue');
for($i=0; $i<$queue->numberOfItems(); $i++){
  $item = $queue->claimitem();
  node_delete($item->data['nid']);
  $queue->deleteItem($item);
}

This is not working OK; there is a small issue: Everytime the second job runs, only half of the items in the queue are processed (deleted). If there are 3000 items in the queue, only 1500 are deleted. If there are 1500 items, only 750 are deleted and so on.

Why is that? Is there a way to control it?


texts: CKEditor strips all inline CSS and some tokens

texts:
I'm trying to add a color and font size to some text using the CKEditor. As soon as I save it these are stripped out.
I've also noticed some tokens are stripped down when certain settings are enabled.

I went to add a bit of text in a different font and color but when I saved it and viewed the text the spans were stripped of their "style" tag.
I went to config/content/formats/manage and enabled Limit allowed HTML and added span to the list like so :

<a hreflang href> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol type start> <li>
<dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt data-entity-type data-entity-uuid>
<u> <s> <p> <h1> <pre> <table> <caption> <tbody> <thead> <tfoot> <th> <td> <tr> <span style>

After saving this all the attributes inside of span are still stripped. I also noticed that many of the tokens I was using (such as site:url) are broken and only half of it remains.

I went back and disabled the Limit allowed HTML option and then when I saved the text the styles and token would save properly.
When viewing the text in an email, the tokens had worked just fine but the span had it's css striped.

I've tried looking for an answer but most are saying I need to enable and add the span to the limit html option but this definitely does not work for me.

There is also Correct faulty HTML enabled, would that be a problem for this?
How can I enable in line styling with the CKEditor?


texts:
I have a very basic problem:
I installed the views module and created a view...and of course the develop module.
But why does

function bartik_preprocess_views_view(&$vars)
{
  dpm('hi');

}

Not givimg me HI in template.php ? If i write that into the bartik_process_page() it works...


texts: Custom entity, entity_save() leads to PDO Exception?

texts:
I have built a custom entity called 'person'.

In a module called 'beautify' I use a hook.

Inside this hook I want to create an instance of this object with bundle 'person'. (entity: 'person', bundle: 'person')

In my bundle person I have different fields created by the fields UI. One of these fields is called 'field_person_copy'. The colums of this table called 'fields_data_fields_person_copy' are created by the drupal system:
entity_type, bundle, deleted, entity_id, revision_id, language, delta, field_copy_person_value.
The field is required.

I want to use the drupal system to create new persons, not a db_inject.

  function beautify_contact_person($message){
  // dpm($message);
  $e = entity_create ('person', array(
    $entity->name = $message['params']['last_name'],
    $entity->field_person_copy['und'][0]['value'] = 'NO',
    ));
  //dpm($e,'Instanziiert eine entity');
  entity_save('person', $e);

(Testing with entity->save let the system say that this method is undefined.)

This leads to the following error message:

  PDOException: SQLSTATE[23000]: Integrity constraint violation:
  1048 Column 'entity_id' cannot be null: INSERT INTO {field_data_field_person_copy}
  (entity_type, entity_id, revision_id, bundle, delta, language, field_person_copy_value)
  VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2,
 :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5,
 :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] =>
 person[:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3]
 => person [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und
[:db_insert_placeholder_6] => NO ) in  field_sql_storage_field_storage_write()
(Line 451 von /home/duke/sites/mia-casa/modules/field/modules/field_sql_storage/field_sql_storage.module).

which means that the system doesn't generate the entity_id and fuels it in the function.

So is that a bug of the entity_api or from me? (I hope the latter) ;)

In my custom_module to build the entity, I only overwrote the function "buildContent" in the class EntityApiController, so create, save and update is not influenced by me.

Thx in advance,

maen


texts:
I have this code below:

$form['id']['mypreview_modal'] = array(
    '#type' => 'item',
    '#markup' =>
        '
12345
'
);

$form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save',
    '#ajax' => array(
        'event' => 'click',
        'callback' => 'myid_user_page_form_ajax_submit',
    ),
);

function myid_user_page_form_ajax_submit() {
     $myid_user = ; //Get mypreview_modal's text/innerHTML
}

I want to get mypreview_modal text and assign it to myid_user. How will I do that?


texts: how to setup rule events for before/after video is played?

texts:
How can I set up a rule events for actions to occur before and after videos are played in a node?

Thank you for any tips/ help you can give!


texts:
I have defined a rule in " Configuration » Workflow » Rules".
I have setup this as following...

EVENT : After saving a new account
Conditions : User has role(s)
             And role is (Referral Source)
    enter code here
Actions  Send a HTML mail.

But it's not sending the mail to register user. It's because of the user don't have the role as Referral Source at the same time. I am assigning the role using the PHP code and I would like to run the rule on same time. So how can I do that?


texts: form tag is broken after calling custom form with AJAX

texts:
my custom form is working well. but when i want to call my custom form (in a custom mudule) via AJAX, the form tag is somehow not finished or broken.

<form class="myform" data-drupal-selector="myform" action="form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM" method="post" id="myform" accept-charset="UTF-8">

instead of the form tag with all elements (data-drupal-form-fields=".....") and action="/mypage"
they are all missing.

do i miss something when i build my form or is it just an issue with the core form api?

EDIT:

i found the part why its broke:

    class FormController extends ControllerBase
{

    public function createForm()
    {
        $form = \Drupal::formBuilder()->getForm(\Drupal\is_form\Form\MyForm::class);

        // echo drupal_render($form); exit(); <--- this was before

        return $form; //<--- this renders the whole page on callback from ajax, but the form tag is well
    }
}

with my echo statement only the form array is rendered, but not complete (form tag).

is there any method to render only my formfields, because the return will give me the whole page page (with wrapper header footer and sidebars).

thanks in advantage


texts: How do I filter on day & month from a date field?

texts:
Hello I'm still fairly new to drupal and views,

I'm trying to create a Birthday notifier which checks "today" in a view block.
Now users can turn in their birthdays on their profile using the date field which is set as: yyyy/mm/dd.

Now the simple thing was to create a filter on the date today, but because of the yyyy field it wil not show up on today's date.

What I'd like is to filter mm/dd on today. So for example if someone's birthdate is 1993/07/03, he'd be notified as today is this persons birthday.

Is there a way to do this or to create a work around for this?


texts: Which hook is invoked when a user's roles are changed?

texts:
I am trying to set a custom role expiration date in a subscription website using Ubercart and Paypal. Role expiration date is set by the role expiry module when a user completes payment.

I am trying to achieve this by using hook_user(). Is there any other way to achieve this?


texts:
I have drupal site in that ,i want to send a email to charities when donor post a donation..,and i want to send a email notification to charities,so how i send email using drupal7

$message = array(
  'to' => '"'. addslashes(mime_header_encode('new donation')) .'" <test@example.com>';
  'subject' => t('Example subject'),
  'body' => "Hi user! a donor added a new donaion! So please     check the site for more infomation!
Thanks,
",
  'headers' => array(
          'From' => 'test@test.org',
          'MIME-Version' => '1.0',
          'Content-Type' => 'text/html;charset=utf-8',),
);

drupal_mail_send($message);


texts:
I just want to show the status of an item on one AJAX call. I cannot find any form element that allows me to only output text. I don't want a textfield form, since that would allow the users to enter a value.

How do I show text only in a form created with the form API?


texts: Webform: prepopulate fields through URL, "page not found"

texts:
I'm trying to prepopulate fields in a webform from the URL.  I'm using Webform 7.x-3.20.  I have a form named prepopulate. It has a field "First Name" which has the default value set to %get[first_name].  I have tried to prepopulate the field from the following URL:

http://localhost/test_site/?q=content/prepopulate?first_name=miranda

This results in a "page not found" error.  Does anyone know why this happens?

Thanks in advance!

*UPDATE: I've figured out this happens because it is a rewritten URL (Pathauto).  Still don't know how to fix it, though.


texts: echo() doesn't output anything for anonymous users

texts:
I am working on my own form module for Drupal 7.

I tried to set some default text depending on a cookie was set or not. It works perfectly as long as your are logged in; once you are an anonymous user, it doesn't read/write the cookie.

I tried to debug this by putting in a few calls to echo(), and drupal_set_message(), but they are only shown when I'm logged in; they don't show for anonymous users. I can't figure out why.

Can anyone help me with this?

This is the code I am using.

$serviceType = "";
$serviceName = "";
if (isset($_COOKIE["kms_hoststring_name"])) {
  $serviceName = $_COOKIE["kms_hoststring_name"];
  $serviceType = $_COOKIE["kms_hoststring_type"];
}
drupal_set_message("test");
echo "TEST";
$form['serviceType'] = array(
  '#type' => 'textfield',
  '#title' => t('Service Type:'),
  '#default_value' => t($serviceType),
);

$form['serviceName'] = array(
  '#type' => 'textfield',
  '#title' => t('Service Name'),
  '#default_value' => t($serviceName),
);

//Deletes cookies after use.
echo "TEST1";
if (isset($_COOKIE["kms_hoststring_name"])){
  setcookie("kms_hoststring_name", "", time()-60000, "/");
  setcookie("kms_hoststring_type", "", time()-60000, "/");
  echo "TEST2".$_COOKIE["kms_hoststring_name"];
}

None of the echo() or drupal_set_message() calls output anything for anonymous users.
When I log in, I see the output of those function calls.


texts: Zoom and center a GMap according to its markers is not working?

texts:
Zooming and positioning the map to the center was not working in (Google map)
So we come up with small change in the code by adding time delay to it, then it was started working, may be it will use for someone.
  (fitbounds method googlemap api v3  for drupal 7 gmap)

jQuery(document).ready(function() {
  // time delay for the maps to initialize.
  setTimeout(function() {

// Loop through all gmap instances.
jQuery(".gmap").each(function() {

  // Get a map reference using the element ID.
  gmapID = jQuery(this).attr("id");
  var gmap = Drupal.gmap.getMap(gmapID).map;

  // Ensure map exists.
  if (gmap) {
    alert(gmap.toSource());
    // Create a new map boundary.
    var bounds = new google.maps.LatLngBounds();
    // Iterate though the current maps marker collection.
    jQuery.each(gmap.markers, function(index) {
      // Find the current markers position (latitude, longitude).
      var data = gmap.markers[index];
      var pos = data.getPosition();

      // Extend the new boundary so the new marker/pin will be in view.
      bounds.extend(new google.maps.LatLng(pos.lat(), pos.lng()));
    });
    // Set the current maps bounding box to our new defined boundary.
    gmap.fitBounds(bounds);
  }
  else {
    // GMap was not initialised in time.
  }

});

 }, 100);
});

This is what the code We added time delay on top of it. https://stackoverflow.com/questions/3520810/zoom-and-center-a-google-map-according-to-its-markers-javascript-api-v3


texts: How to see/log the reasons of the AccessResult::forbidden($reason);

texts:
It is not easy to debug access denied in Drupal (especially in views), This is why I have added a lot of "reasons" when using AccessResult::forbidden($reason);

Unfortunately, when an access Denied arise, I couldn't find any log or anything else in which the Reason was properly outputted to give me a clue on why this acces was Denied.

Note: As pointed out by @Clive, if the access is calculated to display a page/route, it will be displayed in the 403 response.
My question is not about this kind of access, my question is about (for example) entity access (ex: view or edit a user)

Am I missing something?


texts: Switch site language after IP to locale redirect

texts:
I have a Multilingual Drupal 7 website. using i18. I redirect my visitors based on IP address with IP to locale module. Now e.g. visitors from Holland (Dutch IP) are redirected to http://landberg.at/nl

But now I am not able to select another language, with my language switcher? E.g an English person who lives in Holland must be able to switch to the English version. http://landberg.at/en

How do I have to achieve this? Is this anyway possible with language redirect based on IP?

(currently on my site I switched IP 2 locale OFF)


texts: How to limit access to a view based on the contextual filter

texts:
I have a view that uses a contextual filter and I want to limit access to that view based on the filter.  To give it some context:

I have a content type that represents minutes from previous meetings.  These minutes can belong to a handful of committees.  The user selects which committee the minutes belong to when creating the node, and the view then uses that as a contextual filter.

I would like to know if there is something out there that would allow me to filter access to the view based on the contextual filter.  So if someone tries to access minutes/mycommittee vs minutes/notmycommittee they would be allowed and denied respectively.

Thanks in advance.


texts: Drupal Commerce - recreate taxonomy tree for product

texts: I've got existing website with catalog full of products. Each products have taxonomy term attached (catalog category). I've created views that will list products by additional option field. I've added field to product display which indicates that product is 'on offer' or it is for 'men' 'women' 'kids'. I can list all products teasers in a view using a filter. What I'd like to do is not to list products teasers but to re-create taxonomy on 'special offer' pages. So when someone goes to 'special offer' page it will show categories and subcategories and then product teasers. I thought about using taxonomy_get_tree() or maybe there's something like multiple parent per taxonomy so I can add a product to catalog and also to 'special offers'...


texts: How to deal with a rules related lock_wait that occurs after a cache clear and results in slow transactions

texts:
This application needs to run cron every 15 minutes which results in a cache_clear_all.  Whenever this happens hundreds, sometimes thousands, of db_log entries happen for "Cache rebuild lock hit: rules_event_whitelist" which results in a lot of slow transactions: .

I'm setting up jMeter tests for a development environment so that I can reproduce and test fixes, but my question is: Is there a best practice fix for this?  I discovered that the memcache locking mechanism is not being used - maybe that would help? ( I can't test this in a production environment and a similar development environment hasn't been given to me yet).

Update: I'm able to reproduce this in a smaller dev environment.  Updating to the memcache locking and stampede protection does not solve the issue.


texts: I have a new requirement. I need a minutes of meeting module. I.e. after each meeting i.e. weekly they will add action items and assign it to some user and as soon as the user logs in, it should be shown to him. So is there any existing module which is even close to this. I don't mind sitting and customizing the module.


texts: I'd like to give some authors a better SEO experience. How can I disable Heading 1 in builtin CKeditor in Drupal 8?


texts: CSS aggregates generating but not loading (core and AdvAgg), but JS aggregates load fine

texts:
I'm trying to set up aggregation and compression on my site, but am having problems. When I enable aggregation, either through core or through AdvAgg, it seems that aggregates are being generated for both CSS/JS files when I check sites/default/files, but only the JS aggregates are actually being loaded. When I check my page sources, the browser is displaying all of the original CSS files as though an aggregate had not been generated/enabled. I'm running Omega and a sub-theme, if that's a possible issue. Any suggestions on what to try?

EDIT: As per my comment below, the only theme option I see relating to aggregation is "Rebuild CSS and JS aggregates on every page load", and checking/unchecking it doesn't seem to have any effect. I can't seem to find anything else relating to aggregation within the theme settings.


texts:
I am creating a node and a path alias roughly as follows:

<?php
$node = (object) array( 'type' => 'article');
node_object_prepare($node);
$node_wrapper = entity_metadata_wrapper('node', $node);
// ... some more fields get set here...
$node_wrapper->title->set( 'Foo' );
$node_wrapper->save();

// Set the path
$path = array(
  'source' => "node/$node->nid",
  'alias' => "foo/bar",
);
path_save($path);

The node is created OK, and the path seems to be created OK, too. I can type foo/bar in as the path and I see the new blank page. However when I edit that page, the Path Alias is blank?!

I have pathauto installed - could this be something to do with it? Nb. when I edit the page the "Generate path automatically" pathauto checkbox is not checked (which is what I'd expect).


texts: How to make question answer content type with answer as a separate node?

texts:
I want to create a "question" content type, but is it possible to make the answer a separate node?

Because I want to use Views with user relationships module to show answers to friends or followers.


texts: Suddenly my website front page was not found!

texts:
My websites richtown.ae, and hannahaicah.com suddenly are not showing the front page; the rest of the pages is working fine. My hosting provider changed the php.ini file this morning, due to problems with PDO. Can anybody tell me what happened?

I also changed the path for the front page but nothing happened.


texts: Commerce Rule For Sales Tax On Shipping To One State

texts:
We want to only apply sales tax on orders shipped to a particular State. I tried to cobble together the following rule from the included 'Price Component' and it seems to apply tax on shipping for -all- orders, regardless of the address component.

Can someone look at this and tell me what I'm doing wrong?

{ "rules_apply_taxes_to_shipping" : {
    "LABEL" : "Apply Taxes to Shipping",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "commerce_order", "commerce_tax", "commerce_shipping" ],
    "ON" : { "commerce_shipping_calculate_rate" : [] },
    "IF" : [
      { "commerce_order_compare_address" : {
          "commerce_order" : [ "commerce-line-item:order" ],
          "address_field" : "commerce_customer_shipping|commerce_customer_address",
          "address_component" : "administrative_area",
          "value" : "WA"
        }
      }
    ],
    "DO" : [
      { "commerce_tax_calculate_by_type" : {
          "commerce_line_item" : [ "commerce_line_item" ],
          "tax_type_name" : "sales_tax"
        }
      }
    ]
  }
}

Here is the Rules Evaluation Log. Apparently the rule isn't even firing. How do I figure -that- out?

    0 ms Reacting on event Calculating the sell price of a product.
    3.479 ms Evaluating conditions of rule Calculate taxes: VAT. [edit]
    3.489 ms AND evaluated to TRUE.
        0 ms Rule Calculate taxes: VAT fires.
        0.138 ms Evaluating the action commerce_tax_calculate_by_type. [edit]
        4.267 ms Rule Calculate taxes: VAT has fired.
    7.837 ms Evaluating conditions of rule Calculate Bundle Product Price. [edit]
    7.845 ms AND evaluated to TRUE.
        0 ms Rule Calculate Bundle Product Price fires.
        0.093 ms Evaluating the action commerce_product_bundle_calculate_price. [edit]
        4.688 ms Rule Calculate Bundle Product Price has fired.
    12.594 ms Evaluating conditions of rule Quote Required. [edit]
    12.609 ms AND evaluated to TRUE.
        0 ms Rule Quote Required fires.
        0.012 ms Rule Quote Required has fired.
    12.692 ms Evaluating conditions of rule Calculate taxes: Sales tax. [edit]
    12.699 ms AND evaluated to TRUE.
        0 ms Rule Calculate taxes: Sales tax fires.
        0.111 ms Evaluating the action commerce_tax_calculate_by_type. [edit]
            0 ms Executing rule Calculate Sample Michigan Sales Tax 6%.
            0.169 ms Evaluating conditions of rule Calculate Sample Michigan Sales Tax 6%. [edit]
            2.254 ms The condition commerce_order_compare_address evaluated to TRUE [edit]
            2.263 ms AND evaluated to TRUE.
                0 ms Rule Calculate Sample Michigan Sales Tax 6% fires.
                0.089 ms Evaluating the action commerce_tax_rate_apply. [edit]
                0.571 ms Added the provided variable applied_tax of type commerce_price [edit]
                0.6 ms Rule Calculate Sample Michigan Sales Tax 6% has fired.
            2.905 ms Finished executing of rule Calculate Sample Michigan Sales Tax 6%.
        5.114 ms Rule Calculate taxes: Sales tax has fired.
    17.894 ms Evaluating conditions of rule Unset the price of disabled products in the cart. [edit]
    18.145 ms The condition data_is_empty evaluated to FALSE [edit]
    18.334 ms The condition entity_has_field evaluated to TRUE [edit]
    19.067 ms The condition data_is evaluated to FALSE [edit]
    19.076 ms AND evaluated to FALSE.
    19.102 ms Evaluating conditions of rule Quote Required. [edit]
    19.195 ms The condition data_is_empty evaluated to FALSE [edit]
    19.296 ms The condition entity_has_field evaluated to TRUE [edit]
    19.708 ms The condition data_is evaluated to FALSE [edit]
    19.716 ms AND evaluated to FALSE.
    19.737 ms Finished reacting on event Calculating the sell price of a product.


texts: Can we call a custom block inside our hook_block_view()?

texts:
I have a module of type block.Now based on the user i want to display different blocks .
So i have a written the module but my dilemma is if its possible to call a block(default) inside our custom block? Here's my code m trying !

<?php
/**
 * Implements hook_block_info().
 */
function sample_module_block_info() {
  $blocks['current_posts'] = array(
    'info' => t('Current Users Of the Drupal Website'), //The name that will appear in the block list.
    'cache' => DRUPAL_CACHE_PER_ROLE, //Default
  );
  return $blocks;
}
function sample_module_block_view($delta = '')
 {

 $block = array();
global $user;
  switch ($delta) {
    case 'current_posts':
      $block['subject'] = t('Logged in User Currently');
$block['content']=$user->name;
      break;
/**
 switch ($delta) {
 case 'current_posts':
global $user;
print "The current user is: ";
print $user->name;
if($user->name == "admin")
print " This Shit Works ";
*/
    }
  return $block;
}
   ?>

Now in block['content'] i want to display another block!
Can somebody lead me to how to do this ? If possible ?


texts: Bootstrap subtheme does not apply to main menu

texts:
After adding the "html.tpl.php" and "page.tpl.html" to my bootstrap subtheme the layout of my main menu disappeard as you can see in the screenshot below:

As you can see; no bootstrap classes are applied to the menu:

Main menu

List links

Edit menu

Configure block

Lessenrooster

Over ons

Contact

Fotogallerij

The bootstrap subtheme however is active:

EDIT 1

I indeed did use the wrong .tpl files. I now have copied the correct files to the subtheme (which included the correct .info file). However the .info file does not include the main_menu region.

regions[navigation]     = 'Navigation'
regions[header]         = 'Top Bar'
regions[highlighted]    = 'Highlighted'
regions[help]           = 'Help'
regions[content]        = 'Content'
regions[sidebar_first]  = 'Primary'
regions[sidebar_second] = 'Secondary'
regions[footer]         = 'Footer'
regions[page_top]       = 'Page top'
regions[page_bottom]    = 'Page bottom'

After clearing the cache, the main menu did not change.

EDIT 2

I started all over again following this guide, but still the main menu looks like crap... and if i copy over the menu folder from bootstrap I get an HTTP ERROR 500 error


texts: Validation error, please try again. If this error persists, please contact the site administrator

texts:
I've been searching google and I'm about to start surfing through the code, but we all know how useless searching through drupal code is.

People are running into this problem everywhere, including on my website today. So I figured it was worthy of stackexchange.

Basically, I run into this error when trying to send the contact form from my website. Others have run into it with a variety of forms.

I want to know what we're running into that is causing this error.


texts: Embedding Views programmatically getting argument overridden title

texts:
I'm embedding a View inside my custom module, using views_embed_view

From the docs for this function:

  Note that this function does NOT display the title of the view. If you
  want to do that, you will need to do what this function does manually,
  by loading the view, getting the preview and then getting
  $view->get_title().

However, my View has no title, instead I've set my contextual filter to override the title (from the arguments in the url).
How do I get this title?

Thanks

Edit: Here is a screengrab of my contextual filter settings.  I'm actually currently using the default taxonomy_term view that comes with Views out of the box.


texts: How do I show content in an iframe as a specific user?

texts:
I want to display an external site (over which I have no control) in an iframe. Someone using my site can have or not have an account on that other site. That site requires membership (which is free) to see any content. In either case, I want to display that other site as a dummy user I made on that site. How do I do this?

I tried using the iframe module and have the iframe point to https://othersite.com/content?email=myemail&password=mypassword, but that seemingly did not do anything. When logged in with my regular user on that other site, the iframe was displayed for my regular user, when not logged in I got a page with a login button.

Can I trigger the pressing of the login button and then fill in the login form, or is it possible that that is not possible?

Edit:
Using curl, I can first log in and then using the same session get the page I want. However, how do I put that out into an iframe? I've now got a variable containing the html of the page I want to show in an iframe between fields belonging to a content type.


texts: Webform confirmation page with new information

texts:
I'm in the process of building a form to add new ServiceDesk requests. Below is the process.

Create a webform
Write a submit handler function to Create work order (according to ServiceDesk api, form data need to be submitted to http://machine_name:Port_Number/servlets/RequestServlet and a response in xml format displays "Success" message along with the WorkOrder ID. )
Display success or error message on the form results page.

Work I have done so far:

Created a webform
Wrote a submit handler function to Create work order (I tested and I'm able to add ServiceDesk requests). As the xml file with success/error message is shown on a different server (http://machine_name:Port_Number/servlets/RequestServlet), I'm unable to print the success/error message on the form confirmation page.

Please can anyone tell me how to display this info?

Thanks


texts: Views Template Suggestions When There are Duplicate Filenames

texts:
What does Drupal 6 / Views 2 do when there are two templates with the same filename in different directories?

I just ran into a situation where a row template was accidentally uploaded twice.  Typically, I make views subdirectory in my theme, and then a subdirectory per view inside that.  Due to a bad copy/paste, I ended up with

site/all/themes/mytheme/views/myview/views-view-unformatted--myview.tpl.php
site/all/themes/mytheme/views/myview2/views-view-unformatted--myview.tpl.php

My dev server was picking up the first template.  My live server was picking up the second template, despite being the same set of files as the dev server.  I didn't do the actual live deployment, but as far as I know, the rollout was an exact clone of the files.

I haven't been able to unravel how this actually happened, and would appreciate some insight.

Thanks.


texts:
we are looking to charge a different rate for Channel Island, but for some reason I think we have set up the process wrongly.
See here: https://www.screencast.com/t/AdwyRbzpc. I understand the JE and GY in 'Order Address Component Comparision' but I don't understand the GB, GG and IM in the first 'Order ADdress Component Comparision'.
Well I can guess, but I am not sure.


texts: files[]=lib.php fails to autoload classes of different namespace?

texts:
In my custom module, I've included a file using files[]=foo.php in the .info file. foo.php declares classes in a namespace.

Drupal does not seem to be autoloading this class: in my main module file $foo = new Foo\Bar(); causes a Class Not Found error.

Is this because Drupal 7's registry can't cope with namespaces?


texts: What is the template suggestion for node 'teaser' view mode?

texts:
node--[type|nodeid].tpl.php targets to node's default view mode. However I want to override the template for teaser view mode.

What is the template suggestion (.tpl.php file) for 'teaser' view mode?


texts: administer MSSQL databases from Drupal 6

texts:
Can you advise on a way to manage my SQL Server databases from Drupal 6x. I am using SQL Server for PHP driver (i.e. sqlsrv_connect()) to connect to my databases. Is there any module I could use to administer my databases?

If any more information about my query is needed, please let me know.


texts: Load an iFrame to Drupal with JavaScript

texts:
Because of Google Analytics I would need to use JavaScipt to load iFrame to my Drupal template. I use this only just on one custom content type template.

Can I put the JavaScript straight to the template?

At the moment the JavaScript in my node template is like this:

<script type="text/javascript">
var iframe = document.getElementById('myIFrame');
iframe.src = pageTracker._getLinkerUrl('http://mydomain.com/iframepage/');

</script>

<iframe id="myIFrame" height="500px" width="350"></iframe>

But it doesn't load anything to the iFrame. I followed this http://code.google.com/intl/fi/apis/analytics/docs/tracking/gaTrackingSite.html#trackingIFrames

Any idea where the problem is?

EDIT: noticed that I get error: "Uncaught ReferenceError: pageTracker is not defined"


texts: Is there a function or a way to invoke the comment object?

texts:
I want to use the $comment object in page.tpl.php.
Is there a function or a way to use it?


texts:
How can i change the logo on a site, dynamically, with a URL field which doesn't point to an actual image but to a rendering of an image.
Is this possible?
I've tried this:

$thisimage = $logo_img_url. "&file=" . $_SESSION[ 'logo_img' ] . "&width=300&height=80";
variable_set( 'logo', $thisimage );

but it's not working.

Any help would be appreciated.
Thanks


texts: How to dynamically change the path to store commerce files depending on some product variables?

texts:
All my Drupal Commerce files are being saved in the same directory on the server.

I have a Commerce product variation of type of album. Each album contains multiple Commerce files (mp3’s, m4a’s). I want each album to have its files saved in a different directory depending on artist name and album name.

For example: commerce_mp3s/artist_name/album_name/album_files*

I tried looking in the DB where these Commerce files are referenced, table name being field_data_commerce_file, but file paths are not used there.

The worst case scenario would be to change the file path of the content type every time I add a new album, but that’s not a solution. This must be a common scenario.

How can I accomplish this?


texts: How do I embed a custom node creation form inside a view

texts:
I have these nodes : Company, Cars, Trucks (cars and truck have a taxonomy term to give it's type). Cars and Trucks have a field named Company wich refer to the Company node.

So i can locate the vehicle location on a map. I know how to create a form wich allow the company's administrator to add some cars (with this subject : How do I embed a node creation form inside a view)

But i want to give a field like "Select your vehicule's type" -> "Car" or "Truck" and it shows the right form to add a new vehicle.

I want too, restrict the selection of vehicules types by user group. Then me as an administrator i want to have the possibility to select all types of vehicle, but an user group like "Motorbike Company" can use only "Motorbikes" or allow "Truck company" to use "Trucks" and Cars".

And finaly, in Campany i've a field "Vehicles" and when the company's administrator add a new vehicle, i want it add too in the "Vehicles" field of the "Company" node.

Can you help me to did that ? I use Views and Display Suite. i'm novice with Drupal and i request your help :)


texts: Checking for an Acquia Environment variable

texts:
Trying to check for an Acquia cloud environment variable in my twig template, but its not working in Dev or in Production.

Similar question is answered here, but I still can't get the twig syntax right: Is there a way to get (and use) an environment variable in my Twig template?

This is a snippet from the page.html.twig file.

{% if AH_SITE_ENVIRONMENT == 'prod' %}
  // Javascript Analytics Code
{% else %}
  <!-- env is {{ AH_SITE_ENVIRONMENT }} -->
{% endif %}


texts: How to create custom block plugin for webform in Drupal 8

texts:
I need to create custom blocks for every new webform. When User will create a webform, module should create a custom webform block.E.G. 'webform-1' becomes 'webform-1-block'. The resulting block must be of type 'webform_block' and reference the newly created webform.

How should I achieve this functionality? Any reference?

Thanks in advance.


texts: Adding confirm email field to entityform

texts:
I am using email field module and entityform for a simple contact form on a Drupal 7 install. I need to add an extra field where the user re-enters their email address (no copy and paste) to prevent typos.

This seems like a simple enough requirement so I'm wondering if I'm just overlooking something in entityform or email field that will help me do this, or perhaps an additional module?

Can anyone recommend a method to achieve this?

Plan B is to use jquery.

Thanks!


texts: Replace the default modal with a different one

texts:
I want to replace Drupal 8 default modal with MDB.
How I can do it? Should I unload default library for modals and load new one? Any idea?


texts:
I've been working on a site and I need to change the search.

I've changed the search form with hook_form_alter(), added some checkboxes, ... Now I need to get the new data to the hook_search_execute() function?

How would I achieve that?


texts: Write a file on every submission or create custom export format?

texts:
Is there a way of writing or outputting a file on every submission? For example, if a user submits a 'contact us' form, this will write a file to a database or disk.
The file I want to write per submission is an XML file, but will need the XML file to be based on a specific structure, for example:
<?xml version="1.0" encoding="UTF-8"?>
<Exportfile>
<Header>
 <DocumentName>Contact us xml export - reference [webform_submission:sid]</DocumentName>
</Header>
    <Message>
<field1>[webform_submission:values:field_1]</field1>
<field2>[webform_submission:values:field_2]</field2>
    </Message>
</Exportfile>

Or, whether you can create some sort of custom export option within the Results > Download section? Essentially, to allow a backend user to export/download individual submissions as an XML file (based on a specific XML structure like above)


texts: Is there a way to execte jquery event after ajax callback has been completed?

texts:
Having a simple form with few input fields.
After clicking on ajax callback submit button, I'm returning the table element.

Code:

//Hypertension treatment
        $form['hyper_treat'] = array (
      '#type' => 'radios',
      '#title' => ('Hypertension treatment:'),
      '#options' => array(
        'y' => 'Yes',
        'n' => 'No'
      ),
    );

//Hypercholesterolemia
    $form['hyperchol'] = array (
  '#type' => 'radios',
  '#title' => ('Hypercholesterolemia:'),
  '#options' => array(
    'y' => 'Yes',
    'n' => 'No'
  ),
);

//submit button
    $form['action'] = [
    '#prefix' => '
',
     '#name' => 'ajax_action',
    '#type' => 'button',
    '#value' => $this->t('Submit'),
    '#ajax' => [
    'callback' => '::setMessage',
    'wrapper' => 'scrollable',
    'method' => 'replaceWith',
    'effect' => 'fade',
    ],
    ];

    //table
    $form['table'] = array(
    '#prefix' => '

View Data
',
        '#type' => 'tableselect',
         '#suffix' => '
',
        '#header' => $header,
         '#options' => $options,
        '#disabled' => $disabled,
        '#attributes' => array('id' => 'sort-table'),
        '#empty' => t('Select criteria and search data'),
      );

//callback function
   public function setMessage(array $form, FormStateInterface $form_state) {
  $options = getOptions(); //gets the associative array
  $form['table']['#options'] = $options;
  return $form['table'];
}

I had issues with the pagination and sorting of the table returned using ajax.
So I thought of using "Datatables" as the alternative option.

So after the callback, I would want to apply the below jquery to have the table shown as a datatable.

 $('#sort-table').DataTable( {
        order: [[ 1, 'asc' ]]
    } );

Tried executing the 'mousedown' event for the button but the jquery executes before the ajax callback.

Is there a possible way to represent the $form['table'] element returned from the ajax callback, as a datatable?

Triggering any other event after table returned would display it as a datatable, but I'm looking to have the returned table displayed as a datatable immediately after the $form['table'] is returned. This happens only when the jquery snippet is executed immediately after the table element is returned from the ajax callback function.


texts:
I'm working on a feature of a Drupal 8 multisite with separated databases for each site trying to implement the following requisite.

When posting news to the main site (all the other sites are subdomains) the user has to have the option to choose other sites where he wants the same news to be available.

I"m starting doing this with a module and hooks, BTW I never worked with Drupal before, and I'm guessing if there is an existing module that could do that.

Would someone recommend a module I could try?

Thanks for any help


texts: Subrequests: Assigning Paragraphs entity to node

texts:
Migrating a content type from D7 into a greenfield D8 app, so I'm using Subrequests and jsonapi modules. My first subrequest to create a simple Paragraph returns the new ID and it properly replaces my token in my node--person, until it gets wiped out at some point within the many calls to httpKernel->handle($request) class. I've burned a few hours setting breakpoints to see how its losing the replaced Paragraph ID but I've not mastered the Symfony Http system.

I've tried adding an owner iid, attempted to derive a "meta" array for a target_revision_id from the drupal_internal_revision_id property but that returns a 500 error. Here's a minimized code of the blueprint.

function bodyPerson($person){$data = ["data" =>
      ['type' => 'node--person',
       'attributes' =>
        ['title' => 'ignored',
        'status' =>"1",
        'field_body' =>
          ['value' => 'Highlights.',
            'format' => 'full_html',
            'summary' => ''],
       'field_last_name' =>
         'Walls'
    'relationships'=>
      [
       'owner' => ['data' =>
         ['type' => 'user--user',
         'id' => '2061b881-d5ea-4daa-a006-616e47xxx']],
       'field_title' =>['data' =>
         ['type' => "paragraph--title",
           'id' => "{{paragraph-title-1.body@$.data.id}}"]
           ]
      ]]];
      return $data;
     }

     $bodyp = json_encode(["data" => ['type' => 'paragraph--title',
      'attributes' => ['field_department' => ['value' => "my dept 1a"]],
      ['field_title' => ['value' => "my title 1a"]]]]
      );

     $blueprint = json_encode([['action' => 'create', 'requestId' =>    'paragraph-title-1', 'body' => $bodyp, 'uri' => '/jsonapi/paragraph/title', 'headers' => $headers], ['action' => 'create', "waitFor" => ["paragraph-title-1"], "requestId" => "person-test", 'headers' => $headers, 'uri' => "/jsonapi/node/person", 'body' => $bodyPer]]);

Passing the $blueprint and the two body blocks into curl returns the new Paragraphs object, passing it to the final POST subrequest. The result is an empty "data" array where the Paragraphs' link should be.

            "field_title": {
                "data": [],
                "links": {
                    "self": {
                        "href": "\/jsonapi\/node\/person\/9ebcdd24-d8ee-428d-8770-1ad62eexx\/relationships\/field_title?resourceVersion=id%3A1045"
                    },
                    "related": {
                        "href": "\/jsonapi\/node\/person\/9ebcdd24-d8ee-428d-8770-1ad62exx\/field_title?resourceVersion=id%3A1045"
                    }
                }
            }

Subrequests is working for other subrequests in this body.

Adding more context into this issue. Subrequests are generally working, except where the final parent node is able to save with the UUID of the early subrequests to attach using relationships newly-created entities, like this Paragraph. Able to save an image into file--file but the parent node loses the UUID of the entity in Drupal.
Spending hours walking through the process through HttpKernel the JSON, or the UUID, survives as a content attribute in several Request objects. It seems to get lost being saved as an Entity. As you know, the Paragraphs entity is an EntityReferenceRevisions object, but still part of the Entity API, it seems. It appears that the parent node loses the target_id of the saved Paragraphs entity while going through the steps to save a node. Notably the ContentEntityBase::updateOriginalValues() where it's attempting to filter out empty fields. Perhaps the Entity system is looking elsewhere for the target_id?
The JSON returned when the Paragraph is instantiated returns its UUID. That should be a reference to the entity's attributes like paragraphs_item_revision vid, like the paragraphs_item nid?
I'm unsure how to prep this object so that it can be linked to its parent node without jsonapi and subrequest's help.


texts: Why is $form_state always empty, even when my form-building-function is called after validation?

texts:
I'm having a little trouble with the terminology here, so I'll explain my problem directly with code samples (trucated for clarity).

myModule.module

Here I create a menu with a link to a form built using a function declared in form_identification.php

[...]
require_once(dirname(__FILE__) . '/form_identification.php');
[...]
function myModule_menu() {
    $weight = 1;
    $items = array(
        'identification' => array(
            'title' => t('Identification'),
            'page callback' => 'identification_callback',
            'access arguments' => array('Acces myModule'),
            'type' => MENU_NORMAL_ITEM,
            'weight' => $weight++
        ),
        [...]
    );
    return $items;
}
[...]
function identification_callback() {
  return drupal_get_form("form_identification");
}
[...]

form_identification.php

This file holds the function which builds the form, called form_identification

function form_identification($form_state) {

    error_log("form_state: " . print_r($form_state, true));
    // always outputs `form_state: Array\n(\n)\n`

    $form = array(
        '#attributes' => array(
            'enctype' => 'multipart/form-data'
        ),
        'sex' => array(
            '#type' => 'textfield',
            '#title' => t('Sex'),
            '#disabled' => true
        ),
        /*[...]*/
        'enregistrer' => array(
            '#type' => 'submit',
            '#value' => t('Enregistrer'),
            '#submit' => array('form_identification_enregistrer')
        )
    );
    return $form;
}

function form_identification_validate($form, &$form_state) {
    /*[...]*/
}

function form_identification_enregistrer($form, &$form_state) {
    /*[...]*/
}

As you can see, I'm printing the contents of $form_state to the log every time form_identification is called, so I can confirm that the function is called on page load and also after validation. The problem is that in both cases, I just get an empty Array (Array\n(\n)\n). I would have expected to get an array full of form info when the function is called after validation. That way, I could have a look at the values entered and decide how to build the form based on them. Is there any way to achieve this? In what situation would $form_state NOT be an empty array?


texts: Relationship between views with shared string field been used as id

texts:
Issue: (Updated issue description) I need to list all properties where their field_development_ref value matches the new_homes_development content types' field_development_ref. The view will be embedded within the new_homes_development node, and that nodes matching properties will be listed at the bottom.

I wanted to create a view with a block pane that will have the node ID contextual filter and then related all properties that share the same field_development_ref value. When I go to the relationships section under advanced I see no ability to related one to the other.

Content type - Property

Fields of interest:
- field_development_ref

  Note: This content types data is imported from an external datasource
  that has no knowledge of the Drupal system via an API.

Content type - New development

Fields of interest:
- field_development_ref

Notes:

Several properties imported may belong to a new_home_development node, like a gated community (the new_home_development) with sub plots (the properties) and if this is the case they will carry the same Development ID stored within field_development_ref
The New homes development content type is created manually by a content editor. When filling out the node information they will get the developments ID and put it in the field_development_ref field.

How can I relate one to the other?

The view I have currently is shown below along with the content types in question.

View - Content using new_home_development content type

Content type "new_home_development" fields

Content type "property" fields (Partial)


texts: How to set a file upload monthly quota on a role basis in Drupal 7?

texts:
I'm using Drupal 7 and I'm quite a newbie here.

I'm building a small sharing/social network site where users will be able to upload different kind of files (mainly, pictures and zipped archives, but I'm not limiting the kind of files one can upload).

Is there a way to set a per-user upload limit/quota (say, 1Gb/month) on a user role basis?

Edit

Using Amazon S3 and similar services is a viable option.
Users' privacy should be protected, i.e. they should be able to set
access permissions on the files they upload (private, friends-only,
public), and it would be interesting to have the "expiry" option,
i.e. a shared file could expire and be automatically deleted from
server after a while.
I know there is IMCE module, I never tried it but from its
description it seems a bit buggy and not so safe from a privacy perspective.


texts: File upload disappears in Web File Manager

texts:
I am trying to upload files to our Web File Manager (in Drupal 6.31), and while everything seems to work fine the file does not appear in the directory list afterward. It does not exist on the server either.

I checked the permissions on the default WebFM folder, and it is 775. I am logged in as the first (super admin) user. I am not receiving any error messages. There are no available updates for Drupal Core or WebFM.

What could be going wrong?

Thanks in advance!


texts:
I have D6 and the Panels module installed.

I want to be able to control the entire page layout from within Drupal itself, without having to write any new code such as a template file etc

To achieve this, I create a very basic template file which includes the standard html, style, body elements etc and just:

<?php print $content; ?>

This works great, it allows me to for example create a Panel layout for different page layouts, but it also allows me to create full-page landing pages without header/footer etc

The only drawback is that for pages that dont have a Panels template, say for example the user login page, how do I then style/structure this page?


texts: Database Size, suggestions on Dev > Staging > Production

texts:
Our Drupal 6 Database is currently 75mb and the site has not even been launched yet. This is making it a bit difficult to export/import between our Dev/Staging/Prod as it is taking some time. I am concerned that in the future the database will become increasingly difficult to the point where it times out.

So how big are some of your Drupal Databases?

I have been exporting the entire database after clearing cache. Is there a simpler way, for example should I only export certain rows ? - leaving all the Cache tables?


texts:
I've been trying to aggregate (SUM) by a date field with a custom format (YYYY, MM) but its not working as expected. I tried Views Date Format SQL and Merge rows modules but didn't work for me. Also, some other suggested solution is to group by field (Table settings) which also does not fit my needs.

2014-08-05     12
2014-08-05     15
2014-08-15     20
2014-09-09     10

Im trying to do it as follows:

2014,Aug      47
2014,Sep      10

Note: My collected dates attributes are year, month , day (i.e. 2014-08-05 00:00:00)


texts: Drupal 8 update.php/selection - access denied

texts:
I wanted to update d8 from 8.0.1 to 8.0.2, but i couldn't run the update.php due to the error "Access Denied". Am logged in as user1 which should have all required privileges.Following the drupal 8 update guide I deleted core and vendor folders with all the files in the drupal root from the the 8.0.1 install, and replaced the same files and folders from the newly downloaded 8.0.2 version.

What could be the solution to this problem?

My Environment:
OSX El Captain, nginx 1.8 using the latest config from nginx/drupal, PHP 7.0.2,

See window capture below:

Many Thanks


texts: Drupal Commerce Adding fields to Add To Cart page

texts:
I need some suggestion to add some fields to the "Add to cart" page.

Out of many products, one of the product requires some user information to be filled before proceeding to "Add to cart" process. I am selling a product of type "Exam". Before buying Product of type "Exam" (Before adding to cart), user has to input his person details like name, address, DOB and other mandatory details without which he is not able to proceed.

Could you please guide me, how to achieve this?

Update:

Shall I use Product Attribute fields to capture user inputs over product display page? As this information is not associated with the Product, but with the order and need to be captured before Add to Cart button is clicked.


texts: Drupal 7 default Forum styling for custom content type?

texts:
Im using Drupal 7's forum module. Its working great but I need to also make a custom content type a forum.

I can allow comments on this custom content type, but can I make it have the same styling as the default forum content type?

UPDATE - The reason I need this is there are 2 user roles. Only registered users can see forums at all. Users with a special role can see private forums aswell.


texts: what is the difference between core search and search api indexing

texts:
What is the difference between core search and search api indexing. The below screen shows up once i visit search setting and number of item left to index is 1809. (en/admin/config/search/settings)

But once i see the index of my search server created under search api it show different results . (en/admin/config/search/search_api/index/recipes_index)

I understand that core search is indexing all items in the site so does my Search API index?

Can someone please explain the difference ?

Thanks


texts: Selecting content type using panels/pages

texts:
We want to select a content type in panels with a specific URL [tgeink.com/latest-news].  Here's why:

We are using panels for several content type 'home pages', like news, articles, etc.  They all rely on a view that displays recent posts in the various content types, along with an exposed menu so that users on the 'news' page only get news when they select a topic.  Currently we are creating different views for each content type because we can't see how to select content type in panels -- we do it in views.

[It's easy if you are using panels for /%node.  We use that to display and edit nodes, with variations for the different content types.]

We'd LIKE to be able use one view for all 'home' pages, and use panels to select the content type.  However, we cannot see how to do this when the panel is referencing a URL such as TGEink.com/latest-news.  Thanks for any help.


texts: How can i customize the display of private message module?

texts:
I am new to drupal, present i am using Private message module 7.x-1.4 version.

After installing this module it look like this (screenshots attached) current look and feel is not pretty. how can I customize this ? suggest me the changes.


texts: How do I deal with serialization unsetting object members?

texts:
Let's say I have a plugin that uses an injected service to get some object. The object is expensive but can't be serialized, so I can only store it as long as my plugin instance lives.

To keep it away from DependencySerializationTrait, I declare it private.

class MyPlugin extends SomePluginBase implements ContainerFactoryPluginInterface {

  /**
   * @var \Drupal\module\ServiceInterface
   */
  protected $service;

  /**
   * @var \Drupal\module\SomeUnserializableThing
   */
  private $data;

  /**
   * Constructor
   *
   * @param \Drupal\module\ServiceInterface $service
   */
  public __construct(ServiceInterface $service) {
    $this->service = $service;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container->get('my_module.service'));
  }

  /**
   * {@inheritdoc}
   */
  public getData() {
    if (!$this->data) {
      $this->data = $this->service->loadData();
    }
    return $this->data;
  }

}

Unfortunately, after serializing and unserializing the instance doesn't have any reference to the member - not even NULL. What happens in ::getData is that the !$this->data check causes an E_NOTICE error even though that variable is explicitly defined in the class.

Are we back to the dark age of isset() and empty() here, or do I need to implement __wakeup() for all my classes to explicitly initialize their private members to NULL? Both seem unpalatable...


texts: Add  element to node body field via WYSIWYG

texts:
I am working on a project where the admin wishes to be able to insert a  element into a node's body field.  The site makes use of TinyMCE editor (wysiwyg module) to edit text area fields.

Currently admin is able to add the  element to the body field by switching to source mode of Full HTML text format (by toggling "disable rich-text").  He can then insert the  element and then save node.  In this case the  element will be preserved in the saved markup.

But if the node is edited again the wysiwyg appears to filter out the  element, which means the admin has to re-add it using the method just described.

This unwanted removal of  element also occurs when switching back and forth between the rich-text editor (toggling the "Enable rich-text" or "Disable rich-text" link below the field) after adding the element.

So it seems it is the wysiwyg is filtering this  element out.

Is there a way of preventing this from happening?


texts: Related nodes by taxonomy term in a view block

texts:
In Drupal 7, I've got a content type called "Asset" with a taxonomy field called "Category". All I need is a Block on the Asset pages that looks at the current node's Category term(s), finds all other Asset nodes tagged similarly, and spits out a list of their titles, links to them, and a few other bits of info from their node.

A Views Block was my first thought... but I'm having a heck of a time making this happen in Drupal 7. Maybe it's problematic because my URL doesn't include the Term ID? Anyway, I've searched and followed a bunch of tutorials (like this one and this one), but to no avail. So, here are my questions:

If Views is the answer, what am I doing wrong?
Is there a Drupal 7 module that can do this for me?


texts: How can i remove Only of the type(s) on the advance options. and username and created day display on the footer search result?


texts: Can I add pagination to individual blog posts in my twig file?

texts:
I have a views page which has all the blog articles, and you can click on a link to bring you to a single blog page.
On that single blog page I want to be able to add buttons for Previous and Next post. Something like
Previous Article
 Next Article

Is this possible?


texts: Is it possible to make manual teaser breaks work with "Filtered HTML"?

texts:
This question is about Drupal 8.

Placing the following line inside a story node's body (I guess it also works for other content types) adds a manual teaser break:

<!--break-->

In Drupal 7, to make manual teaser breaks work with the "Filtered HTML" text format it was necessary to add <!--> to the text format's set of allowed HTML tags (for instance, see this "Drupal Answers" post).

In Drupal 8, however, this solution no longer works: Manual teaser breaks are silently ignored even if <!--> is present in the allowed HTML tags of "Filtered HTML". I have tried to add a couple of plausible seeming combinations to the "Filtered HTML" text format, such as <!--break--> or <!---->, and a couple of implausible combinations (<!--...--> and <!--.*-->), but nothing works.

I double-checked and manual teaser breaks work fine when I switch a story's text format to "Full HTML" text format.

How can I get manual teaser breaks to work again with "Filtered HTML" in Drupal 8? If this is not possible I will have to go through all nodes of my site after the D7 > D8 migration and switch them to "Full HTML".


texts:
H5P module creates iframes and shows content in the iframe. I need to add a js file in the iframe, but I'm not able to do it.

In the documentation there is an example how to add js to h5p:

/**
 * Add scripts to h5ps
 *
 * @param array $scripts
 *  Array of objects with properties path and version. Version is on the form
 *  ?ver=1.0.2 and is used as a cache buster
 * @param array $libraries
 *  Array of libraries indexed by the library's machineName and with an array
 *  as value. The value has the properties majorVersion and minorVersion
 * @param string $mode
 *  What mode are we in? Possible values are "editor", "div", "iframe" and "external"
 */
function hook_h5p_scripts_alter(&$scripts, $libraries, $mode) {
  if (isset($libraries['H5P.MultiChoice']) && $libraries['H5P.MultiChoice']['majorVersion'] == '1') {
    $scripts[] = (object) array(
      // Path relative to drupal root
      'path' => drupal_get_path('module', 'mymodule') . '/h5p-overrides.js',
      // Cache buster
      'version' => '?ver=1',
    );
  }
}

I have created a module, added that script in the .module file and created the overrides.js. But I am not able to get it working, the js file is not added.
What else should I add in the .module file than this script above?


texts: How can I show the user login block on the 403 page?

texts:
With D8, I have a node (content type: basic page) that I use as a custom 403 (access denied) page.

I set this as the custom 403 page on: /admin/config/system/site-information.  The path is /node/21, and the alias is /error/403.

On the block admin page, I added the user login block to the content region.  I added the restriction "show only on certain pages":

/error/*
/view/*
/node/21

I have a view that requires "add content type ABC permission" to access.  The path to the view is /view/abc.  The anonymous user does NOT have this permission.

So, as an anonymous user, I go to /view/abc and am shown the content of /node/21.  BUT, the user login block is not shown.

If I go to the block administration screen and remove the "show only on certain pages" restriction, then I see the block as the anonymous user on /view/abc, but I don't want to show the login block on every single page; I only want to show it on the pages that are 403s.

What is the "path" to use for the user login block to only show it on a custom 403 page?


texts: Redirect from "/mynode?language=de" to "/mynode" after storing the language in the cookie

texts:
Is it possible to remove the "?language=de" query string after Drupal stores the current language in the session and/or the cookie?

I want this so that if someone who speaks French sends a link to someone who speaks German, they will by default send a link that shows in the target user's preferred language.


texts:
I'm trying to build a site for registering educational classes...(sell them)

I want to use Drupal commerce, and add some properties like time,teacher etc. but I want to add some things:

every class has specific capacity. I want users to first, register, then if someone wanted to register, register something like reserved...meanwhile,if sb cancelled order, the reserved people would be registered, after all, we approve the people, no matter registered or reserved, then they can pay....

another thing is that I want that products expire after a while, for example until the tomorrow registration(buying) is allowed.

Is it possible to do these with commerce or Drupal?


texts: Show block in /user/* page, not /user/*/edit

texts:
From the Drupal 8 administration, I configured a block (block created from a custom module) for display it in /user/* pages.

It works; I see this block in /user/* and /user/*/edit pages.
Now, I want to display my block only from /user/* pages (the view mode), not from /user/*/edit pages (the edit mode).

Can I do that from the Drupal Administration page? I tested it adding "!/user/*/edit" but this has no effect.

If I can't, how can I do that from my custom module?


texts: Need dynamic conditional search fields for advanced search for users

texts:
I need a field that will drop down according to first choice, for example:

Region:
 - USA
   - California
   - Florida
 - Canada
  - Quebec
  - Ontario

So if USA is selected, then states will be next, if Canada is selected, then provinces will be next.

Something like here:

http://www.vincentmoving.com/chain/chainedmenu.html

or even better:

http://www.pof.com/basicsearch.aspx

I've tried hierarchal_select, conditional_fields and exposed_filters.

Any solution possible for this?


texts: How to do a lookup of existing nodes in the input form?

texts:
I want to create  in Drupal 8 a content type called Book  with some fields you'd expect to be associated with it.  Title, Author, Date, ISBN, URL

(I want two other content types: "Book Review" and "Book Author.").

I expect to do a lot of different things with books; it's much easier to have a separate content type for it which I can reuse.

The user (or the admin) would initially use the input form to publish  the "Book" (i.e., To Kill a Mockingbird, Great Gatsby, etc)

Next a user having the "Book Reviewer" role would have an input form to publish his review (Title, a text field containing the review, a summary, rating) and publication date.

Here's the thing I don't understand.

Tom (who has the Book Reviewer role) would log on, select "Add Book Review". For this to work, Tom would need some  way in the input form to look up the available book titles already inputted by users in order to choose the specific book he wants to review.

Can you accomplish this in Drupal 8? What is this functionality called? Could this reverse lookup be easily done from the Book Review input form? I'm  unsure exactly how to implement this. I've seen explanations about how you can look up a specific user in the input form, and maybe from the DB point of view, all nodes are the same. But I'm not sure if looking up users is a special case.

Some more details:

I have seen that relationships are a way to connect fields from two
    different content types. But I'm unsure if you could display this
    kind of lookup function in the input form!
I can' predict how many books will be added or need to be looked up
    (maybe 50-1000?). But is there any hard limitation on book nodes you
    could search through?
Is this something you could do through Drupal core without needing
    to make a module?


texts: Integrate custom content type with drupal commerce custom product, how?

texts:
What should / can I do if I want that:

The names of my custom content type in a select box as values of
that select box in my drupal commerce custom product
If any of the value is selected from there then, the fields from the
selected custom content type should be displayed on the same drupal
commerce's add new product page?

Any suggestions?


texts: How can I translate this domain model into the desired front page

texts:
I am quite new to Drupal and CMS alltogether and have some problems choosing the right way to setup my site to achieve my desired result. What I want to do is to create a page for my basketball club to read about upcoming games and practices and get some game reviews.

Domain Model:

So I have a team entity type which represents the different teams in my club. Each team has some reviews, games and standings associated to them.

I think about representing each entity type as a content type and setup the relationship by using entity references.

Is this the common way to do this are is there another recommended way?

FrontPage:

And now I want the front page to look like this ("conceptually"):

I want a row for each team, containing the latest game review, the standings and the upcoming games. Of course I want only those related to the team to show up in the given row.

And I honestly have no clou how to approach this? How would you do this?

Best regards,
Marco


texts: Site not working after the database update

texts:
I cloned a repo of a site to my local computer, imported the database and ran "Composer install --with-dependencies" after the installation had been done I entered the local site and it worked, then I ran "drush updb -y" and it showed a couple of errors and warnings:

    The following module is missing from the file system: aspambot       [warning]
bootstrap.inc:268
The following module is missing from the file system: phpmailer      [warning]
bootstrap.inc:268

...

PHP  27. include() /home/www/sites/zb/web/vendor/composer/ClassLoader.php:444
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Interface 'Doctrine\Common\Reflection\ClassFinderInterface'
not found in
/home/www/sites/zb/web/core/lib/Drupal/Component/Annotation/Reflection/MockFileFinder.php,
line 14
The external command could not be executed due to an application     [error]
error.
PHP Fatal error:  Interface 'Doctrine\Common\Reflection\ClassFinderInterface' not found in /home/www/sites/zb/web/core/lib/Drupal/Component/Annotation/Reflection/MockFileFinder.php on line 14

I'm new to Drupal, so please help me get over these errors, I understand that the solution may seem straightforward to some, but I don't know what to do. Thank you!


texts: Add button to teaser on specific content type

texts:
I have a custom content type for Real Estate
I have a custom view on the homepage that displays the 5 most recently added real estate properties and displays basic information about this property

This view is in a block on the home page.

I essentially want to put a button on these teasers that links to the full node for the user to view. I'm not sure what the easiest way to do this is?

Then, once in the full node I want to have a button that 1. Checks if the user is logged in (using php session or however that is handled with drupal) and then 2. if user is logged in it directs them to another page or if not logged in directs them to log in.


texts: Views slideshow is not being responsive in bootstrap theme

texts:
I created 3 images. Each image size is 1300 x 600.

I created content type SLIDESHOW.

I added 3 contents to the SLIDESHOW.

I created a views slideshows.

I applied my css as below:

 .view-slideshowv .views-slideshow-cycle-main-frame.views_slideshow_cycle_teaser_section, .views-slideshow-cycle-main-frame-row.views_slideshow_cycle_slide.views_slideshow_slide {
    width: 100% !important;

}
.view-slideshowv .views-slideshow-cycle-main-frame-row-item .field-content img {
width: 100% !important;
    }

I placed the slideshow block in a region.
When I visit my page, width is always 100% width which takes the full width of the screen as expected but the height is not being responsive until I press refresh. It means when I visit the page in laptop/desktop, page loads fine. If I try to make the screen
smaller or larger, width is 100% of screen but the height is not being responsive until I hit refresh. How can I fix the issue?


texts: Merge production site's content into staging through database tables

texts:
I am working on a major upgrade on my website which includes several new modules being installed, various theme changes, updates on existing modules and a few modules that were uninstalled.

All the changes have been made in the staging site but, in the meantime, content is continuously being added in the production site. Since the staging site was a mirror of the production site (at that time), I was thinking that since the configuration changes that I made are a lot, I could just merge the database tables that are related to content in the staging site and make it my new production site (after some testing that everything works OK of course).

Notice that I have already checked the Deploy and Node Export modules but the first one is still in Alpha and the second does not support exporting revisions (which is a critical issue for my site).

My question is: what are the database tables that I should export from the production site in order to transfer all the content (nodes, revisions, profile2 entities, files) from the live to the staging database?

Keep in mind that no structural changes related to entities have been made to either database, so they should be identical.

From a preliminary search, the tables that seem to be relevant are: field_* , node_* , taxonomy_* , url_alias, profile, location*.

Is there something that I' missing here (other tables that I should copy or possibly a better way to do what I'm after)?


texts:
Class autoloading isn't working in custom module to extend webforms. Trying to call a function like this:

$utility = new webform_kk_utility();
$utility->getComponents('aaa')

getting this error:

[Mon Sep 21 20:29:28.287580 2015] [:error] [pid 15908] [client ******:39831] PHP Fatal error:  Class 'webform_kk_utility' not found in /var/www/html/sites/all/modules/webform_kk/webform_kk.module on line 12

Here's my code:

webform_kk.info:

name = Webform kk
description = custom webform code
core = 7.x
package = Webform
dependencies[] = webform
files[] = includes/utility.inc

webform_kk.module:

<?php

function webform_kk_form_alter(&$form, &$form_state, $form_id) {
    if ($form_id == 'webform_client_form_1') {
        $first = array_shift($form['#submit']);
        array_unshift($form['#submit'], $first, 'webform_kk_submit_1');
    }
}

function webform_kk_submit_1(&$form, &$form_state) {
    $utility = new webform_kk_utility();
    echo $utility->getComponents('aaa');
    die();
}

includes/utility.inc:

<?php

Class webform_kk_utility {
    function getComponents($components) {
        return $components;
    }
}

I tested the code without calling the external function, the code is running and the form submit dies where expected. I tried disabling, uninstalling the module and clearing the cache.

Thanks for the help.


texts: Views - Protect user-assigned content from direct url access

texts:
I'd like to create a restricted area from scratch using views.

What I'd like to achieve:

The admin creates a photo album and assigns it to a photographer
A photographer is able to log into the site, and see a list of albums that are assigned to them
The photographer can upload photos to the album
If a non logged user tries to access the album by typing its url, they get rejected
Ideally, photos (the files themselves) that are in an album are also protected, I know that file access restriction is a complex subject, but I'm okay with a sort of proxy-page that would then redirect to the file with an unguessable url, or a solution of this type.

Where I am so far:

Create a user role Photographer
Create a content type album with fields:

Photographer (user reference, role=photographer)
Photos (file, number of values unlimited)

Create a view to list content type=album, with a contextual filter on the Photographer field that defaults to current user id when not provided in the url. So that a logged photographer only sees their own albums. That works fine.

My problem:

Anyone can enter an album's url and access it directly [solved]
Anyone can enter a photo's url and download it [solved]

I've built this on drupal 8 but can also use drupal 7 and other modules. Any help would be very much appreciated!

Update:

I think I found part of the answer. Using private directory with the files module: https://www.drupal.org/documentation/modules/file. According to the docs:

  For example: you have created a new content type with a file field
  which stores files in your site's private file directory. Next you
  create a node from this new content type and attach two new files.
  When the node is published links to both attached files are visible
  and anyone who can view the node may download the files. Now, if you
  unpublish the node, all attached files become inaccessible for
  download even if you use the direct link to the files that worked when
  the node was published.


texts: How to send out email based on matching taxonomy terms in user profiles?

texts:
I'm using profiles 2 and have (one or many) taxonomy terms that can be selected by a specific profile type.  I have a webform that also has this taxonomy term in the select list.  When the webform is submitted, if it matches one of many taxonomy terms in any of these profiles I want an email sent to those profiles.  I can't figure out how to get Rules to do this.  Any help is appreciated.

This is what I have so far.  I just have it posting a message right now to test, but I want it to email, but I can't find the data I need to compare in the Rules.

{ "rules_webform_email" : {
"LABEL" : "Webform Email",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "webform_rules", "rules" ],
"ON" : { "webform_rules_submit" : [] },
"IF" : [
  { "webform_has_id" : {
      "form_id" : [ "form_id" ],
      "selected_webform" : { "value" : { "webform-client-form-3" : "webform-client-form-3" } }
    }
  },
  { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "webform" : "webform" } } } }
],
"DO" : [
  { "drupal_message" : { "message" : "Test submit webform\r\n[data:project_type-value]\r\n[data:project_description-value]" } }
]
}
}

The project_type is the taxonomy term in the webform.  I need to compare it with the field_service_provided (Term Reference field to the same taxonomy vocabulary) in the Profile.


texts:
Inside my html.html.twig template I've added a stylesheet inside the style elements using this.

{% include directory ~ '/css/base/style.css' %}

Is there a way that I can strip it for all whitespaces? Can I apply the CssOptimizer class to it in any way? Can I also strip the stylesheet for comments?


texts:
I have a view where I want to use the jQuery UI slider.
For the moment, I've just put the following in my template.php:

drupal_add_library('system', 'ui.slider');

This doesn't feel right.

Is there a better place to put something like that, or at least do a check so it only get loaded when it is needed?


texts: How to set role on the registration form programmatically

texts:
I'm trying to create multiple registration forms with a role assigned to each.
It seems that my default value for the role is not keeped, but it works with other fields
Here is my code
$form = $this->entityFormBuilder->getForm($account, 'mycustomdisplay');
$form['account']['roles']['#default_value'][] = 'mycustomrole';

Thank you.


texts:
I am new to Drupal 7 and am trying to do the following:

1) I have a node that's aliased to domain.com/inventory - the node has code that'll generate dynamic content.

2) My site creates dynamic URLs like domain.com/inventory/ABCD and I need to know how to a) figure out that I'm on the /inventory page and b) extract the argument "ABCD" from the URL.

Can you please help me?


texts: Views Block: one node latest of several categories

texts:
Is it possible to do with the views I had one recent node of the 5 categories?
example:
- Category 1 (20 node)
- Category 2 (10 node)
- Category 3 (5 node)
- Category 4 (17 node)
- Category 5 (2 node)

VIEWS BLOCK:

Newest node (category 1) only one!
Newest node (category 2) only one!
Newest node (category 3) only one!
Newest node (category 4) only one!
Newest node (category 5) only one!


texts: I have HTML desing of pagger ,How to I assign my own class to pager in side view ?I dont have any idea about it so will you plese tell how can I ?


texts: How to overwrite a view template from within a module?

texts:
Till now I only used the theme folder to overwrite specific view templates. In order to be able to separate code from theming and bundle functionality I would like to put this view template into a custom module using features.

I guess there won't be a direct way to do this in features itself but that wont be the main problem here.


texts: how to get the count of total comments posted for specific content type including deleted comments too?

texts: I want to get the total count of comments posted only for a specific content type including deleted to get the highest comment id no matter whether comment is been deleted. please help me or else suggest me other way to achieve this.


texts: Multilanguage in IE does not allow to switch languages

texts:
My drupal site is built with 2 languages English/Portuguese, and the default language is English.

But in IE the default language (English) is overwritten and it only displays the  Portuguese version, and if i click the English icon it does not change to English.

However if i browse with an English computer the English is displayed, but i can't still switch from Portuguese to English.

Some advice is appreciated.


texts: Page redirect in rule after VBO new custom operation is is not redirecting

texts:
I need to page redirect after the VBO operation.

The page redirects is inside a rule component that I have created for a new operation in VBO.
This is the my new operation in my VBO:

I have marked force redirect. And it doesn't work too.
I tested installing rules debug, to see if rules was executed, and it shows as executed, but it doesn't redirect to cart.
What could I check on this issue?

The debug is showing, skipping page redirect during the batching process, see it please.

How could I add a rule for page redirect, just after the batch process of my VBO operation? This could works.

Note: Not very relevant but

Here is the export of the rule:

{
 "rules_vbo_add_to_cart" :

"LABEL" : "A\u00f1adir las fotos seleccionadas al carrito",
"PLUGIN" : "action set",
"OWNER" : "rules",
"REQUIRES" : [ "commerce_cart", "rules" ],
"ACCESS_EXPOSED" : "1",
"USES VARIABLES" : { "commerce_product" : { "label" : "Commerce product", "type" : "commerce_product" } },
"ACTION SET" : [
  { "commerce_cart_product_add_by_sku" : {
      "USING" : {
        "user" : [ "site:current-user" ],
        "sku" : [ "commerce-product:sku" ],
        "quantity" : "1",
        "combine" : "1"
      },
      "PROVIDE" : { "product_add_line_item" : { "product_add_line_item" : "Added product line item" } }
    }
  },
  { "redirect" : { "url" : "\/cart" } }
]

}

}


texts: How to display the pager on top and bottom of a custom search results page?

texts:
I have used the core Search Page functionality in Drupal 8 to built a search engine on my site.  The pager is displayed at the bottom by default. How can i display the pager on the top also?

Note: I have not used views to built the search page.

Thanks!


texts: drupal_alter() ignores more complex function names when the hook is called

texts:
I have a module named wlm that calls drupal_alter() as follows.

drupal_alter('abc', $ref, $arg1, $arg2);

This works perfectly for a function like the following.

function wlm_abc_alter(&$ref, $arg1, $arg2) { };

However, it breaks/does nothing if the function is similar to the following one.

function wlm_this_is_some_extra_detritus_abc_alter(&$ref, $arg1, $arg2) { };

I want to be able to call this alter function several times within my wlm module, but because the naming convention seems to be limited to module_hook_alter() I can only use it once, which is less than desirable. Is this an intentional design pattern; or is it a mistake; or am I just missing something obvious?

Is it possible to do something like the following, where $my_func_name is delivered dynamically?

drupal_alter($my_func_name . '_abc', $ref, $arg1, $arg2);


texts: How to set domain based search using search_api_solr?

texts:
I am using Domain and Search API Solr module in my project. On all domains, searching for a content gets result(content) from all domains. I would like to get search results according to the domain.
For example, if a user is on domain a.domain.com, then the search should return content which is published on a.example.com only and not on any other domains or sub-domains.


texts: Display products related to a content type through a vocabulary

texts:
I have different product variations with a vocabulary (Artist) which is also used for the Artist content type.
How can I use a view to show the related products which use a specific value from that vocabulary?


texts: redirect to another page on webform submit using [current-page:query:?] token

texts:
I am trying to configure a webform to redirect to another page after submission by including the redirect location in the url:

http://mysite/content/barb?destination=content/discus

According to webform there is a token [current-page:query:?] which I assume can extract the value of destination.  I have including it in the webform redirect to custom URL of the form, but I cant get it to work.

I have tried:

[current-page:query:?]
[current-page:query:?destination]
[current-page:query:destination]

But nothing seems to work. What is the correct way of using this token to get a variable from the URL?


texts: how i create panels with custom tag like header, section footer etc..?

texts:
My designs contain custom tags like ,
 and ,
how can I create panels with these tags and put in it many of panels nested?


texts: Add a text field to OG subscription form

texts:
I would like to add a text field to the og_ui_confirm_subscribe form so that applicants can motivate their request to the owner of the group.

I don't have any problem to create the field and attach it to this form through a simple hook_form_alter but I am lost once I have to link the text field to the user of the OG admin...

I've googled but it doesn't seem to be a highly requested feature (only a - brief - mention found in OG 4.7 but this didn't led any further. It's weird since it means that admin are supposed to accept/deny only based on username...

By the way, these OG admin pages are very poor in terms of UI so I might think customizing them with Views & VBO; would this direction be a good way to go to easily get my text field?


texts: In Views, when using a filter on a datetime field, what is the time zone of the offset?

texts:
When I use an offset like "-4 hours" in a Views filter on a datetime field, which timezone is used?
More details
In Views, when I add a filter for a datetime field, I get the following options for Value type:

A date in any machine readable format. CCYY-MM-DD HH:MM:SS is preferred.
An offset from the current time such as "+1 day" or "-2 hours -30 minutes"

On my site, users can set their own timezones. (/admin/config/regional/settings Users may set their own time zone)
So there are potentially three timezones in play:

In the database, the strings for datetime are stored in the UTC timezone
The site timezone is set to Tokyo
The user timezone is set to Berlin

So, which of these timezones does the offset use?


texts: user relationship node access is not working

texts:
I have enabled the module and tried to work on it. I have created the following users: mtest, emptest, and mdev.
I'm using the Views module to show the nodes. The nodes posted by emptest should only visible to mtest, but this is not happening, even after using the Node access and Content access module.

How do I restrict this?


texts: How do I programmatically add a new language?

texts:
I am using Drupal 8 on a multi-lingual site which uses Arabic and French.

I need to programmatically add a new language from a custom module. How can I do it?


texts: How can I create a custom page with a different template?

texts: I want to have a page (e.g. the one at http://example.com/mypage) shown as a blank page. How can I use a different template for that specific page, to show it as a blank page?


texts: Adding javascript to admin view and user view

texts:
I have a form with a text plain long description field. Added Javascript to limit the amount of characters allowed in the field.

(function($){
    $("#edit-field-busines-0-value").attr('maxlength','500');
})(jQuery);

It works for the Authenticated users view, but not for the Admin users view? How can I have this work on the Admin view also?


texts: Users get a new password detect forced logout

texts:
I want to create a rule:
When the user changes the new password, the system should force the user to log out and then use his new password to login.

I know the event to choose after updating an existing user account.
The next part is to be added in the ELEMENTS PHP source code to detect it?

I have tried this code. It fails, the user can no longer change the new login password.

function mytheme_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id =='user_pass'){
    $form['#submit'][] = 'mytheme_password_redirect';
  }
}
/**
* Redirects user after password reset form is filled
*/
function mytheme_password_redirect(&$form, &$form_state){
  $form_state['redirect'] = 'user/lougout';
}


texts: How to see Database logs in Devel module

texts:
I have installed Devel module in Drupal 7. I am able to see logs of error in each page I visit (when I am logged as admin), but, however, have not been able to see the database logs except in the Admin GUI, in the layer windows.

When I close the Admin GUI (without logging out) and visit other pages of my site, I cannot see the database logs. I installed Devel in other project long time ago, and I would dare to say that I saw these database logs in every page.

What is the recommended config: see all errors, and which template to use?


texts: How can I get data from ResultRow object in views template

texts:
I am trying to theme a Drupal 8 views. When I print the row variable using kint method I am getting below result. But I'm not sure how could I access the values in the object.

I tried below options. But nothing works.

{{ row._entity.title.value }}
{{ row.contents.get('title') }}
{{ row.contents.contents.title }}

Could anyone please help me how could I iterate through row data in views twig template.


texts:
I want to the content of a content type to be available in two languages. One is English(default) and other is Chinese(simplified).

So I add language Chinese(simplified) from "admin/settings/language/add" and then download the .po files for the language and import the files for the Chinese(simplified) language.

Then I enable my content type's Multi language support with "Enabled, content translation".

Then I create the a content of that content type and select the Chinese(simplified) language from the language drop down.

But the content of that node is displaying in English language and I have selected the chinese language while creating the content. So its content is not displaying in the Chinese language?

Any Idea or help will be appreciated.

Thanks in advance.


texts: Link items from Feeds module to original blog

texts: I am using the Feeds module to publish the contents from a Wordpress blog to my site's home page. I'd like to have the items on the home page link directly back to the original blog rather than the nodes that the Feeds module creates. Is this possible? If so, how do I do it?


texts: How to display Views exposed filters fields as a table?

texts:
I would like to display Views "Exposed filters" fields as a regular table, where the first column would be the field label, and the second column would be the field options/select lists.

So for example from this:

I would like to create this:

What is a possible solution for this?


texts:
I'm using hook menu here for the first time as token menu doesn't seem to be doing what I need.

In the end, I need a menu that will use a wildcard and load a view based on that wildcard. I have the views working, now working on the menu.

I have a "directory" structure like so:

committee/committee-name/charter
committee/committee-name/roster
etc...

So I am using hook menu like so:

$items['committee'] = array(
        'title' => 'Committee Page',
        'page callback' => 'committeemenu_mymenu_page_callback',
        'access callback' => TRUE,
        'type' => MENU_NORMAL_ITEM,
    );

    $items['committee/%/roster'] = array(
        'title' => 'Roster',
        'page callback' => 'committeemenu_mymenu_page_callback',
        'access callback' => TRUE,
        'type' => MENU_NORMAL_ITEM,
    );

    $items['committee/%/charter'] = array(
        'title' => 'Charter',
        'page callback' => 'committeemenu_mymenu_page_callback',
        'access callback' => TRUE,
        'type' => MENU_NORMAL_ITEM,
    );

Committee shows on my menu, but Roster and Charter don't. I am not sure why not? If I give a wildcard, committee/%, to committee for example, I get no menu item. So is this a wildcard issue? should I be able to use a wildcard here? I am going to pull in a view based on wildcard and charter/roster content types.


texts: Automatically fill title attribute of image

texts:
I defined a content type that consists of a field photo for which I can add up to 20 photos. I'm using the Multiupload Imagefield Widget module to be able to upload several images to one node. Since I'm using descriptive filenames, I would like the title attribute of each image to be automatically filled (instead of filling them all by myself). Does anybody know how to do this?

I looked at the File entity module, but this creates individual pieces of content for each Image I upload. That is not the direction I want to go in.

UPDATE: I'm using D7


texts:
Does anyone know if there is a way to set the value of a field with states?

E.g. If "this" is checked, set input value to "0"

Something like....

$form['booking_process'] = array(
        '#type' => 'textfield',
        '#states' => array(
            'value["0"]' => array(
                'select[name="field_relation[und]"]' => array('checked' => true),
            ),
        ),
    );

I always do this with my own JS, just wondered if there was a feature in states I was missing?


texts: What would be best method to append bootrap css to non bootstrap themes but not affect layout?

texts:
I want to use Adaptive themes, I like the layout options, however, I like the Bootstrap look and feel.

So I want Adaptive theme layout css with boostrap visual css basically.

What would be the best way to achieve this short of getting into the HTML of Adatptive them and changing all the classes on elements?


texts: How to make a content type field unique per user

texts:
I want a date field to be unique per user so they can't add two nodes with the same date. I have Unique Field installed. Unfortunatly, they don't offer user scope.

Anyone know how to achieve this?


texts: Url Path Alias is not working with the "raw value from URL contextual filter"

texts:
I could really use some help with this one. Long story short, I have a contextual filter which pulls the taxonomy term from the url (2nd position).

For example: if I'm at walldamp/drupal/acoustics, it will pull all the nodes with the tag "acoustics".

Here's the problem: Drupal doesn't read path alias's. The actual address for walldamp/drupal/acoustics, is something like walldamp/node/59. So if I have an article tagged 59, it works.

I do not want to change all my tag's to the node number, because this needs to be really user friendly. How can I get my contextual filter to read the url displayed, or is there another work around?

Thank you.