texts:
I have a view that display 8 images(which links to their particular node) uploaded by the all users, now i want to display a counter which counts total number of times that image or that image link have been visited/viewed.

Please help me.

I think ..Its like if you on the left of this Question answer section on this site they have mentioned three things
1.Asked Today
2.Viewed 4 times(or total no. of times viewed )
3.etc

my requirement is second.
Thanks


texts: Adding the bootstrap theme to one region

texts:
I have complex site with a custom theme.  I was thinking of implementing the Bootstrap theme, but only for one region.

Is this possible?  Is there a different way to go about this?

thanks so much : )


texts: Shipping method and shipping service from a placed order

texts:
Im trying to get the shipping method and the shipping service values after i place an order on a Drupal 8 commerce website so i can use it inside an email im sending the website's owner (not the receipt for the client). I know Swift email would be an option but i have to continue with what i have. So far the owner of the website does receive an email but i need to add more information to it like the shipping method and shipping service.

I've got as far as finding out that $order->shipments->entity  will give me, among other values, these 2 fields shipping_method and shipping_service.

Shipment {#4521 ▼
  #values: array:19 [▼
    "shipment_id" => array:1 [▶]
    "type" => array:1 [▶]
    "uuid" => array:1 [▶]
    "order_id" => array:1 [▶]
    "package_type" => array:1 [▶]
    "shipping_method" => array:1 [▼
      "x-default" => "2"
    ]
    "shipping_service" => array:1 [▼
      "x-default" => "PRIORITY_OVERNIGHT"
    ]

Where do I find the values of the shipping method value whose ID is 2 and the shipping service value whose ID is PRIORITY_OVERNIGHT?
Is there an easier way to get the shipping method and service from a placed order?


texts: I can send data to a template page on form submission. but pagination not working properly

texts:
The module file:

<?php
function BM_weather_API_part2_theme() {
  return array(
    'BM_weather_API_part2' => array(
      'template' => 'BM_weather_API_part2',
      'variables' => array('msg' => NULL),
    ),
  );
}

function BM_weather_API_part2_menu() {
  $items['weather/report'] = array(
    'title' => 'Weather API - Part 2',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('BM_weather_API_part2_form'),
    'access arguments' => array('access content'),
    'file' => 'BM_weather_API_part2.pages.inc',
  );

  return $items;
}

.inc

 function BM_weather_API_part2_form() {
  $form['location_name'] = array(
    '#title' => 'Location',
    '#type' => 'textfield',
    '#required' => TRUE,
  );

  if (!empty($form_state['BM_weather_API_part2']['weather_result'])) {
    $form['result'] = array(
      '#markup' => $form_state['BM_weather_API_part2']['weather_result'],
    );
  }

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Get the weather report',
    '#validate' => array('BM_weather_API_part2_form_validate'),
    '#submit' => array('BM_weather_API_part2_form_submit'),
  );

  return $form;
}

function BM_weather_API_part2_form_validate($form, &$form_state) {
  if (BM_weather_API_part2_check_location($form_state['values']['location_name'])) {
    $form_state['BM_weather_API_part2']['weather_result'] = FALSE;
    form_set_error('location_name', t('Please enter a proper location name.'));
  }
}

function BM_weather_API_part2_form_submit($form, &$form_state) {
  $query = db_select('hello', 'w')
      ->fields('w', array(
    'a',
    'b',
    'c',
    'd',
    'e',
    'f',
    'g',
  ))
    $table_sort = $query->extend('TableSort') // Add table sort extender.
      ->orderBy('g','ASC');
    $pager = $table_sort->extend('PagerDefault')
      ->limit(10);
  $records = $pager->execute();
rows = array();
foreach ($records as $val) {
$p = $val -> a;
rows[] = array($p);
}
$value = array('rows' => $rows);
$output = theme('BM_weather_API_part2', array(
    'msg' => $value));
$output .= theme('pager', array('quantity',count($rows)));
  $form_state['BM_weather_API_part2']['weather_result'] = $output;
  $form_state['rebuild'] = TRUE;
}

function BM_weather_API_part2_get_weather($loc) {
  // ...
}

.tpl

something

        <?php
        for($i=0;$i<count($msg['rows']);$i++) {
  echo('
');
  echo('' . $msg['rows'][$i][0]. '	');
  echo('
');
}
       ?>

Here I'm able to call tpl and also pagination is showing but when I click next in pagination, the page reload and no data is showing and pagination disappears.


texts: How to import url of the nodes via feeds

texts: When I use url field in feeds import the url does not get imported for some reason


texts: How do I programmatically remove one breadcrumb link?

texts:
in Drupal 7 I could just use array_pop($breadcrumb), but in Drupal 8 the breadcrumb is an object and I don't see a method for removing the last element.

How can this be done?


texts: How do I render multiple form fields select boxes in a single row

texts:
I am trying to render three dropdown boxes to be on the same line using a tpl file. Here is the snippit of code I am trying to work with:

$form_stuff = array();
$form_stuff[]=$form['field_list_1'];
$form_stuff[]=$form['field_list_2'];
$form_stuff[]=$form['field_list_3'];
print drupal_render($form_stuff);

I have also tried:

print drupal_render($form['field_list_1'] . $form['field_list_2'] . $form['field_list_3']);

Both will render each field element on a separate line.

This gets me a little closer but the dropdown renders on top of the label. It there a way to insert a
 after the label renders or some sort of style=display:block?

print '

';
print '' . drupal_render($form['field_list_1']) . '	';
print '' . drupal_render($form['field_list_2']) . '	';
print '' . drupal_render($form['field_list_3']) . '	';
print '

';

Thanks


texts: I have installed Flexslider on my site (just locally on PC at the moment), it adjusts the width of the slide fine when I reduce the size of the screen width using the browser, but the height of the slide always stays the same and the image appears crushed when the browser is at minimum width. Can anyone help please? I have tried going through all the youtube videos etc.. but cant see what I'm doing wrong. I am using the Omega 3 theme if thats relevant.


texts: htaccess www redirect not working correctly?

texts:
I have this line in my htaccess file:

  RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]

  RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]

And it works for the most part. But if you go to www.mysite.com/pagetitle, it redirects you to mysite.com/index.php?q=pagetitle. Why would it not redirect you to mysite.com/pagetitle? Is there another portion of code I need to insert into the htaccess file? I do already have search engine-friendly URLs enabled.


texts:
I have created a content type - Shops in College

I would like to display opening days and times. Something like this:

Monday - 09:00-18:00

Tuesday - 09:00-18:00

Wednesday - 09:00-18:00

Thursday - 09:00-18:00

Friday - 09.00-13:00

Saturday - Closed

Sunday - Closed

Is there any way I can do this by managing the fields? Or how would I go about this?

Thanks


texts:
What's the difference between access arguments and access callback?

Suppose I set the access callback to 'user_access', and array('custom permission') is the value for the access arguments.

What does that mean? How do they affect each other?


texts: Logging into Drupal 7 site with headless browser: why would it fail?

texts:
NOTE: I've heavily revised the wording of my question to focus more clearly on the problem.  There's a ton of really really useful information in the answers below, but not all of it applies to solving the problem of logging in with a headless browser.  (Feel free to view the edit history for more details, as well as a more verbose version of the same info.)

I'm using a headless WebKit browser (from CasperJS to log into my Drupal 7 site, and it is failing for unknown reasons.  I first used the Ruby version of the Mechanize library and got identical results: access denied even after filling out and submitting the log in form.  I'm pretty sure the problem has to do with Drupal, and some failure on my part to jump through some hoop (that is probably there to prevent spambots and such from submitting to Drupal-based sites).

Since my script loads the log-in form before submitting it, AFAIK it should work just like a normal user logging in.  I've looked through the methods mentioned in the answers that details Drupal's form-submission process, but I'm not seeing what would cause my problem.

This question seems to provide clues, though it is D6 and using curl.  That person is passing field_source, form_token, form_build_id, and form_id as fields.  In my form I only see form_build_id and form_id. Should I be passing all those fields, even though they don't seem to be present in the login form?  Drupal seems to look for form_token, but it's not present on my login form.  What's up with that?

NOTE: Someone will undoubtedly ask why I'm using these tools when there must be better ways with such-and-such a Drupal module, and the short answer is just that I chose to use tools I'm most familiar with.   If you have good module suggestions please leave comments (with implementation details if possible) as I'd love to hear the suggestions, but I'd still appreciate an answer to this question as it is asked.  Thanks.


texts: How do I force Breadcrumb to use a menu other than Main Menu?

texts:
I am trying to force breadcrumb to follow the structure of a menu other than Main Menu.

I have configured the content type to use the new menu to add links, which are displayed correctly in the sidebar menu. However breadcrumb just displays Home > (current_page).

Where is this configured? Is it hard coded?

Any advice appreciated.

Cheers
Paul


texts: created element with ajax ,not act autocomplete

texts:
i have a select option value , in change create a text field with auto complete feature,
every thing is ok , but autocomplelete of this element not work!!!

part of my code

        $form['azlocation']=array(
            '#type' => 'select',
            '#title' => 'location',
            '#options' => array(1,2,3),
            '#default_value' => 1,
            '#description' => t('select your news location.'),
            '#ajax' => array(
                    'event' => 'change',
                    'callback' => 'country_select_f',
                    //'path' =>'roadtonowhere',
                    'wrapper' => 'city-term',
                    'method' => 'replace',
                    'effect' => 'fade',
            ),
            );
    $form['field_terms_city']= array(
            '#markup' => '

');

    function country_select_f(&$form, $form_state){
$form['city_list_item2'] =array(
        '#type' => 'textfield',
        '#title' => t('select city (optional)'),
        '#autocomplete_path' => 'user/autocomplete',
        '#weight' => -1,
        '#attributes' => array('id' =>'city-term-select'),
);

where is the problem?


texts: User relationship ignored in autocomplete entity reference view

texts:
I have a content type called "games". I also have a rol for users named "players" and another "trainer". Each player and trainer has a "team" also. This is very simple: when the user (a trainer) adds a new Match he has an entity reference view autocomplete to add the players.

So far, so good. Now i 've just added a relationship in the entity reference view selecting the team of the user (he would be the trainer) in order to get the listing only with the players of the same team.
In this way, the trainer only can add those players of his team.

My problem is the autocomplete totally ignores this relationship showing any player of any team. :(


texts: Why do the RSS feeds created by Views not validate?

texts:
Using the W3C Feed validator my very basic RSS feed from a View fails validation. It seems to be all of the additional attributes in the  element:

<?xml version="1.0" encoding="utf-8" ?>
  <rss version="2.0" xml:base="http://mydomain.com/blog" xmlns:dc="http://purl.org/dc/elements/1.1/" content="http://purl.org/rss/1.0/modules/content/" dc="http://purl.org/dc/terms/" foaf="http://xmlns.com/foaf/0.1/" og="http://ogp.me/ns#" rdfs="http://www.w3.org/2000/01/rdf-schema#" sioc="http://rdfs.org/sioc/ns#" sioct="http://rdfs.org/sioc/types#" skos="http://www.w3.org/2004/02/skos/core#" xsd="http://www.w3.org/2001/XMLSchema#">
    <channel>
    ...

I get this error: "Unexpected xsd attribute on rss element" with this help info: http://validator.w3.org/feed/docs/error/UnexpectedAttribute.html

The feed loads fine in my RSS reader app on my iPhone though :s


texts: Can we automate scheduled published/Unpublished nodes in drupal 8?

texts:
Schedular Module helps to schedule Nodes publish and un-published in Drupal 8. But it affect took place on each cron run only.

For example. If I set Publish a Node A on 19/10/16 14:30 but site configure to run cron after each hour. So it's get published on 14:00.
Is their any way to make it publish on exactly 14:30.

Thanks


texts: apache solr result logged users node should appear on top and then other user's node

texts: I am using apache solr modules. My requirement was if I hit the search logged in user node should appear on top and then other user's node. How to achieve this requirement. Any help will be greatly appreciated.


texts: Internal server error when programmatically updating about 100 nodes

texts:
I'm writing a function that unpublishes a bunch of event-type nodes within a date range. My query pulls about 100 nodes, but I'm apparently maxing out the available memory. Here is the code in question:

$sql = "SELECT node.nid AS nid FROM node node  LEFT JOIN content_type_event node_data_field_event_date ON node.vid = node_data_field_event_date.vid WHERE (DATE_FORMAT(ADDTIME(STR_TO_DATE(node_data_field_event_date.field_event_date_value, '%Y-%m-%dT%T'), SEC_TO_TIME(-25200)), '%Y-%m-%d') >= '2014-09-10' AND DATE_FORMAT(ADDTIME(STR_TO_DATE(node_data_field_event_date.field_event_date_value, '%Y-%m-%dT%T'), SEC_TO_TIME(-25200)), '%Y-%m-%d') <= '2015-09-10') AND (node.type in ('event'))";

$nids = mysql_query($sql);
$report = "";

while ($nid = mysql_fetch_array($nids)) {
    $node_id = $nid['nid'];

    $node = node_load($node_id);

    $node->status = 0;

    node_save($node);
    $report = $node->title . " unpublished.";
}
drupal_set_message($report);

Any suggestions greatly appreciated.


texts:
i have a problem considering drupal 7 and views.
i have a taxonomy view the lists al the terms:
http://conversal.w0p.be/feesten

Now i have used profile2 for tagging my profiles an made a second view that listens to an argument /feesten/%

But now if i want to get all the http://conversal.w0p.be/feesten/evenementen
profiles i et the page that gives the detail of that term and not the profiles.
Ive googled a lot and can't find any good answer related to this :s

THNX in advance !


texts: What to choose Content Type or Drupal Commerce or Ubercart

texts:
I'm working on a project where we've people managing product in site (including product creation, editing, viewing, reviewing, etc.). These are not going to be techie people so the product management should be easy to use with quick loading. The site as of now doesn't allow users to sell and buy product online (It might allow in future, but not confirmed - very less chances). Its just viewing, reviewing, rating products. Also there will be variety of product. We're also planning on creating Mobile App for this so user can manage products from App.

As I've already worked with all of these 3 earlier, my personal thought is that Drupal Commerce and Ubercart may add an extra overhead of e-commerce functionality on our site. I need suggestion on how should we proceed here, what things should we consider while selecting any one of these 3. What should be best choice to go ahead in such scenario i.e. Plain content type or Drupal Commerce or Ubercart.


texts: is anyone using credit link and credit link file together and linking to nodes AND Files

texts: I'm obviously missing something very simple. I installed ckedit link with wysiwyg module and when selecting internal links I can select nodes.  Then I installed ckedit link file and internal links only allow me to link to files.  There must be a way to use internal links for nodes or files, but I can't seem to find it.


texts: I want to make a news slideshow of nodes

texts:
I see the module Views jQFX Nivo Slider and it's mentionned that the current slideshow is a demo of it.
I installed the module and really don't know how to make something like that with it..
Can you help me please ?


texts: How to add Colorbox to a field in a twig template?

texts:
I have a site with various products on it. So I created node--product.html.twig. I then removed this from my twig template:

{{content}}

Because I want to display fields myself in a custom format, without relying on Drupal's built-in display. So for the most part this was easy, as I could do this:

<img src="{{ file_url( node.field_product_images.0.entity.uri.value | image_style('shop_thumb_400_x_400')  ) }}" alt="" />

This works perfectly. But my problem is that I want the user to be able to click on this image and see it in a modal view, but USING the Colorbox module.

Is there another way to output this field in the twig template so that it automatically loads colorbox and everything that is needed?


texts: Quick Edit not working for node template fields

texts:
I have a custom theme, which is a child theme from the Bootstrap theme. I have Quick Edit module enabled and I'm logged in with a user that has context menu permissions.

For some reason, the context links are not displaying against any of the fields, apart from the title field (although this does not consistently display the Quick Edit option - but just allows me to edit or delete the node).

I'm using custom node templates for my content types, and outputting each field individually, using {{ content.my_field }}.

The output from a typical field is as follows:

    This is a sub header

In the node template, the following wraps all template content:

The following javascript error is displayed:

Uncaught TypeError: Cannot read property 'getAttribute' of undefined
at processField (quickedit.js?v=8.3.2:380)
at HTMLDivElement.<anonymous> (quickedit.js?v=8.3.2:93)
at Function.each (jquery.min.js?v=2.2.4:2)
at n.fn.init.each (jquery.min.js?v=2.2.4:2)
at Object.attach (quickedit.js?v=8.3.2:92)
at Object.Drupal.attachBehaviors (drupal.js?v=8.3.2:160)
at drupal.init.js?v=8.3.2:17
at HTMLDocument.t (ready.min.js?v=1.0.8:4)

From digging into the error a bit, it looks like Quick Edit isn't appending a data-quickedit-entity-instance-id attribute to my field instances. I've no idea why or how to fix it though?

Any ideas gratefully received.


texts: Access table form field's data from submitForm

texts:
I'm building a custom form and it display well. My form has a table type field which I can't manage to access from the submitForm method.

public function buildForm(array $form, FormStateInterface $form_state)
{
    $form['name'] = [
        '#type' => 'textfield',
        '#title' => $this->t('Name'),
        '#required' => true,
    ];

    $form['template_components_list'] = [
        '#type' => 'table',
        '#caption' => $this
        ->t('My table.'),
        '#tree' => TRUE,
        '#header' => array(
            $this
            ->t('row_name'),
            $this
            ->t('description'),
            $this
            ->t('actions'),
        ),
    ];

    $form['template_components_list'][0]['row_name'] = array(
        '#plain_text' => 'Test1',
    );

    $form['template_components_list'][1]['row_name'] = array(
        '#plain_text' => 'Test2',
    );

    $form['actions'] = [
                '#type' => 'actions',
            ];
    // Add a submit button that handles the submission of the form.
    $form['actions']['submit'] = [
                '#type' => 'submit',
                '#value' => $this->t('Submit'),
            ];

    return $form;
}

I'm then trying to access the values in submitForm from multiple ways (some creating errors but I want to show I tried them)

public function submitForm(array &$form, FormStateInterface $form_state)
{
    \Drupal::logger('some_channel_name')->warning('
' . print_r('START', TRUE) . '
');
    \Drupal::logger('some_channel_name')->warning('
' . print_r($form_state->getValue('row_name'), TRUE) . '
');
    \Drupal::logger('some_channel_name')->warning('
' . print_r($form_state->get('row_name'), TRUE) . '
');
    \Drupal::logger('some_channel_name')->warning('
' . print_r($form_state->get('row_name')->getValue(), TRUE) . '
');
    \Drupal::logger('some_channel_name')->warning('
' . print_r($form_state->getValue('template_components_list'), TRUE) . '
');
    \Drupal::logger('some_channel_name')->warning('
' . print_r($form_state->get('template_components_list'), TRUE) . '
');
    \Drupal::logger('some_channel_name')->warning('
' . print_r($form_state->get('template_components_list')->getValue(), TRUE) . '
');
    \Drupal::logger('some_channel_name')->warning('
' . print_r('END', TRUE) . '
');
}

}

I got only empty messages or errors in my logs

  Error: Call to a member function getValue() on null

What is the good way to access my table rows values from submitForm ?


texts: Get view output without rendering (with substitutions)

texts:
I've got a view that I'm accessing via code and used to pull fully rendered view code and work great. But after one of the updates (looking like 6.x-2.15 or 6.x-2.16 maybe changed it?), I can no longer reference fields that are using views' field token replacement logic. All I appear to have access to now is the text that contains the token arguments, and not the final rendered code.

This is the code that used to work:

function _custom_module_get_view_options() {
    $view = views_get_view('VIEW_NAME', true);
    $view->pager['items_per_page'] = 0;
    $view->execute();
    $view->execute_display();

    $items = array();
    foreach ($view->style_plugin->rendered_fields as $display) {
        $items[$display['FIELD_NAME_1']] = htmlspecialchars_decode($display['FIELD_NAME_2'], ENT_QUOTES);
    }

    return $items;
}

The $view->style_plugin->rendered_fields doesn't appear to exist any more in the executed view...

As I mentioned above, anything else I have tried only gets me the un-replaced text patterns.

Site is on Drupal 6, and currently using Views 6.x-2.16 but was previously using Views 6.x-2.12 when it functioned as expected.


texts: Create dependent dropdown in views exposed filter

texts:
I've created a view of users. It includes two exposed filters as drop downs to filter the list. One is for the city and the other for the squadron. The squadron drop down is related to the cities as cities is a taxonomy vocabulary that gets added to squadrons. I would like to find out if it is possible, that when someone selects a city, to automatically filter the squadron drop down filter by that term.

I did this in a form for creating squadrons using ajax (node/add - with help here: see Dynamic select list in the form (dependent dropdown)) but don't know how to do it (or if it is possible to do) in a view exposed filter.

Many thanks in advance

(edit: I'm using D7 and Views 3)


texts:
I need to wrap field in views. I use views with module Responsive grid and have this html.

Responsive html

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ultrices sit amet diam eu accumsan.

I want to have this html

Responsive html

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ultrices sit amet diam eu accumsan.

I know that i should use this function hook_preprocess_views_view, hook_preprocess_views_view_fields or hook_preprocess_views_view_field but i don't know how to do it correctly.
So how can i have this html without creating *tpl.php file


texts: Search multiple fields from one text box in a View

texts:
I have a database of articles with some taxonomies to classify each article. I also have a view that also contains a faceted search and uses filters to create dropdowns for the taxonomy fields using Views (see the image below). The search results will show facets in the sidebar and a user can click on them to further refine results (such as facets like Doc Year, Doc Author, etc.) The problem is that I really only need one text box to search a group of 3 text fields in this View.

For example, each article contains these three separate text fields:

Article Title
Article Title in French
Article Body

I want one text box on the search form to search these three fields without having to create three fields, one for each database field. The rest of the dropdowns to search each taxonomy can exist in the form to appear like below.

Thank you to everyone helping think how to accomplish this. I am sure it has been done before many times.


texts:
I have a product with two variations.  Shoppers can choose different sizes (paying more for larger sizes) and they can also choose whether to add a carrying case or not.

The different sizes are implemented as a select list.  No problem there.  The carrying case option is boolean.  I want to represent it as a checkbox (like Ubercart can) but can only get it to show as a single radio button and, of course, when you have a single radio button, once it's been turned on, it cannot be turned off.

Under 'Attribute Field Settings', the 'Attribute selection widget' only allows for 'Select list' or 'Radio buttons'.  Is there a way to represent it as checkbox?  Or, what is the best way to handle binary (On/Off) product variations?


texts: I'd like to create view page with contents added by the user. In that page, every user can see contents only added by him. How can I do it?


texts:
I have created the custom template page-org.tpl.page in the Zen theme, and I want to include this custom template file in the menu calling; when the user clicks on the Org link it should use the template file page-org.tpl.page.
How can I do that?


texts: How do I add custom primary menu using CSS and HTML

texts:
I have a Drop down mega menu using a CSS file and a HTML file.    I want to use this instead of the Drupal primary menu.   I have been advised to change the HTML in the page-header.inc file but I don't know how to do this?

On looking at the page-header.inc file, do I place the code under the file or in the header?   I have no idea! Do I have to change this section?

<?php if (isset($primary_links)) : ?>
    <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?>
<?php endif; ?>

Any advice would be great, I'm new at this.


texts: Existing orders with deleted coupon throw EntityMetadataWrapperException

texts:
My users have been placing orders on my website with a coupon code that now no longer exists. Any orders that previously used the coupon/discount 'freeshipping' are now throwing me the following error when I try to edit them (change their status):

  EntityMetadataWrapperException: Missing data values. in
  EntityMetadataWrapper->value() (line 83 of
  /sites/all/modules/entity/includes/entity.wrapper.inc)

Is there any way to fix this? I need to be able to edit those orders and change their status from pending to processing. I had a look at this discussion, but it doesn't seem like a solid solution was found.


texts: Circular dependency on base fields' module

texts:
I have 3 custom modules that provide custom entities with all fields defined as base fields.
Contact module - provides a contact entity(it could be one of the type: a person or email or phone etc) that has a store entity reference field.
Store module - provides a store entity that has a region entity reference field.
Region module - provides geographical region entity that has a contact entity reference field.
So

Contact depends on Store
Store depends on Region
Region depends on Contact

Each definition would look like this:
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  ...
   $fields['store'] = BaseFieldDefinition::create('entity_reference')
    ->setLabel(t('Store'))
    ->setDescription(t('Select the store the contact is part of.'))
    ...
    ->setSetting('target_type', 'custom_store')
    ...
}

As these modules provide more than just entity (and custom field API plugins),  We can't combine them together.
when trying to install the modules, getting an unknown entity target_type error.


texts: How do I show an exposed filter only to users with a specific role?

texts:
I am trying to hide one of the exposed filters from anonymous users.
How can I achieve it?


texts: What can cause an incorrect base_url to intermittently appear for images?

texts:
I have a set of images provided by a view. They are displayed on the site home page via a panels page. JCarousel is used on display. An image cache style is applied. When previewed in the view, they appear without issue.

When displayed on the home page, the path to the images uses localhost, not the server domain name, and thus are broken. All other images on the site load fine, including other images provided by image cache.

I've tried:

Clearing the cache
Flushing the image cache style

I'm not really sure what else to check. Do I have any other options beyond settings base_url in the settings.php file?


texts:
I have a node--contentype.html.tiwg as well as a node--contentype--full.html.twig file in my template. In this files, I can get the nodes fields without any problem via {{ field.content.field_name.0 }}. What I want to achieve is, to get values from the currently logged in users fields as well. To be precise, I have added a "currency field" to the user profile, where the user sets his preferred currency. Now I want to use this value for an AJAX request to an API.

Is there any way to get these values? I tried it with {{ field.user.field_name.0 }}, but I get no output.

Thank you very much in advance!

Edit: I found out, that I can get the the currency value of the node author via {{ node.uid.entity.field_currency.value }}. But instead, I want to get the currency value of the logged in user.


texts: Display only selected term from content type in Views

texts:
maybe this is duplicate but I cant find solution and answer for this one, maybe its so basic buy I need little  help about.

I have content type with:
 1. Title
 2. Body
 3. Category
(Category field is Vocabulary check box with two taxonomy terms called
 1. Yes
 2. No

So I have contents some are with selected yes and some one are selected with no, I want to create a view and display only with the selected (Yes) contents. Any idea how should I do it. Thank you for reading this.


texts: Results of parent view are not getting displayed when attachment is used

texts:
I have a page view with an attachment with following settings

Attach to: Page
Attachment position: After
Inherit contextual filters: Yes
Inherit exposed filters: Yes
Access: Permission | View published content

When I apply filters to the parent view, I get expected result in an attachment but I'm not getting result of main view on page. But when I check in view's preview section, I get expected results for parent view but not for attachment.

What can be the problem?


texts:
I have a custom search form, made with Drupal Form API. It uses ajax, autocomplete, and some other properties defined in the built $form.

I use the data sent from the form to feed a views_embed_view call, and in the View I have defined some contextual filters, for each and every of the input boxes.

The problem is that Contextual filters do not apparently support the operator LIKE for several word or partial word matches, so the search is very restricted. Even putting Search field instead of Content field does not solve the problem completely.

If I use Exposed filters instead of Contextual filters, I don't know how to modify the input boxes to get all the functionality I already have. Maybe with hook_form_alter, but even so I do not know what to do with the sent data (it needs further PHP processing, this is why it was so convenient with Contextual filters).

I also found this piece of code I had already used (but forgotten), but I don't find the solution elegant (even if it works - it is taken from a different Drupal Answers question and adapted. It modifies the Contextual filter query and includes the LIKE operator):

function mymodule_views_query_alter(&$view, &$query) {
if( $view->name == "products_list" ){
    foreach($query->where as $key => $val) {
        $field = $val['conditions'][0]['field'];
        $operator = $val['conditions'][0]['operator'];
        $value = $val['conditions'][0]['value'];
        if(( $field == 'field_data_field_field_rf_producto.field_field_producto_value' || $field == "field_data_field_descripcion_producto.field_descripcion_producto_value") && $operator == '=') {
            $query->where[$key]['conditions'][0]['operator'] = 'LIKE';
            $query->where[$key]['conditions'][0]['value'] = '%' . $value . '%';
        } // if
    } // foreach
  } // if
} // function


texts: Commerce order mail is empty for anonymous users

texts:
In the function below, there is the problem of sending email to anonymous users, the email sending only for users logged and to complete checkout and payment.

I get the following error message:

Error sending e-mail (from admin@mysite.com to ).

My Module:

function mymodule_commerce_checkout_complete($order){
            // send mails
            mymodule_send_order_emails($order);
    }

function mymodule_send_order_emails($order = NULL) {
    $module = 'mymodule';
    $key = 'my_message';
    $from = variable_get('site_mail', 'info@mysite.com');
    $language = language_default();
    $values['html'] = 'Html text value.';
    $params = $values;
    $send = TRUE;

    // load profile
    $profile = commerce_customer_profile_load($order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id']);

    // load user
    $user = user_load($order->uid);
    //$user->name;
    $to = $user->mail;

    $result = drupal_mail($module, $key, $to, $language, $params, $from, $send);
}


texts: Drupal 6 adding numbers to the end of a URL?

texts:
I have a problem that I originally thought was a leaflet.js issue, but i have now narrowed it down to drupal 6 adding numbers to the end of urls. I have seen many posts talking about addthis_config with drupal 7 but I have had no luck with that.

Update:
It is just the Y variable it is adding the extra value too if that helps anyone

Does anyone know where I can prevent the last .86666870117188 from being added to my URL?
Some responses say to set this to false, though I didn't think i was using it.

http://xxxxxxxxx:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=RIVERFLIES_READONLY:sites_tbl,RIVERFLIES_READONLY:Blue-WingedOliveView1&QUERY_LAYERS=RIVERFLIES_READONLY:sites_tbl,RIVERFLIES_READONLY:Blue-WingedOliveView1&STYLES=&BBOX=-12.83203125,53.904338156274704,10.7666015625,60.973107109199404&FEATURE_COUNT=5&HEIGHT=600&WIDTH=1074&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=215&Y=101.86666870117188

The code, i have removed the unnecessary stuff

<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />

     <link rel="stylesheet"xxxxxx/drupal1/globals/leafletmaps/l.geosearch.css" />


texts: How to alter commerce checkout form in a custom module?

texts:
I'm using commerce and want to alter the checkout form in a custom module to prepopulate certain fields and hide them.

However, I'm not able to do this using hook_form_alter() as well as hook_commerce_checkout_pane_alter().

Here's my sample code:

function MYMODULE_form_alter($form, &$form_state, $form_id) {
  global $user;

  switch ($form_id) {
    case 'commerce_checkout_form_checkout':
      // Rename the button for example.
      $form['buttons']['continue']['#value'] = t('Overridden value');
      break;
  }
}

How can I edit fields that are displayed on checkout?
Is there some other hook I should use?

Thanks!


texts: How do I display a message after redirecting users from the logout page?

texts:
I'd like to show a message via drupal_set_message() after redirecting users from user/logout?destination=user.

I tested this code but it doesn't work.

if ($find) {
  drupal_set_message(t('This entry is ignored.'), 'error');

  $form_state['redirect'] = array(
    'user/logout',
    array('query' => array('destination' => 'user')),
  );

  drupal_redirect_form($form_state);
}

How do I display a message after redirecting user from the logout page?


texts: D8: Best way to implement terms of use acceptance requirement AFTER log in, and gate content if they don't accept?

texts:
Currently I have a Drupal 8 site utilizing saml authentication to create user accounts and log in. I've seen some modules that have required terms of use acceptance during registration, but that's a non-starter for my implementation.

I'm looking for recommendations on how to:

Present Terms of Use & Acceptance input to newly logged in users
Gate content behind this acceptance

Thank you for any recommendations.


texts:
I would like to clarify the database table relationship between comment & field_data_comment_body.

Questions are:

Is comment's body saved in field_data_comment_body table?
Is comment's cid = comment_body's entity_id ?
Is there any table other than these 2 contributed to comments?


texts: I have partially defined a complex content type on a remote site. It's not finished, by no means. Now, I want to migrate this content type to localhost so to continue my development locally. An obvious choice for exporting/importing data is Features. But - if I export the content type definition as a feature, will I be able then to develop it further on localhost? If not, what would be the right way to go?


texts:
I'll start things first

When ajax_comments is off all fine. Images loading successfully
http://imageshack.us/a/img14/4577/p0ug.png

But when ajax_comments is on, Plupload not loading images. Plupaload form duplicate itself, and no uploading images
http://imageshack.us/a/img534/2013/57lz.png

I have no errors, JS console no errors too. I can't understand how to fix...
Thanks in advance!


texts: Use NID in contextual filter on front page

texts:
I have a view set up that creates a block with some fields from a node. It uses the NID as a contextual filter so that the block shows the correct node's fields. This works fine on the individual node pages.

However, the latest node is shown on the front page (via another view). The blocks are not pulling the NID on the front page and therefore the blocks are not appearing.

Is there a way to pass the NID that is loaded via the front page view to the contextual filter so that the block appears?


texts: Memory usage PHP peak=40.25 MB -- too much for a single request?

texts: I am developing a multilingual - multidomain site ( using i18n and Domain Access and several extra modules - CTools, Colorbox, etc. ). I have installed Devel because I thought the site was very memory consuming. I have seen peaks of PHP peak=40.25 MB in many of the pages. Is that too much? What happens if there are many concurrent users? Will the 128 PHP memory limit be able to handle many requests, will it use hard-drive memory instead of RAM ?


texts: Search Api Autocomplete doesnt filter by language

texts:
We're using Search API Autocomplete with Search API 7.x-1.9 on a site set up with Solr (Websolr) serving nodes in both English and German.

I'm looking to be able to filter the results by ss_search_api_language field which is presently not happening and as such i get autocomplete results for all both languages.

What would be the correct approach to deal with this?


texts: Drupal in redirected site folder not working

texts:
My web host directs traffic to the main public_html folder on the site for my main site. `

However, I want my main site to redirect to a subfolder for organizational reasons, so I can easily manage just the main site files within that folder.  Therefore I want to redirect to public_html\mysite.com

I have created a .htaccess in the public_html folder that DOES redirect properly when I just point it to a test index.html file.  However, when I try to point to index.php of for my drupal installation, I get the following :

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@mysite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Here is my .htaccess which lives in the public_html

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?<mysite>.com$
RewriteCond %{REQUEST_URI} !^/<mysite>.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /<mysite>.com/$1
RewriteCond %{HTTP_HOST} ^(www.)?<mysite>.com$
RewriteRule ^(/)?$ <mysite>.com/production/dev-code/index.php [L]

Do I need to modify the .htaccess in \public_html\mysite.com` somehow for drupal to load?  I don't have access to the server error log.


texts: Implementing LDAP with exsisting user base

texts:
We are in the experimental stages of implementing LDAP in our Drupal 6 environment, using the LDAP integration module. LDAP is installed and working in our dev environment and now we are looking at different transition plans. We have a fairly substantial user base (couple hundred user in the DB) although realistically we have only a few dozen active users.

My first thought is to go 'cold turkey' and just drop the Users table and ask all users to just start using LDAP for authentication. I tried this in dev, and while authentication worked, some pages would not load, and I'm wondering is this because there is no longer a user associated with these pages?

So along with the specific question above I'm wondering what is the best path for a transition to LDAP on a server with an existing user base? We cannot reliably key off of a username or email to 'sync' the users. That is why I am inclined to start with a clean user table if I can.


texts: Scanner module triggers call to node.admin.inc (require_once(), trying wrong path)

texts:
All of a sudden, for no reason (favorite kind of problem) Scanner stopped working. I can access the configuration at /admin/config/search/settings but trying load the scanner at admin/content/scanner fatal errors:

Fatal error: require_once() [function.require]:
Failed opening required '/public_html/sites/all/modules/scanner/node.admin.inc'
(include_path='.:/usr/lib/php:/usr/local/lib/php') in
/home/moondev/public_html/includes/menu.inc on line 514

Notice the path is wrong where it's trying to load node.admin.inc

Scanner used to work as expected so I suppose either an update changed something or a conflict with another module (or it's settings) is happening.

Anybody experience something similar before, where a core include is trying to be loaded from the wrong path?


texts: D7, AmazonS3, composer_manager and awssdk libraries understanding

texts:
I have been struggling with the installation of amazonS3. Although I was finally able to have it working pretty well, I would like to confirm with experts my understanding of the problem, and check that I got it right.

This is what I did :

installed composer_manager
installed with drush awssdk and awssdk_ui.
installed amazons3 module
while composer_manager states that all required libraries were installed, drupal status report still says that awssdk fails to load.
S3 is working fine and stores files attached to  a node.

I think I understand my mistake: with Composer Manager installed and all requirements met, I don't need awssdk and awssdk_ui modules.

These modules check that the libraries/awssdk/sdk.class.php is present, but composer_manager install the required library in vendor directory.

With this understanding, I disabled AWS SDK for PHP and awssdk_ui, and it seems to work well.

I believe that i have read to much docs on the Net, and mix two incompatible ways to install amazonS3.

Do I have the right understanding?


texts: How do I override the $message value of the UniqueFieldConstraint class?

texts:
I am new to Drupal 8 and I have added Core Constraint called "UniqueField" on my custom field "Customer_no" which is attached user to Entity. Below is that code which I am trying to override error Message but its not working:

  function devel_reg_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) {

      if ($entity_type->id() == 'user' && isset($fields['field_customer_number_reseller_i'])) {

        $fields['field_custome_no']->addConstraint('UniqueField', []);
        //The below code not setting Custom Error Message
        UniqueFieldConstraint::$message = "Custom Error Message";
      }
    }


texts: What's the side-effect of changing the file directory setting of a file field which already has contents?

texts: Before, the "file directory" setting of a file field in a bundle is set as "field/file". Now, I want that every user uploads his files into own directory, so I need to add a token in the "file directory" setting. But I'm afraid that the files uploaded in the old nodes can still show normally? If not, how to fix it?


texts:
My client site has huge data, which they want to download into CSV through View data export module, when multiple users are trying to download the csv file, its resulting in an error.

In log messages I can see error like-

PDOException: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction:

When I am trying to see my innodb status through:
 mysqlengine innodb status\G;
its showing deadlock for insert into cache table.

Can anyone help in this?


texts: Panels visibility rule: Hide if value is in the query string

texts:
I am trying to use a visibility rule in Panels to hide a block based on whether the query string has a parameter (value=5) or not.

Panels provides a String: URL path visibility rule by default, but this seems to only work for the URL path, not the query string.

Is there a way to add a condition to show/hide the block based on one of the parameters in the query string?


texts: Is there a way to add infinite number of Add More on webforms in Drupal 6

texts:
Simple question for all of you here dealing with Drupal 6.x...

With Drupal's Add More module, is there a way to configure my webform so that there is no limit on how many of a specific fields I can add more of?

For instance, I have a web form where users can request titles. I would like to enable the user to add as many titles as they would like. Is this doable or does there have to be a theoretical limit?


texts: Update to drupal 8.7 caused paragraphs to display improperly

texts: I am using bootstrap paragraphs (BP) as part of my project.  When I updated to D8.7, the BPs that define layout (e.g. 2 column, accordion, etc.) stopped displaying.  I then tried a roll back to 8.6 but the problem remains.  Has anyone encountered this?  Any solution that you can think of?  Places to look for troubleshooting.


texts: Newbie Question - How do I add content to this page?

texts:
I'm very new to drupal, and I've been put on this project.

So I wanted to create a custom page to display the privacy conditions, which is just a word file I have to copy (so just plain text).

I created the custom page, used the template they gave me and now I want to add the plain text, however I have no Idea where I can do that. Normally I should be able to do it on this page they told, but I can't figure out why I can't change the Main Content.

Sorry for this very silly question, but I can't find anything about this on the internet.


texts:
I am using drupal domain module and I have 2 different primary links for 2 different domains. However even though the menu items are not displayed on domain B, if you actually type the menu like example.com/events the page is pulled in domain B.

I want to know if there is a way , if the menu thats used in domain A is pulled in domain B, it will throw page not found error(not even access denied error).

I am using the same database.

Any ideas?


texts:
I realised that this was a horribly verbose question, so decided to edit it and try again!

I am trying to find a way of wrapping a set of three (or more) Panels content areas with a div - is that possible?


texts: How do I attach a file to a file field when saving (update/insert) a node?

texts:
After creating programmatically a PDF file with TCPDF, I am trying to attach it to my field "file_fichier", here is what my code looks like

/**
 * Implements hook_node_presave().
 */
function hook_node_presave($node) {

  if($node->type=='profil'){

    $uri = 'public://profiles/fichier';
    $filename = $node->title.' - PDF - '.$node->language.'.pdf';
    $file_path = $uri . '/' . $filename;

    // Output PDF with TCPDF
    $pdf->Output($file_path, 'F');

    $file = new stdClass;
    $file->uid = $node->uid;
    $file->filename = pathinfo($file_path, PATHINFO_BASENAME);
    $file->uri = $file_path;
    $file->filemime = file_get_mimetype($file_path);
    $file->status = FILE_STATUS_PERMANENT;
    file_save($file);

    dpm($file);

    // Now attach file to the file field.
    $node->field_fichier[$node->language][] = (array) $file;

  }

}

The PDF file is well saved to public://profiles/fichier/file_name.pdf as expected, and it's also recorded to the 'file_managed' table.

But the problem is that it's not attached to the field field_fichier, and nothing seems to happen to the field_data_field_fichier table


texts: Use Case : Registration of a Team for some event

texts:
Here is my use case:

  The users can register for the website and then form TEAMS. One of the
  users would be the TEAM LEADER. The team leader can register for
  various events for his/her team(s). When the team leader registers
  his/her team, all the TEAM MEMBERS automatically get registered.

Now, how to implement the above functionality? That is:

How do I implement the formation of teams?
How do I implement the registration of the whole team entity for some event?

How is event registration handled?

For events, I have a content-type event. The registration for event can be done using two approaches. Either using flag module, or making a registration content type and using references (and nodereference-url) module. I haven't finalized on the approach yet.

Furthermore, I'm thinking of using OG module for team formation, but I'd like to avoid that as it'd be an overkill.

Kindly suggest approaches for my use case.

Thank you in advance.


texts: Whats causing this garbled text below my pages?

texts: Hoping someone might have experienced this and know the culprit code. This keeps appearing below some pages intermittently. Only on logged in members.


texts:
i want to make a slideshow block of two views.

view 1 is 'most popular blog posts', showing 10 titles with date and no. of times viewed.
view 2 is 'most commented blog posts', showing 10 titles with date and no. of comments.

I'll put the slideshow block on the front page, it will show view 1 first then after 5 seconds, it will show view 2.

How?


texts:
Today we tried to check our website but we found this error. I don't know what happened exactly.

PDOException: SQLSTATE[HY000] [2002] No such file or directory in Drupal\Component\DependencyInjection\PhpArrayContainer->createService() (line 79 of /var/www/html/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php).

Please I need help to fix this error as soon as possible.

Thank you.


texts:
I am creating on Drupal 8 module. I have used a custom table to store the data collected from forms.
Somehow during installation, tables are not created due to an issue in the install file. Now I have fixed the issue, and I want to install the module again.

How can I re-install a module?

From this and this discussions, I know the Disable module functionality has been removed.

Is there any other way to re-install a module so that its database tables are created?


texts: Allow NAS-stored images to be attached to nodes and rendered using image styles?

texts:
What is the process that will allow images stored on a NAS to be attached to nodes that can be rendered with image styles while allowing the file structure on the NAS to be traversed by a Drupal 7 module?

There is a shared folder on a NAS:

\\NAS\share\

There is a virtual directory in IIS, pointing to the share:

\drupal\sites\default\files\nas\

Files on the share can be accessed through the website:

http://localhost/sites/default/files/nas/image.jpg

There is a custom Drupal 7 module that traverses the network share, creating nodes and attaching images on the share to those nodes as managed files.

The module can find image files on the share using only the UNC to the shared folder. This is problematic when attaching an image to a node as a managed file, since a UNC will not work. This must be done in the module with a URI going through the virtual directory:

public://nas/image.jpg

So, what I am currently doing is converting the UNC to a URI, and adding an image to a node with that URI. This makes Drupal fail to actually find the file when it attempts to read the source (the URI through a virtual directory) while creating an image style, generating the error:

Unable to generate the derived image located at public://styles/my_style/public/nas/image.jpg

If I render the image without a style, it works with the source of /sites/default/files/nas/image.jpg. Other styled images not hosted on the NAS are created normally through the same process.

Is there a solution that doesn't use managed files, but will still allow image styles to be generated from images stored on the NAS?

Would I be able to change the public files directory to the NAS?

Any guidance would be greatly appreciated!


texts:
When developing a site I often want to be able to access content type definition from the level of a viewed node representing it. So basically I'd say I'd need a new MENU_LOCAL_TAB with the path /admin/structure/types/manage/%.

What hook should be used so to not replace/override the already existing path? I would not like the corresponding item to disappear from Admin Menu. I just want to have a handy duplicate shortcut tab within a node.


texts: Remove trimmed version form preview screen?

texts:
When I preview a node before creating it I get this message:

'The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "<!--break-->" (without the quotes) to fine-tune where your post gets split.'

And I also get a trimmed and full version in the preview. This has no relivance for my site and is actually quite confusing. How can I remove it?

I dont want to hide the message with CSS (as in the linked method) as im assuming other messages can be shown in the same div.
How to hide the "trimmed version" from the preview page?

Ive tried removing the teaser display for the content type under 'custom display settings'.

The field is a text area, not a text area with summary.

Ive tried using the String Overrides module.

Ive tried this theme function but it didnt do anything.
http://drupal.org/node/1355962


texts: Load Multiple Arguments to a View with PHP Code

texts:
I have a view that I am setting up that will be the view used to select users from a user reference field. I want to build the view so that it only allows the user to reference users that are referenced by a node that this node is referring to.

To Illustrate:

Node Type A => References different users with separate user reference fields (not multi-value fields)

Node Type B => References Node Type A, AND will only reference users that are currently referenced in Node Type A

So I am trying to provide an array of default arguments using PHP in Views. Here's what I have so far:

$node = node_load(arg(1));

if($node) {
$users = array(
'am' => $node->field_am_reference[0]['uid'],
'realtor' => $node->field_realtor_reference[0]['uid'],
);
  foreach($users as $user) {
  return  $user;
   }

}
else {
return FALSE;
}

The Node Type B form is embedded into Node Type A's node view in the .tpl file, so I am loading Node Type A's nid from the url...this is working, but I am only getting the first user reference ('am') field to show up in the checkbox list that is used for the user reference options for Node Type B's  embedded form.


texts:
I want to make a field with type file and this field with multiple values, so far I know that its simply possible but I want also to some thing like bundle field with each file uploaded and this field is representing language.

Example: Suppose I upload 3 files in same field for the same node & each file with different language (file_1 => English , file_2 => French , file_3 => German) and so on.

So is there any module can accomplish that, or its something I should do custom?

I want a solution like the attached image


texts:
I'm trying to do css updates on a zen subtheme developed on zen 7.56. I'm having trouble to get compass running on my development machine because of a gem conflict between some of the compass dependencies. I'd like to move to zen 7.6 to be able to use libsass and gulp. So, I have the following questions:
1) theme was developed using compass and compass mixins, can I use the old scss files? Or will I have to identify and update the scss?
2) what else do I need to think about upgrading a theme between versions?


texts: Multisite configuration with multiple domains and subdomains

texts:
Im using CPanel and Drupal 7.

In CPanel I have created 2 domains and pointed to my drupal installation.
In the drupal sites folder I have added a folder for each domain and added the settings file.

When I navigate to either of the 2 domains I see the two Drupal installs.

I am now trying to add subdomains of each of the sites. I create the subdomains in CPanel, point them to the Drupal install. Added the subdomain folders with the settings files. But when I navigate to the subdomains I get a page not found error.

For clarity the below will help to illustrate my set up.

example.com uses sites/default
example1.com uses sites/example1.com
example2.com uses sites/example2.com

The above is working, but these 2 subdomains do not resolve:

subdomain.example1.com should use sites/subdomain.example1.com
and subdomain.example2.com should use sites/subdomain.example2.com

How do I correctly set up these subdomains?


texts: What's the difference between combining Rules conditions with AND and just have them follow one after the other?

texts: Is there a difference between using AND in Rules Conditions and simply adding Rules Conditions one after the other?


texts:
I have 10396080 seconds, and I want it to look like this: xxx hours, xxx minutes.
Is there some function for that?


texts: What instantiates a CacheBackendInterface?

texts:
I am working on upgrading a module and there is a use statement

use Drupal\Core\Cache\CacheBackendInterface;

What is the point of using an interface like that?  Interfaces dont have actual code and this .module file doesnt inherit  from that interface.

Now when the module is in enabled i get

Error: Cannot instantiate interface Drupal\Core\Cache\CacheBackendInterface in /srv/www/mydev/current/core/lib/Drupal/Component/DependencyInjection/Container.php, line 265

and the only lines I can find relating to the cache interface are

\Drupal::cache('libraries')->deleteAll();
\Drupal::cache('libraries')->set($name, $library);

So I am confused as to why this is supposed to clear the cache?

Or is it that it is not supposed work and the latest version of the module is not complete yet?


texts: What's the best way to add an entity (of a specific type) selector to a form?

texts:
I can achieve what I want by using the EntityFieldQuery and transforming it to be the right format for a radio options array.
Is there a better way?


texts: Can not see test modules in module install page

texts:
In Drupal 7, tests module can be added with hidden = TRUE property in .info file to not to display on modules list page, but tests can find and enable them using protected $modules property.

But Drupal 8 doesn't have this property and the test modules don't appear in modules list page. How does it work?


texts: Validate and submit functions not calling on template.php

texts:
I have an user register form alter on my template.php and this is the code:

function mymodule_theme(&$existing, $type, $theme, $path){

  $hooks = array();
  $hooks['user_register_form'] = array(
    'render element'=>'form',
    'title' => 'Registro de candidatas',
    'template'    =>'templates/user-register',
  );
  return $hooks;

}

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

  $form['mail'] = array(
    '#type' => 'textfield',
    '#title_display' => 'invisible',
    '#attributes' => array(
      'placeholder' => t('Escribe tu correo electrónico'),
      'class' => array(
        'mymodule-form-email-input'
      )
    ),
    '#required' => true
  );
  $form['pass'] = array(
    '#type' => 'password',
    '#title_display' => 'invisible',
    '#attributes' => array(
      'placeholder' => t('Escribe tu contraseña'),
      'class' => array(
        'mymodule-form-email-input'
      )
    ),
    '#required' => true
  );
  $form['captcha'] = array(
    '#type' => 'captcha',
    '#captcha_type' => 'recaptcha/reCAPTCHA',
    '#attributes' => array('class' => 'captcha')
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Regístrate ahora')
  );

  $form['#validate'][] = 'mymodule_form_user_register_form_validate';
  $form['#submit'][] = 'mymodule_form_user_register_form_submit';

  return $form;

}

function mymodule_form_user_register_form_validate($form, &$form_state) {

  var_dump($form_state);

  echo 'This is my function';
  drupal_set_message(t('AN ERROR OCURED'));

  if (empty($form_state['values']['mail'])) {
    form_set_error('mail', t('Escribe un correo electrónico'));
  } else {
    if(valid_email_address($form_state['values']['mail'])) {
      form_set_error('mail', t('Email invalido'));
    }
  }

  if (empty($form_state['values']['pass'])) {
    form_set_error('pass', t('Escribe una contraseña'));
  }

  /*
  if (!$form_state['values']['sendgift']) {
    form_set_error(NULL, '', TRUE);
    drupal_get_messages();
  }
  */

}

function mymodule_form_user_register_form_submit($form, &$form_state) {

  echo ('This is my custom message');
  /*
  $newuser = array(
    'pass' => $form_state['values']['pass']['pass2'],
    'mail' => $form_state['values']['mail'],
    'init' => $form_state['values']['mail'],
    'status' => 1,
  );
  $user = user_save('', $newuser);
  $user->password = $pass; // Add plain text password into user account to generate mail tokens.
  _user_mail_notify('register_no_approval_required', $user);

  drupal_set_message('Tu registro ha sido procesado, ahora ve a tu email y activalo!');
  */

}

And I have the callbacks mymodule_form_user_register_form_validate and mymodule_form_user_register_form_submit inside mymodule_form_user_register_form_alter but these functions aren't called when I submit the form. Something wrong here? Please help. Thanks!


texts: Programing date custom field into content type

texts:
I'm building a module that creates a content type when it installs. I already have my content type, let's call it MyContentType and I have a field body that I created based on Drupal documentation (https://www.drupal.org/docs/8/api/entity-api/programming-custom-fields-into-your-content-type) and I could create the two additional fields but I can't find a way to add a field of type date, datetime or timestamp. I tried to replace 'type: text_default' to 'type: datetime' but when I did it all my fields disappeared! I know I should also have a file named field.field.node.mycontenttype.field_date.yml with the correct configuration but what is the way to tell drupal that the type is datetime ? And how can I set it to current time?

field.storage.node.field_date.yml

langcode: en
status: true
dependencies:
  module:
    - node
    - text
id: node.field_date
field_name: field_date
entity_type: node
type: datetime
settings: {  }
module: datetime
locked: false
cardinality: 1
translatable: true
indexes: {  }
persist_with_no_fields: false
custom_storage: false

field.field.node.mycontenttype.field_brand_information.yml

langcode: en
status: true
dependencies:
  config:
    - field.storage.node.field_date
    - node.type.mycontenttype
  module:
    - text
id: node.mycontenttype.field_date
field_name: field_date
entity_type: node
bundle: mycontenttype
label: 'Date'
description: 'Date'
required: false
translatable: false
default_value: {  }
default_value_callback: ''
settings:
  display_summary: false
field_type: datetime

And then I referenced it like:

core.entity_form_display.node.mycontenttype.default.yml

langcode: en
status: true
dependencies:
  config:
    - field.field.node.mycontenttype.field_date
    - node.type.mycontenttype
  module:
    - file
    - path
    - text
_core:
  default_config_hash: qZE-qJ04DTTNggVVQdVOPQmpE_I69GQ_LqB32kXivVg
id: node.mycontenttype.default
targetEntityType: node
bundle: mycontenttype
mode: default
content:
  created:
    type: datetime_timestamp
    weight: 2
    settings: {  }
    third_party_settings: {  }
    (...)

and

core.entity_view_display.node.mycontenttype.default.yml

langcode: en
status: true
dependencies:
  config:
    - field.field.node.mycontenttype.field_date
    - node.type.mycontenttype
  module:
    - file
    - text
    - user
_core:
  default_config_hash: Nfnv6VMugBKl6EOqi_U0I_LQ1ZQpbNDN3a9GXHWUBz4
id: node.mycontenttype.default
targetEntityType: node
bundle: mycontenttype
mode: default
content:
  field_date:
    weight: 101
    label: above
    settings: {  }
    third_party_settings: {  }
    type: datetime

Thank you.


texts: Adding the year to the date on the blogs

texts:
So, I've gone through making a view called BlogPage and a content-type of BlogEntry probably ten times now. I've created both in the simplest ways I can, and I've tried to narrow down what is causing my page to look the way it does, and I think it must be my theme. I am using the Visia theme I have purchased.

Simply, I've created the view, content of type blog-entry, newest first.

I've also added: Sort Criteria: Content: Post Date(desc).

I do love the look of the blog, but the year is not listed in the date of posting. Is there any way to do this? Is this a setting I can't find? Is this being caused by my theme?

UPDATE:

I've tried using the "Fields" option, but I can't find the "Date Format" option. This is the screen I have:


texts: Zurb Foundation 6 Drop dowm menu problem

texts:
I am creating a theme with Drupal 8, and I am having a problem with the Foundation drop down menu. I included Zurb foundation with Gulp and NPM. I think the problem is with the Foundation JavaScript because the Foundation CSS is working.

Here is my .info.yml code

    name: test Theme
    description: test theme
    type: theme
    core: 8.x
    libraries:
      - grt_magazine_theme/global-css
      - grt_magazine_theme/global-js
    stylesheets-remove:
      - core/themes/stable/css/views/views.module.css
      - core/themes/stable/css/system/components/align.module.css

    regions:
      top_nav: 'Top Navigation'
      header: 'Header'
      logo: 'Logo'
      top_ad_banner: 'ad banner'
      main_nav: 'Main Navigation'

I created a libraries.yml file whose content is the following.

    global-css:
      css:
        theme:
          css/app.css: {}

    global-js:
      js:
        bower_components/what-input/what-input.js: {}
        bower_components/foundation-sites/dist/foundation.js: {}
        js/app.js: {}
      dependencies:
        - core/jquery

This is my page--front.html.twig file.

Tech

One

Two

Three

Energy

One

Two

 Three

{{ page.top_nav }}
{{ page.header }}
{{ page.logo }}
{{ page.top_ad_banner }}

When I log out, the drop down menu works perfectly; when I log in, this is what I get.


texts:
I have a catalog of products in one of my website, each year there are new products and some old products are unpublish (never deleted). Some websites put links to the products, so when a product is unpublish, all those referents links becomes invalid and are redirect to a 404 pages.

Now i don't want that, i want a custom redirection to parent category of the product. For that i catch the 404 event, and then i tough i could just make a dbquery on my node items to found the parent's category, and create a redirection.

I catch the 404 in the template.php file like that :

 function myTheme_preprocess_node(&$variables) {
  $node = $variables['node'];
  if (!empty($node)) {
    $headers = drupal_get_headers();
    if (preg_match('@HTTP/1\.[01]\x20+404@', $headers)) {
      //want to do my redirection here

    }
  }

but when i try to get my url, i get in fact the url of the 404 pages but in the url bar, it's still the product url.

So how can i get that url or simply the invalid nid?


texts: how to add color field after Commerce Fancy Attributes has been installed?

texts:
In my website I used drupal commerce, and I would like to display product my its color in product display page. This is the link I reference https://www.drupal.org/project/commerce_fancy_attributes, I have successfully installed that module. That guide said create a 'Color' vocabulary, add a text field called "Color" that will hold hex values. But I can't find the 'hex' in field type. So I can't continue the next step. I would appreciate any suggestion you could give me.

Thanks


texts: profile2_save($profile) not saving changes to profile

texts:
I'm trying to sort a field collection within a user profile2 profile. Everything works fine, as it should except saving the changes back to the profile.

I'm using the following in a module to sort by client name:

function field_collection_sort_user_update($profile){

    global $user;
    $profile = profile2_load_by_user($user->uid, 'my_profile2_profile');
    $engagements = $profile->field_engagements['und'];

    foreach ($engagements as $engagement){
        $engagement_id = $engagement['value'];
        $client_tid = field_collection_item_load($engagement_id)->field_engagement_client['und'][0]['tid'];
        $client_name = taxonomy_term_load($client_tid)->name;
        $clients[] = $client_name;
    }

    foreach ($engagements as $key => $item) {
        $engagements[$key]['sortfield'] = $clients[$key];
    }

    usort($engagements, function($a, $b) {return strcmp($a['sortfield'], $b['sortfield']);});

    foreach ($engagements as $key => $item) {
        unset($engagements[$key]['sortfield']);
    }

    $profile->field_engagements['und'] = $engagements;

    profile2_save($profile);
}

No matter what I try, the changes do not save to the profile. I've tried calling different hooks assuming there might be some kind of clash - hook_user_update and hook profile2_presave are called without issue, the sorting and updating of the array/object are fine, but the save never sticks.

Am I doing something else wrong?


texts: Views Ticker is not scrolling the text continuously

texts:
I am using Views Ticker module to display continuous auto scrolling news. Although currently I have only 3 news items but I have configured it to show 5 news items under pager option. I am facing following issues with it-

For the first time, News are scrolling completely but later on this block becomes empty and news displays again only when i click on this block
News items are duplicating frequently. I mean it is showing the same news multiple times.

My objective is just to display some text automatically scrolling vertically infinite times.


texts: How to write SoapClient request which has basic auth in it?

texts:
Actually I need to implement SoapClient in Drupal 8. Following XML is Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.example.com/common/ServiceRequestHeader_v1_0/types" xmlns:typ1="http://www.example.com/customer/CustomerViewRequest_v1_0/types">
   <soapenv:Header>
      <typ:serviceRequestHeader>
         <applicationCredential>
            <ID>USERNAME</ID>
            <credential>*****</credential>
         </applicationCredential>
         <transactionModel>
            <synchronousRequest>true</synchronousRequest>
         </transactionModel>
         <userCredential>
            <ID>RITESH</ID>
         </userCredential>
      </typ:serviceRequestHeader>
   </soapenv:Header>
   <soapenv:Body>
      <typ1:serviceRequest>
         <requestPreamble>
            <companyCode>IN</companyCode>
            <customerNumber>12345678</customerNumber>
         </requestPreamble>
      </typ1:serviceRequest>
   </soapenv:Body>
</soapenv:Envelope>

I have tried following code for the same but it is failing and I am not able to make any progress on this:

    $client = new SoapClient('https://example.com:9043/CustomerView_v1_0_vs0',
    array(
        // Stuff for development.
        'trace' => 1,
        'exceptions' => true,
        'cache_wsdl' => WSDL_CACHE_NONE,
        'features' => SOAP_SINGLE_ELEMENT_ARRAYS,

        // Auth credentials for the SOAP request.
        'ID' => 'USERNAME',
        'credential' => 'Password',

    )
);
    dump($client); die;

Its giving below error:

SOAP-ERROR: Parsing WSDL: Couldn&#039;t load

Can anyone suggest some way on this ?


texts: how to look_up a user migration with the article migration?

texts:
I migrate all the article of an old blog to drupal new website i have my image_migration :
id: image
label: "Migrate all media"
migration_group: image_migration
source:
  plugin: image
  constants:
    DRUPAL_FILE_DIRECTORY: "public://images"
process:
  psf_source_image_path:
    plugin: file_path
    source: image
  psf_destination_full_path:
    -
      plugin: concat
      delimiter: /
      source:
        - constants/DRUPAL_FILE_DIRECTORY
        - image
    -
      plugin: urlencode
  uri:
    plugin: file_copy
    source:
      - "@psf_source_image_path"
      - "@psf_destination_full_path"
destination:
  plugin: entity:file

migration_dependencies: {}

I have my user_migration :
id: user_migrate
label: 'Migrate le User principal'
source:
  plugin: embedded_data
  data_rows:
    - legacy_id: 101
      public_name: 'Neron'
      user_email: 'neron@test.com'
      user_timezone: 'Europe/Paris'
      user_password: 'Viva Las Vegan'
      user_status: 'active'
      member_since: 'August 17, 2020'
      user_roles: 'webmaster, administrator'
  ids:
    legacy_id:
      type: integer
process:
  mail: user_email
  init: user_email
  timezone: user_timezone
  name:
    - plugin: machine_name
      source: public_name
    - plugin: make_unique_entity_field
      entity_type: user
      field: name
      postfix: _
  pass:
    plugin: callback
    callable: md5
    source: user_password
  status:
    plugin: static_map
    source: user_status
    map:
      inactive: 0
      active: 1
    created:
      plugin: format_date
      source: member_since
      from_format: 'F j, Y'
      to_format: 'U'
    changed: '@created'
    access: '@created'
    login: '@created'
    roles:
      - plugin: skip_on_empty
        method: process
        source: user_roles
      - plugin: explode
        delimiter: ','
      - plugin: callback
        callable: trim
      - plugin: static_map
        map:
          'forum admin': administrator
          'webmaster': administrator
        default_value: null
destination:
  plugin: 'entity:user'
  md5_passwords: true
migration_dependencies: {}

and my article migration :
#Migration metadata
id: article
label: Migrate list of articles
migration_group: article_migration

#Source plugin, id defined in the @MigrateSource annotation
# in the src/Plugin/migrate/source/Article.php file.
source:
  plugin: article
  key: migrate

 # Process plugin
process:
  title: title
  field_image/target_id:
    -
      plugin: migration_lookup
      migration: image
      source: id
      no_stub: true
    -
      plugin: skip_on_empty
      method: row
      message: 'Image not found'

  field_image/alt: balise_alt
  body/value: content
  body/format:
    plugin: default_value
    default_value: restricted_html

# Destination plugin
destination:
  plugin: entity:node
  default_bundle: article

# Nothing needed here, it is a single table without any other relation.
migration_dependencies:
  required:
    - image
  optional: []

all migration works but i don't know How can look_up the user  to be the author of  all the article (i try different name for the author name machine in the article migration  my plugin stop it working) if someone has a better methods


texts:
Strangely I cannot find this directory anywhere inside sites or files. There is only one in /var would that be it? I need to edit the .htaccess as it states in my reports. Also what ownership and permissions should this display?

Ok I found it in directory above /var and deleted it then created it again and set it as 755 permissions with apache ownership and placed security script in .htaccess as given in reports link.

Update: the .htaccess in files and tmp folders to create more security shut me out! I had to remove them. OKAY finally worked this out and why looking for tmp folder in first place! A status report glitch error for files and tmp folder saying needed to add security .htaccess file is BOGUS! it is a bug of some sort in 7.24 for my system Centos linux so my removing them was exactly what I needed to do after adding erroneous security updates.


texts: Services 3 Session authentication CSRF Validation with Persistent Log in

texts:
I am trying to use Services 7.x-3.11, the latest stable available to authenticate and access Drupal 7.34. Accessing from mobile devices with Native coding. I want to keep the user authenticated forever. Is it possible?

Here is the workflow i am following.

First launch of app

POST /services/session/token to retrieve CSRF Token
POST myendpoint/system/connect with X-CSRF-Token header
IF not Logged In Try Log in /myendpoint/user/login
Log in Success and keep session_name=sessionid in Cookie Varible

Future Launches

POST /services/session/token to retrieve CSRF Token
POST myendpoint/system/connect with X-CSRF-Token header along with previousely saved session_name=sessionid as Cookie Header

From this point I am getting ["CSRF validation failed"] message. Am I missing something? Is the workflow correct?


texts: How to change the placeholder title of the search box

texts:
I created a Drupal 8 website and enabled multilingual modules, so my website is in French, English and Spanish.

In the placeholder of the search box the word Search appear for English and is translated in Spanish to Buscar but in French Search appears.

How can I change it to Recherche?


texts: How to keep Ajax refresh action when 'Use Ajax' option is disabled?

texts:
I have disabled 'Use Ajax' because I don't want AJAX pagination. Unfortunately other Ajax functionality stopped working.

How to ajaxify View programmatically?


texts: How to perform a webform_submission query with a conditional based on a custom field in the submission data

texts:
I'm attempting to query all webforms with a specific id, and sorted by a boolean field that was added to a webform by me in the webform configuration manager.
Below is my attempt

    $submission_ids = \Drupal::entityQuery('webform_submission')
        ->condition('webform_id', $webform_id)
        ->exists('paid')
        ->sort('paid', 'desc')
        ->sort('created', 'desc')
        ->pager(50)
        ->execute();

However when I perform this query I get

  Drupal\Core\Entity\Query\QueryException: 'paid' not found in
  Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 316 of
  core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).

If I omit the ->sort('paid','desc'), but keep the ->sort('created', 'desc') the query works fine. I'm assuming this is because created is one of the base fields defined in the webform entity.

I also tried using 'field.paid', and 'data.paid' as a guess but I ended up with

  Call to a member function getColumns() on boolean in /var/www/aaep.org/http/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
  on line 228

Is there a way to sort webform submissions by user defined fields in an entity query?


texts: How can I display the block only to the content types and a specific page?

texts:
Created a content type.

Name: Cities we serve

Machine name: cities_we_serve

Created a page using views.

Page URL: examplesite.com/blog

Created a block.

I would like to display the block to the above content type and the views pages.

Edited the block as follows:

$nodeType = "Cities We Serve";

// valid node id in view mode
if ( arg(0) == 'node' AND is_numeric(arg(1)) AND arg(2) == FALSE ) {
    $node = node_load(arg(1)); // cached
    if ( ($node->type == $nodeType) OR ($node->nid == blog) ) {
        return TRUE;
    }
}
return FALSE;

Now I see the block on all pages. How can I display the block only to the content types and the blog pages?


texts: How to check if user has access to node creation page from passed parameter?

texts:
I have set some users with 'update' access to some books and all other users have only 'view' access. I have used hook_node_view_alter() to remove the 'Add child page' link for users with 'view' only access. The problem this only hides the link from the corresponding node pages, those users are still able to add a child page by manually going to the url: /node/add/child-content-type?parent="mlid" where mlid is the "menu link id" for the parent node. The users might not know particular parent node link id's, however this is a security hole I want to get rid of.

How can I get this passed argument as "?parent=" in a php variable and what hook function should I use to run the condition checks for user access? I am using drupal 7.


texts:
I did a minimal install, with a desire to get rid of some of the stuff my site-to-be won't need.

The problem I have... is I can't seem to get Demonstrate Block Regions working. It shows up on a "Standard" install... but not the "Minimal" install on 7.

Top one is Standard install. Bottom one is Minimal.

What module or setting am I missing?


texts:
I'm currently creating a form where the user is supposed to check a (sometimes large) number of checkboxes. The problem is that I only want the checkboxes visible, not their label (or key) while the user is filling out the form. Is this possible?

Currently it looks like this:

[ ] label
[ ] label
[ ] label
etc.

I'm aiming for:

[ ] [ ] [ ] ... [ ]

I'm using Drupal 6.22 with CCK 6.x-2.9. Other related modules in my form that will interact with the checkboxes are Conditional Fields 6.x-2.0 and Multicolumn checkboxes/radios 6.x-1.6

Any help is appreciated. Thanks in advance.


texts: How can I move a node type's configuration into a custom module?

texts:
I still a bit new to D8 and loving the new configuration management system that has replaced Features.

I am looking for the best technique for containing particular configurations in my custom modules.

I have a node type called quiz and a module called quiz_module. By default, when I execute drush cex -y the output yaml files are deposited into ../config/sync.

Is it the correct thing to do to move all the yaml files relating to the quiz node type in to my quiz_module? When do that, the same files are recreated whenever I execute drush cex -y.

To counter that duplication, I created a softlink of the files from quiz_module to '../config/sync' but that didn't seem to update the yaml files as I expected.

Any help, please?


texts: Get custom block type image field in Display Suite twig field

texts:
I have a custom block type.
I have a link field and image field.
I want to combine those fields so the image is wrapped in the link.
I created a Display Suite twig field.
What do I use to show the image? Ideally the image as rendered in Manage Display, but as long as I can show the image with a certain image style, I'd be very happy.

Here is what I have already tried:
{{ file_url(node.field_career_highlight_image.entity.uri.value) }}
{{ file_url(content.field_career_highlight_image['#items'].entity.uri.value) }}
{{ file_url(block_content.field_career_highlight_image.0['#item'].entity.uri.value) }}
{{ file_url(node.field_career_highlight_image['#items'].entity.uri.value) }}
{{ block_content.field_career_highlight_image.alt }} - shows alt, just experimenting, so wondering why this didn't work for the image
{{ content.field_career_highlight_image }}
{{ block_content.field_career_highlight_image }} - white screen
{{ block_content.field_career_highlight_image.0 }}
{{ block_content.field_career_highlight_image.0.value }}
{{ block_content.field_career_highlight_image[0] }}
{{ block_content['#block_content'].field_career_highlight_image.value }}
{{ content['#block_content'].field_career_highlight_image.value }}
{{ content['#block_content'].field_career_highlight_image }}

Thank you


texts: What are differences/advantages of Invite vs. Referral modules?

texts:
Are there any distinct advantages for choosing either the Invite or Referral modules for the purpose of allowing existing site users to get their friends to check out the site and create an account?

I'm trying to determine which module will be the best solution for us, but they seem like they essentially do the same thing. Am I wrong?

We'll want to be able to award points for successful sign ups, and maybe some other type or rules integration to reward those who get more people to sign up.

http://drupal.org/project/invite
http://drupal.org/project/referral


texts: How to decide in hook_nodeapi() if it was invoked after creating/updating node via Services module?

texts:
I am developing a custom module, which should do things in hook_nodeapi() only if the node is being created/edited via Services. I couldn't find any data that is available at this point for deciding if the node is via Services or not.

I am aware of a possible solution, using request_uri() and deciding based on that (https://drupal.stackexchange.com/a/8568/1930), but it seems so wrong. Hardcoding the endpoint name is plain wrong. Workaround this by providing an admin interface and depend on configuration?

So, I would rather avoid the above, but couldn't come up with anything else so far. I am curious if others have had similar problems before and if there is a better solution.

UPDATE

The accepted answer should be used, as that is the cleanest solution. Unfortunately, I had to use a different one, which might still be useful to others so I am sharing it here: https://gist.github.com/Temaruk/5884209


texts:
I'm building a multi language site but I'm facing a problem with an url.
In my template i have the following print rule for an url <?php print $base_url.'/#project';?>
The base url only prints http://www.codedesign.be/#project withouth the language selector. url is normal url/nl/#project or www.codedesign.be/fr/#project


texts: TinyMCE editor does not show buttons in bar

texts:
I need a WYSIWYG editor so I installed drupal wysiwyg module in sites/all/modules folder. Further I downloaded TinyMCE and installed it in sites/all/libraries/tinymce.

The editor configuration is correctly displayed in admin/settings/wysiwyg/profile/2/edit. My interface language is German and TinyMCE has this language pack installed.

When I go to edit some text in the backend the editor itself is initialized but no buttons are displayed.

Any ideas why there are no buttons and how do I fix this?


texts:
Why when I am logged as admin I get an access denied page, the page is custom like mysite.com/test - added by the custom module:

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

  $items['test2'] = array(
    'title' => 'Test route',
    'description' => 'description of test',
    'access callback' => TRUE
  );

  return $items;
}

Why is that happening?


texts: Disable Bootstrap Tooltips for Individual Form

texts:
Is it possible to disable bootstrap tooltips for an individual form (all the components in the form)? I know I can do it in the Bootstrap settings, which will turn off tooltips for all forms, but I only want to turn it off for one form - for all the components within that form.

I saw the answer for How do I disable tooltips for field help text in Bootstrap? which shows how to turn it off for individual components, but I want to turn it off for the whole form.


texts: how to output image file from database drupal 7?

texts:
I have created testing module that will upload image and outputting it to my page. but, I can't seem to output my image file from my database. here's my code

function database_ex_menu() {
  $items = array();
  $items['database-ex'] = array(
    'title' => 'My Database Form',
    'type' => MENU_NORMAL_ITEM,
    'access arguments' => array('submit database_ex'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('database_ex_form'),
  );
  return $items;
}

function database_ex_form($form, $form_state) {
  $form['myimage'] = array(
    '#type' => 'file',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add item'),
  );
  return $form;
}

function database_ex_form_submit($form, $form_state) {
  $fe_id = db_insert('example')
    ->fields(array(
      'myimage' => $form_state['values']['myimage'],
    ))
    ->execute();

  drupal_set_message(t('Your entry has been added'));
}

//This function supposedly will output my image file inside a div.

function database_ex_submission(){
  //What to do From here!
}


texts: Different Bootstrap HTML markup on the site mirror

texts:
I have created a copy, mirror of my site. Copied all files, export and import database. Exactly the same copy. However, the design of some elements is different, because the HTML markup is different. How is this even possible? Worth noticing that my default theme is Bootstrap subtheme, however, I am not rewriting any class at all. Even if yes, should be the same on both sites.

First difference: menu block with the Primary menu.

Original site:

Mirrored site:

 ('nav' class missing)

Another difference: primary tabs.

Original site:

Mirrored site:

Also buttons are different, etc... Any help will be much appreciated.


texts: How to delete a file attachment from the apachesolr index

texts:
My file attachments are indexed using apachesolr attachments 7.x-1.x-dev. I have a custom module that physically deletes a file using file_delete(), but file still remains in Apachesolr index even after re-indexing. The only way to remove from search results is to delete the index then reindex.

I tried this to no avail:

// Remove file from apachesolr index
$env_id = apachesolr_default_environment();
$entity_type = 'file';
$entity_id = apachesolr_document_id($file->fid, 'file');
apachesolr_remove_entity($env_id, $entity_type, $entity_id);
drupal_set_message('Deleting '.$file->uri.' from private attachments.');
file_delete($file);

The file is physically removed, but not removed from index.

Any suggestions on how to remove file from apachesolr attachments index/search results after it is deleted?


texts: How can I add a checkbox when I create a new page to decide wheter the user want to display the node title or not, as like the hook_block_configure() function ?


texts: Need to export all queries that are getting fired in a page

texts:
I need to export all the queries that are getting fired in a page. Is there any way to get that ?

I tried Devel's query log. It writes all the queries in Drupal Temporary file system as a txt file. But the format is in json. Also, it does not seem to write the actual query, it seems to be writing the query object directly.

Thanks


texts: Translation has duplicate admin content listings

texts:
When I add a language translate option to a piece of content for French.

Drupal now adds a second listing of that piece of content in the content admin view.

Is this the expected behavior?
What if you had 10 different language transaltions, would you have 10 times the content listings?
Is there a setting or module to only show a single listing and access the translations under that content entities "translate" tab?
Is there a better way to translate all my content to another language that could avoid this duplication issue?


texts:
I was trying to add another additional column in the menu overview (admin/structure/menu/manage/main-menu). I used the following code:

function mymod_form_alter(&$form, &$form_state, $form_id) {
    if ($form_id == 'menu_overview_form') {
        foreach ($form as $key => $item) {
            if (is_array($item) && isset($item['#item'])) {
                $item['node_url'] = array(
                    '#markup' => 'foobar'
                );

            }
        }
    }
}

It actually adds the indexes but the render output is not changed. How can I add an additional column to that overview?

Thanks


texts: What is the proper URL to get flag service?

texts:
I'm running Drupal 7 with the Services module and the Flag Service modules installed  but I'm having trouble trying to figure out how to Get countall for a particular post ? Can anyone please tell me what URL I should use ?

URL to get all posts : http://webaddess/rest/events

URL to get one Post : http://webaddess/rest/node/3591


texts: How to add .active class in to the menu item?

texts:
I am developing a theme for Drupal 7 and I am struck up with the following issue. I can see there are fixes through jQuery. But I would like to do it in the Drupal way.

My current HTML

    Home

    About Us

Contact Us

Typhygraphy

And I want something like this

    Home

    About Us

Contact Us

Typhygraphy

The "active" class needs to be there in the
 also.


texts: Why is my site which resides in a subfolder broken when visiting it through a subdomain URL?

texts:
I have a Drupal 8 website on a server in a subfolder called news so the homepage for this Drupal instance is www.site.com/news. The original www.site.com was not Drupal so this is why this was done. Fast-forward to today, we've redone www.site.com as its own Drupal instance on another server and would like to still use the old news site where it's at. What we've done was create a subdomain of www.news.site.com pointing to the other server so that it could be its own instance, however, when you visit the site from that new subdomain URL, most of the links/images are broken due to it looking for files at /news/filename.jpg or /news/article-title.
What would be the best way to set up either server so that the new subdomain works properly? Should we have set this up another way?
Let me know if any other details are needed and I will happily supply them.


texts: I have got a webform in a iframe and its quite long when a customer fills the details and clicks submit they just see a white screen because the page has been scrolled down due to the form been very long and they have to scroll back up to see the confirmation message.is there anyway when they click submit the scroll resets?


texts: Node preview with different theme than editing

texts:
I'm using an admin theme for nodes editing, also for users that are not admin (with permission "View admin theme").

The problem is that in this way also the preview of a noded is displayed with admin theme, but I need to display the preview with the "default" theme.

Is there a way?


texts: Display certain content based on whether a date is in the past or future

texts:
I have a content type called 'DVD Review' with a field called 'Release Date' which is input using the date module.

On the node page, if the release date is in the future I'd like it to say "Coming Soon", or otherwise, if the release date is in the past say "Out Now".

I'm using Display Suite to arrange the fields, so I'm thinking I could add a code field with a php if statement to handle this.


texts: Git workflow and Acquia Dev Desktop .dd files

texts:
Using Acquia Dev Desktop I created a multisite setup. All working fine.

I added all files to a local Git repository
I added a .gitignore file
I pushed all  the files to a central remote repo

I want to clone the central remote repo and make 2 instances for Staging and Production environment.

But if I look in my central remote repo I see in /sites/ folder my-subsite1-dev.dd

Do I have to ignore this file? Do I have to add it to my .gitignore file so it's not being tracked? Because on my Production environment I can't use Acquia Dev Desktop anyway, can't I?


texts: Views slideshow displaying multiple items

texts: Under view action advanced Options of 'Views slideshow' I have defined 4 items per slide which is displaying 4 items one under each other. Is there a way we can display them in a single row?


texts:
I am working on building a site that has like 150 products each one is a different kind of moulding and has 7 wood types right now (more types may be added later and there are other products that wont use this) and needs to come in lengths up to 8 feet. What I want to be able to do and haven't haven't figured out the best way to is give 2 attributes one for the price of 1 foot of the moulding in that type and one to choose a number of feet (possibly another to choose how many of these pieces you want) right now each type of wood is being created separately and I am using custom sized products to calculate the length (site is still under development so I only have like 4 products that were manually created)

To sum it up what I'd like to do is create a product lets call it model 001 with attributes for wood type that change the price and then an attribute for length that multiplies the price from the wood type by the selected length and can be modified by an import/export module

anyone have any ideas on how to do this  without creating like 1,000 products?
currently using drupal 6 and have tried numerous other module combinations to get this working but would be willing to upgrade to 7 if necessary as the only module preventing me from doing so is custom sized products

Any help is much appreciated.


texts:
i have a dual language site (English and Arabic). I have a view that has pix that link to different parts of the site. My problem is that when im not logged into the site and im in the arabic version and click on one of the view items, the site goes to the english part of the destination url even though there is a language = ar in the url. there is a %20 at the end of the URL as well. Below is a sample url:
testsite/ndesign-content-v2/projects/commercial?language=ar%20

when I remove the %20 everything works fine. Please not that this doesnt happen for users that are logged in

Any help is highly appreciated. Many thanks