texts: Only trigger migrate of data using highwater mark

texts:
I have some XML of the following structure to import into Drupal:

<list>
     <item id="0001" xml="http://www.example.com/0001.xml" dateChanged="24 June 2013 12:00:00"></item>
     <item id="0002" xml="http://www.example.com/0002.xml" dateChanged="24 June 2013 12:56:00"></item>
      ...
</list>

I have set up Migrate to run with cron every minute: read through the list, grab each item's XML and indiscriminately update the destination node. My Migrate source only uses the data from these linked documents, nothing from the list. But this is overkill. What I would like to do is to check the dateChanged dates, compare it to the corresponding last modified date in the node table, and only update the nodes that need it (if the corresponding XML doc has been updated). Can I do this with the last modified field as a highwater field?


texts:
I need a solution for reservation, for example i have a swimming pool and i want to Reserve it, the visitor will choose the time he want, let me say i will select the start and end date (the reservation time) mmmm in our example from 8 am to 9am, what i need to display the available reservation time like this:

And the visitor can select one hour or more to reserve the swimming pool.
Is there a module can do this?and if not is there a reservation module can do what i nees by another way? thanks


texts:
I am using Display Suite for the first time and experimenting with the 2-columns layout.

What I didn't expect is that the module will override my existing node layout.

Can anyone tell me if I can use my 2-column layout in combination with my existing layout? This is especially important as I have information which needs to be displays outside of columns above and below it.

Thanks


texts: how to comment for both answers and question in Question/Answer module?

texts:
I am using the Question / Answer module.

However, it can not be attached to Answer it is possible to attach the comment only Question.

I think Answer also I want to put a comment.

How would it?


texts: Contact form doesn't send body message for anonymous users

texts:
I'm having a problem with contact form module, from core 8.9.5.
I've created a contact form:

if I send a message with admin user, recipient gets the email with all fields, also "body" message
if I send a message with anonymous, recipient get the email without the "body" message

I can't understand what is wrong.


texts: How to change the output of a theme function?

texts:
I know this question already has some "kind" of answer in documentations but they are too abstract for me. Most documentation I have seen on Drupal doesn't explain all the details of how to properly override a theme function, or maybe I don't understand.

My problem is that I need to change the output of theme function theme('links__system_main_menu', ...), which is used in page.tpl.php to print the content of the main menu. I don't understand how to make it done. Please explain me every step you take and why did you take that step.


texts: How to allow each company section to manage their own content on the Intranet?

texts:
I have a simple problem of permissions. I work in a company which is divided into different sections. I have to make a Drupal intranet for them.

Each section must be able to manage their own content on the Intranet. The contents of the intranet are always the same, ie the same "content type" with the same "fields". It is necessary that a section could only edit the contents within its section. Thus, "computer" could only create / edit / delete content of "computer". The section of "press" could only create / edit / delete content of "press". All sections can view all content.

I tried different modules. "Field permissions", which lets you field level permissions, is interesting but does not help in this case. "Content Access" allows me to level management content type, but I can do what necesito.Con "Taxanomy Access Control" can define visibility rules, editing and deletion according to the presence or absence of one or more terms a taxonomy. It could be interesting, was not that "computer" should not be able to create content "press", for example.

You could create a content type for each section equal, and each give the required roles. The problem is that they are over 15 and does not seem the most optimal way to do this, because if I have to add a field so I have to do in the 15 (DRY).

I sense that Drupal has a more efficient way of doing this, but as I am new to this CMS I can not find it.


texts: Alter validation of a required field on a particular page

texts:
I have set up 2 registration pages on my website.

On one of the registration pages, i want to hide some fields. I can selectively hide the field. But my challenge is that the field is a required field. So when a user tries to register using that form, it throws an error.

Is there a way to selectively alter the validation of the field on one registration page and not the other, so that users can submit the form with out errors?


texts: Modify and add of unlimited collection field

texts:
I have a content who contains an unlimited collection field. Via a custom module, how can I get and set the informations which are in field collection in the content (nid) ?

I have read the api documentation of field collection but I don't understand how it works (I'm french..)
By example I see this function : field_collection_item_load, the parameter is an item but...what is an item ? xD

Another question, my field collection contains an another field collection. Is there a particular way to get and set this "sub"-field collection ?

If you can me a very sample example of get and set, I thank you very much


texts: how to pass the query parameters as default values in buildForm?

texts:
public function buildForm(array $form, FormStateInterface $form_state) {
    // in D7 it was : $params = drupal_get_query_parameters();

$form['search_api_fulltext'] = array(
'#type' => 'textfield',
'#title' => $this->t('Faites une recherche'),
  // in D7 it was: '#default_value' => isset($params['search_api_fulltext'])?str_replace('+', ' ',$params['search_api_fulltext']):'',
);
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => $this->t('Recherche'),
'#button_type' => 'primary',
);
return $form;

}


texts: Using Node Limit, Show Role How Many Nodes They Can Still Add

texts:
Using Node Limit and have limited roles to be able to add 3, 8 or 20 nodes of one content type depending on what they register with.

I wondered if it's possible to show how many of their limit they have left and then show it on their user page.

So if they have created 3 nodes, they have 5 left (if they had the 8 role allowance).


texts: Remove a widget item with an Ajax callback (in an entity browser widget)

texts:
[edit to add]:

1-The ajax callback is made from a field (field_company) inside the regular user_form

2-The logic and the callback definition reside inside the hook_form_alter of the user_form => maybe this is my problem

[-----]

-A "Companies" dropdown field_company allow to select a company

-When a company is selected, an Ajax Callback is fired

-The Ajax Callback return the "Buildings" widget (each company have one or more building). When clicking on this "buildings" widget (entity browser), I get only the list of the buildings of the selected company which is what is expected.

Until this, everything works fine. I am using the '#widget_context' key to filter the buildings and the user is allowed to select one of them.

But, If the user wants to change the selected company, I have to remove any selected building in the "buildings" widget.

Here is my failing Ajax callback code:

function company_select_callback(array &$form, FormStateInterface $form_state)
{
    $form['field_buildings']['widget']['target_id']['#default_value'] = "";
    //Rebuid do not works $form_state->setRebuild(true);
    return $form['field_buildings'];
}


texts:
The input in file field.html.twig is normally like this:

{% for item in items %}

{{ item.content }}

{% endfor %}

And you get the output in HTML like this:

But I want to add a class to img-tag. How do I receive the following output:

I am looking for a solution like this (solution in another post), but it is not working. Can anybody help?


texts:
I'm trying to use Rules to populate a CCK field - a user reference when they flag a node.  It basically works, but if there's already a user reference it overwrites it instead of adding another.  That's not exactly what I want.  I want the rule to add another user reference field to whichever ones are already there, then populate it with the user reference.

Do you have any idea?

Edit - What I eventually came up with, without Rules -

function bamfmodule_flag($action, $flag, $content_id, $account) {
  if($action == 'flag') {
    if ($flag->name == 'event_bookmark') {
        $node = node_load($content_id);
        array_push($node->field_trainer, $account->uid);
        node_save($node);
    }
  }
}


texts:
I would like to simply output all created entities from my custom entity type through a View. Does anyone have an article or module or code to point me in the right direction, my searches didn't bring much up (only entity relationships to certain fields, but I want all the entities)?

Thanks


texts:
I want to create a view that returns all nodes of type X. Beneath each node I want to return the comments for that node as well.

Node 1

Comment 1
Comment 2
Comment 3

Node 2

Comment 1

Node 3

Comment 1
Comment 2

Something like above. Is that possible?


texts: Update new user's profile with rules, based on his webform submitted data

texts:
On my site I am using two webforms from which a user can register to the site. This feature is enabled thanks to the webform_registration module. Of course these webforms can only be submitted by anonymous users.

What I want is, on the event of a submission, to populate the profile of the user who submitted the form with some of the data that were submitted. So I created a rule catching the event of a webform submission. Now how will I update the profile? Setting a data value on a user field does not work since the user who submitted the form was anonymous! He was created after. How can I do this? All I know about the user is just his username that can be pulled from the submission data. Any way to retrieve the user entity using his username and then writing the data to his profile?


texts: Not able to post comment anonymously: getting 403 error

texts:
I am working on phonegap app and using drupal 7 as backend for all json request data. I am using the service module for it. At frontend I am using Angular js in phonegap.

I referred http:// drupal.stackexchange.com/questions/22277/creating-comments-and-nodes-with-services-3-x-and-json for posting comment.

I set permission for anonymous user to post comment to any node from drupal permission section. But its not posting any comment. Giving me error.

  /appapi/comment.json 403: Access denied for user anonymous

Here is my code:

var dataObj = {"subject":$comment.text, "comment_body":{"und":[{"value":$comment.text}]}, "nid":$comment.nid} ;

var res = $http.post($scope.apiBaseUrl+'/appapi/comment.json', dataObj,{ withCredentials: false, headers: { 'Content-Type': 'application/json'} }); res.success(function(data, status, headers, config)
{ //$scope.message = data;
console.log(data);
 });

Here is CROS module setting:

*|*|POST,GET,PUT,DELETE|Origin, X-Requested-With, Content-Type, Accept|false

I am sending comment post request from phonegap app. I am not using the AgularJS module.


texts:
I like to make a custom view for the module entity browser. For some reasons I do not want to install the module entity browser empamples.
But I make the experience as I created the view that there are no file options to select only content options.
Can anybody help?


texts: How to limit number of points that user can add through Geofield widget to Openlayers maps?

texts:
Im using the modules stuck very similar to one described here (
Need a simple Google Maps solution; lost in the labyrinth of modules).

Geofield, Openlayers, Drupal 7

The difference is that I dont use Address field for auto detecting the lat/lang from address. The Geofield field widget type is set to "Openlayers map" so the points can be manually added by user to the map when the node is being edited.

Is there any way to limit the maximum number of points that user can mark on map? (to 1)


texts:
I got a content type 'activities' with a text field called 'transport'.
When a users submit a new activity, I want them to be able to copy data from earlier activities: just recycling data in other words.

Example:
Activity1 has a field ('transport') that contains text.
Activity2 has an empty field 'transport'.
Is there an easy way for a user to copy the data from Activity1 to Activity2?
The less clicks the better. What's the best practice?

Thanks!


texts: Does anyone know a way that the revision log message could be edited by content editors? Sometimes you make a mistake so it would be nice to be able to edit that field. Not seeing anything in contrib.


texts: Breadcrumb displays overridden page label instead of node title

texts:
Configuration:

Drupal 8.1.5
Panels 8.x-3.0-beta4
Page Manager 8.x-1.0-alpha23
Layout plugin 8.x-1.0-alpha22
Panelizer 8.x-3.0-alpha2

Main menu:

About

Team
Technology
...

When visiting page /about/team, the breadcrumb shows Home About.

With Page Manager, I have overridden the default /node/{node}, and created a couple of panel variants based on path.

With this configuration, when visiting page /about/team, the breadcrumb shows Home Node view. So, instead of the node title for the /about page, the label of the custom page managed by Page Manager is displayed.

Is this a bug or expected? How to fix it?


texts: how to access node variables in region preprocess function?

texts:
I have variable in the node preprocessor:

function theme_preprocess_node(&$vars , $hook) {
    $vars['default_product_price'] = $vars['elements']['product:commerce_price'][0]['#markup'];
}

Currently, the variable 'default_product_price' is not available in the region--sidebar-second.tpl.php file. How would i make this variable available in region template file or page template file? Thank You


texts: Views custom relationship joined by plain text field

texts:
Let's say I have a node type named 'Book'.
'Book' nodes have 'publisher' field.
I want to create a node view which displays these two columns:

book title
title of a book published by the same publisher

Desired results is like this.

The problem is I cannot use entity reverse relationship which is normally used to connect entities because 'publisher' field is not entity reference field.
So I added the code to my_module.views.inc.
funciton my_module_views_data() {
  // it seems first node's 'node__field_publisher' is already loaded, so join second node's node_field_data directly.
  $data['node__field_publisher']['node_field_data'] = [
    'title' => t('Same publisher books'),
    'help' => t('Get books sharing publisher'),
    'relationship' => [
      'id' => 'standard',
      'label' => 'Same publisher books',
      'left_table' => 'node__field_publisher',
      'field' => 'entity_id',
      'base' => 'node_field_data',
      'base field' => 'nid',
    ],
  ];
}

It created join and relationship 'Same publisher books' became available.
LEFT JOIN {node_field_data} node_field_data_node__field_publisher ON node__field_publisher.entity_id = node_field_data_node__field_publisher.nid

If I click 'Add' in 'field section', select 'Title', set 'Same publisher books' as 'relationship', it adds query to SELECT statement like this
node_field_data_node__field_publisher.nid AS node_field_data_node__field_publisher_nid

But no titles.
I thought if I make a relationship to other node, it automatically loads field values belonging to the node(e.g. title), but is it a misconception?
How to get titles in this case?


texts: Show list of node titles from a certain taxonomy term

texts:
<?php
    $result = db_query("SELECT {node}.title, {node}.nid FROM {node} INNER JOIN {term_node} ON {node}.nid = {term_node}.nid WHERE {term_node}.tid = %d ORDER by {node}.title ASC LIMIT %d, %d", 5, 0, 30);
    while ($node = db_fetch_object($result)) {
        $nodes[] = l($node->title, 'node/'.$node->nid);
    }
    foreach($nodes as $list) {
        print $list.'<br />';
    }
?>

I want to print node titles from a certain taxonomy term inside a node.
it doesn't prints anything, and print_r($nodes) shows nothing. What's wrong with my code?


texts:
It has a bug that keeps dumping errors to the logs.  There is a patch, but the patch removes the distance field.  The module isn't maintained.

Does anyone know of other modules that can be used with OpenLayers and views to plot locations within a particular radius?


texts: Showing previous and next pager links regardless of the page one is in

texts: Drupal hides the previous link  of a pager if you are the first page,and the next link if you are on the last page. Is there way I can keep the links from disappearing, just in a disabled state? Can I do this without using php?


texts:
I am trying to create a node that has a single file attachment (using CCK filefield), and be able to reference that file by other nodes (possibly more than one node).

The application is such that there's a "forms library" that will have various documents refer to forms.

I have looked at FileField Sources, but I'm not clear if I change a file in node A, if the attached file in node B will reflect that change.

Additionally, we're finding related nodes based on taxonomy terms (http://drupal.org/project/relevant_content), so it would be nice if I could refer to the node, but by clicking on the link to the node (via the node reference), the file opens.

I've looked at Custom Formatters (http://drupal.org/project/custom_formatters) and Formatters 4 Node Reference (http://drupal.org/project/formatters4nodereference) as suggested by Attaching existing server files to filefield, but I don't seem to "get" the two modules, and neither of them are flush with documentation.

Is there a module for this, or am I looking at writing something?


texts: Error class not being set on form fields

texts:
I have a complex for that for various reasons I am validating in the _submit hook instead of the _validate. This is working great with the exception that the error class isn't getting added to the form elements.

Is there something simple I am missing or do I need to use form_get_errors and set the classes myself?

(The reason I am doing validation in submit is because I want to save the form data regardless of if it is valid or not.)


texts: Why am I getting undefined is not a function when using jquery?

texts:
HTML

more code here...

<script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="https://example.com/sites/all/modules/ac_modules/ac_exercise/ac_exercise.js?nkuo2r"></script>

more code here...

<div class="form-item form-type-textfield form-item-time-start">
  <label for="edit-time-start">Time Start </label>
 <input type="text" id="edit-time-start" name="time_start" value="11:28:12" size="4" maxlength="8" class="form-text" />
</div>

more code here...

Javascript - ac_exercise.js

$(document).ready(function(){
  $("#edit-time-start").on("change paste keyup", function() {
     alert($(this).val());
  });
});

In Chrome's console I get the following error:
Uncaught TypeError: undefined is not a function - ac_exercise.js?nkuo2r:1 which is this line of code:

$(document).ready(function(){


texts: View - show predetermined result set prior to exposed filter

texts:
Standard behavior: I have a view that has some filters exposed to the user. When the user first visits the page, the exposed filters are empty and the view just shows everything. When the user modifies a filter, the view shows a subset of the results based on their query.

Ideal behavior: When the user first visits the page, and have not performed a search using the exposed filters yet, I'd like the view to show a predetermined set of results... like a group of highlighted* items that I'd want the user to see. Then they perform a search, and the view acts normally.

Is this possible?

*These "highlighted" items would be determined by a field in the node.


texts: How do I remove the tabs from the edit field collection form in Drupal 7?

texts: When editing a field collection on a node there are two tabs typically, view and edit. I wanted to remove them. Obviously I can hide them with CSS, but this feels like the wrong way to do it. Is there a better way?


texts: Logo doesn't appear on the Seven theme on a fresh installation

texts: I've got a fresh install of D7.9 and have enabled the 'Seven' theme which has an option to override the default logo in Appearance -> Settings. I have uploaded a logo file and can see it via ftp but it does not show up on the site. Have I missed a step or does this theme not support logos out of the box?


texts: How to disable Review step in Drupal commerce implementation?

texts: I am implementing Drupal Commerce module in one of the website. It works fine, but now the requirement came is like, they don't want to show the Review step which comes after the Cart page. So is there any way to disable/skip this step and move forward? Any suggestions will be appreciated.


texts: How to set 'INSERT IGNORE' in db_insert without db_merge

texts:
Is anyone know how to set 'INSERT IGNORE' in db_insert?

I cannot use db_merge because I'm going to insert many rows.

$query = db_insert('table')->fields(array('foo', 'bar'));
foreach ($rows as $row) {
  $query->values(array(
    'foo' => $row->foo,
    'bar' => $row->bar,
  ));
}
$query->execute();


texts:
I have a views showing some selected terms of a vocabulary. The Views block is created using Taxonomy Terms as content(show). It showing order by the terms tree. But my client want to sort it as their business policy(most popular on top).

Is there any way to sort the terms like custom way as node queue.
Please suggest me any module, hooks or other custom solutions.
Here is my views settings :

Thanks in advance.

Note that I want to sort the terms Not the entities tagging with it.
I have installed nodequeue and smartqueue but unable to achieve the requirment.


texts: How do I create a form in a modal dialog with Drupal 7?

texts:
There seems to be many solutions for implementing a modal dialog including Ctools, Colorbox, Simple dialog, and Ctools Auto-modal. I'm not sure which is the best to use for simple coding through the Form API to create popup forms in a modal dialog.

The big issue seems to be validation. Are there any best practices for creating a modal form in Drupal?


texts: Theme user pictures in comments in drupal 7

texts:
I'm trying to set a specific style for user pictures in comments in drupal 7, but can't find how to do it.
I know there is a module for this (http://drupal.org/project/imagecache_profiles) but it's really an overkill since I just want pictures to be themed in comments, according to a style I already created in Image_cache configuration.

In comment.tpl.php, there is a <?php print $picture; ?> , but it's directly the html for the image, so I can't apply the theme function of image cache, for instance theme('imagecache','size32x32', $data->users_picture);
The $author variable is also html.

Is there a way to get the theme function to work in this comment.tpl.php file ?
Is there another way to achieve this ? Thanks !


texts: Mention/Reply to users in comments using @ (@name)

texts:
I am looking for a feature that makes it possible to reply to comments, or mention users in a comment using the @ symbol.

So, if I was to write the following in a comment on a node:

  @Michael Jackson Cool stuff dude.

"@Michael Jackson" would turn in to a link that leads to his user page.

Also, if it is possible without to much hassle, it would be great if it only turned in to a link if the user exists, to prevent a 404 error.

Thanks.


texts: Import module lose first symbol in some word in CSV file after import

texts:
Import module of Drupal 6 lose first symbol in some word in CSV file after import.

Example.
Before import:

After import:

In CSV file  word is "Refond", but after import - "efond".


texts: hook_quicktabs_alter() is not called when using two quickstabs on the same page

texts:
I have embedded a second quicktab on page, which is called from the first quicktab (using qtabs as tab type).

The function hook_quicktabs_alter() is only called for the first quicktab, not for the second quicktab.

Any ideas?


texts: How to make a page where two content types are combined

texts:
It should be a portfolio website. I'm going to place there information about projects I was engaged in and products I designed. The relationships between project and product nodes are those:

--Project 1
----Product 1
----Product 2
----Product 3
--Project 2
----Product 4
----Product 5
----Product 6
etc.

My question. How to create a page where placed all project articles and under each project article there should be related product article teasers. Like on image.


texts: How do I create a page that returns an XML feed?


texts: Drupal 8: Build "visitor history" using Flag/Rules

texts:
I need to build a history for visitors so they can see which pages they've visited (ideally filtered by type).  To do this, it seems that the correct combo is to use Flag module and then Rules.

I'd anticipate that I'd create a new rule config where I'd ensure the content was of a certain type, ensure a flag existed, then automatically mark the flag each time the content of that type was visited.  I'd also have to update the time if an 'already-flagged' content was visited again (ie. so it appears at the top of a 'history' list).

I've messed around with Rules in Drupal 8 and I didn't get far at all.  I could obviously add a rule for 'node is viewed', and then condition of it being the right type.  But then I got stuck.

I need to be able to do things like see if there's a flag available, see the current value of the flag for that user, automatically set/update the flag, etc.  I couldn't figure out how to do any of this.

Help? :)


texts: I Am Making A Contact Page In Drupal 7 In Which I Have To Show Office Address And A Contact Form Made With Webform Show Together So Can Anyone Suggest Any Idea How To Show A Content And Webform In Same Page


texts:
I have created a custom entity - which seems to be working pretty well. I can create Bundles, build views on those bundles, create individual entities ad nauseum, I can reference the entity in entity reference fields. I can see the Views the Entity module creates in Features, I just can't see the entity or its bundles.

Even worse, the other custom entities I have written are showing just fine.

Any thoughts on what might be wonky? or steps to debug features?

Thanks


texts: Rendering a region fo a theme programmatically

texts:
I am building a module that contains a route and a controller that only renders a specific theme region, without any surrounding HTML.

How can I load and render the region programmatically within the controller output method?

The region output from the controller contains one or more blocks and the entire region needs to be embedded on another site. The site will retrieve the markup using a custom route (e.g. example.com/partials/header or example.com/partials/footer).

I don't know which blocks are going to be in the region; the list of blocks in the region is not hard-coded in the module.


texts: How to set required POST parameters for routes

texts:
With GET method we can do something like this

example.user
  path: 'example/{user}'
  defaults:
    _controller: '\Drupal\example\Controller\ExampleController::content'
  requirements:
    _permission: 'access content'
    user: ^[a-zA-Z0-9_]+

so it sets user param as required and also limits its format.

But I'd like to do something similar with POST method. Tried this, but not working:

example.user
  path: 'example'
  methods:  [POST]
  defaults:
    _controller: '\Drupal\example\Controller\ExampleController::content'
  requirements:
    _permission: 'access content'
    user: ^[a-zA-Z0-9_]+

EDIT:

Sure I can set some logic inside controller like this, but it doesn't feel right:

public function store(Request $request) {
   $params = json_decode($request->getContent(), TRUE);
   //I'm trying to avoid using these conditions inside controller methods
   if(empty($params['user'])){
      //return error response
   }else{
     if (!preg_match('/^[a-zA-Z0-9_]+/', $params['user'])) {
       //return error response
     }
   }
  //return success response
}

So what's drupal way to do it?


texts:
I'm completely new to drupal and am starting to take interest in the process of theming. I was wondering if anyone could suggest a reference or perhaps even just insert a snippet of code explaining the basic template.

I have some PHP experience but nothing too complex. I'd really like to learn how to apply javascript into my themes and what the best approaches would in terms of that. I attempted the other day to insert some HTML via the regular "create content" section and then wrote a stylesheet to correspond to said HTML, I linked via the template.info file, but it didn't work because Drupal had renamed all of my div's. Is that normal?

Sorry if my question seems to be too broad in scope, I guess I just need a direction or map and I'd be fine. Thanks in advance, and looking forward to becoming a contributing member of this community.


texts: hide unpublished content in view, for everybody except the author

texts:
I'm trying to make a view of articles written by an author.
I use the author UID from the URL as a contextual filter.

I want to hide unpublished content from everybody except the author himself.

I have removed the published filter, hence all unpublished content is visible.
My first guess was to write some php code to check if the uid of the logged in user and that from the URL are same or not. If true display unpublished content or else hide unpublished content. But could not implement it.

Please suggest any possible solutions. Thank You.


texts:
I want to use my theme's behaviors.js (not template.php etc) to create jQuery UI tabs.

Here is an example of jQuery UI tabs where the js is

$("#tabs").tabs();

My html =

Tab 1

Tab 2

Tab 3

Content for Tab 1

Content for Tab 2

Content for Tab 3

My bartik.behaviors.js =

(function ($) {
$(document).ready(function(){
$("#tabs").tabs();
});
})(jQuery);

but as you can see on my Drupal 7 site here the tabs are not rendered.

Question: What is the correct code for my bartik.behaviors.js ?


texts: Generate a view with parent - child taxonomy terms

texts:
Is there any way that I can create a view of parent-child taxonomy terms that would look alot like this? I was thinking I could use the parent relationship and then group terms and print in a grid but there is no options for parents to be a group field.

http://www.amazon.com/gp/site-directory/ref=nav_shopall_btn


texts:
Using the module Features in Drupal 8, if I export them and install them in a different site. When there are changes and exported again, if I replace the files in the destination site, how can I update the installed features? I can't find anywhere in the UI to do it.

I can't use drush.


texts: Dim background elements when displaying submenu

texts:
I am developing a site with Drupal 7 and the requirement that I need to implement is that when a sub-menu is being displayed from the main navigation bar, the rest of the site (all the elements behind the sub-menu) is dimmed (just like when displaying a modal dialog box with JQuery).

I was wonder how I would go about accomplishing the same effect using Drupal's default menu system?

Thanks.


texts: Views Contextual Filter Match criteria with contains instead of equal to

texts: When setting up contextual filters, its fixed setting is if the argument equals the result. I want to be able to choose if my result contains my argument string. How can this be done?


texts: What is the good way to pass a value from form creation function to its submit handler?

texts:
I am newbie in Drupal, I have a query that i want to pass some value from form creation function to its submit handler.

Right now, I am saving that value in a form element of hidden type.

$form['product_nid'] = array(
 '#type' => 'hidden',
 '#value' => 12,
)

But this is not safe, anyone can change value on client side.


texts: What is the correct core update workflow?

texts:
I want to use composer to manage Drupal 8 dependencies, but I'm not sure what is the right core update workflow.
At the moment I'm using drush to update core to latest beta release, but I also have some dependencies in my composer.json file, so after the update I'm using composer install to install all the contrib vendor dependencies.
It appears that running composer install overrides some files in the core directory, although I've just updated core to latest version.

I've also tried to manually edit the composer.json file and replace the "drupal/core" line with the specific beta release, e.g. "drupal/core": "~8.0-beta14",, but it still overrides files in the core directory.

What is the right workflow?


texts: nodequeue issue occured after updating whole site

texts:
After updating whole site and all modules to latest version of drupal. I got following errors. Due to this I'm not able to add content insite the nodequeue.

Notice: Undefined offset: 2 in nodequeue_handler_relationship_nodequeue->init() (line 19 of /home/dev/public_html/sites/all/modules/contrib/nodequeue/includes/views/nodequeue_handler_relationship_nodequeue.inc). Notice: Undefined offset: 2 in nodequeue_handler_relationship_nodequeue->init() (line 19 of /home/dev/public_html/sites/all/modules/contrib/nodequeue/includes/views/nodequeue_handler_relationship_nodequeue.inc


texts: How to capture credit card information to manually process later?

texts:
I developed a Drupal 7 website for a client who hosts a yearly fitness expo. This year he has a competition event that requires registration and a fee.  I am looking for a way securely capture the necessary credit card and customer information to be used later to manually process the transaction.

My client has a Squareup account that he wants to use to process the transactions.  I am open to other solutions as well. While I know what Square is, I don't know anything specifically about it. Does anyone know if they offer a way for me to link to a form on their site to do what I am looking for?


texts: Using an admin account as the sender for an action rule instead of site:current-user

texts:
I am using a reaction rule that triggers, when a new user is registered. This rule sends a private message to a role ( service-role ).

The sender of the message is the actual logged in user - in this case the user that was just created, the new user.

I want the sender to be the admin but I have no change to select the admin the the data-selection field. How can I archive any other user that the actual logged in user?


texts:
We have a link on our site which will redirect users to the edit profile page when they are logged in.

We have same link for the anonymous users which will redirect the user to login page when it clicked.

We would like to redirect users to the edit profile page after login but if users use normal login link, after login, they are redirected to the homepage.

I would like to know how we can redirect users to edit profile page after login only if they clicked on the edit profile link.


texts:
I have custom tables and want to execute this query.

select displayname from foolzz_users_profile
join foolzz_user_has_user on (fk_user1=1 or fk_user2=1)
where fk_users_uid != 1;

The "1" numbers will be replaced with the users uid.
This is my query in the module.

$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
$uid = $user->get('uid')->value;

$query = \Drupal::database()->select('foolzz_users_profile', 'e');
$query->fields('e', array('fk_users_uid,displayname'));
$query->join('foolzz_user_has_user','d','d.fk_user1=:uid OR d.fk_user2=:uid',array(':uid' => $uid));
$query->condition('e.fk_users_uid', $uid, '<>');

$friendlist = $query->execute()->fetchAssoc();

I'm searching for hours and still couldn't get it to work.


texts: Display child terms in term taxonomy page

texts:
I have a vocabulary named "Catagory" with a term tree structure including parent and child taxonomy terms.

In every term's page I want to display all the child terms for that current term.
Terms are using alias.
As far as I understand it can be acheived with views, but how?

Thanks!


texts: Drupal 7 Breaks CSS Rule Ordering Standards when CSS Aggregation is Turned On

texts:
Drupal 7 has an interesting bug (some may consider this a feature) when rules are included before an external CSS document is included using @import. The CSS Aggregation engine will let you "bend the rules" by declaring CSS before calling external stylesheets with @import. While there are very different solutions provided here, they both solve the issue.

Example CSS:

This example works with CSS Aggregation turned ON but will not work if CSS Aggregation is OFF.

* { margin: 0; padding: 0; box-sizing: border-box; }
@import 'header.css';
@import 'component-a.css';
@import 'component-b.css';
@import 'footer.css';

My assumption is that Drupal 7 CSS Aggregation engine actually fetches the contents of the @import calls and appends the contents to the main file as a subroutine.

Solution:

The solution was to follow the CSS standards by moving all of the @import calls to the top of the document, before declaring rules internally.

@import 'header.css';
@import 'component-a.css';
@import 'component-b.css';
@import 'footer.css';
* { margin: 0; padding: 0; box-sizing: border-box; }

While this question was originally marked as "off-topic", I think it's still important to illustrate how CSS is interpreted by the Drupal 7 CSS Aggregation Engine. It should be understood that these two different methods are VERY DIFFERENT in the way they are interpreted since CSS is sensitive to rule ordering.

More Accurate Solution:

The more accurate solution to this problem would be to include the first line in another CSS document, for instance reset.css.

@import 'reset.css';
@import 'header.css';
@import 'component-a.css';
@import 'component-b.css';
@import 'footer.css';

I hope this helps other people understand the nuances of the Drupal 7 CSS Aggregation engine.


texts: How can I programmatically add a link that redirects users to a parent site?

texts:
I'm currently building a Drupal multi-site and I'm trying to figure out if there is a way to add a link programmatically that redirects to the Drupal parent site.

Using {{ url('<front>') }} only redirects to the home page of the multi-site. I could just add it manually but I was searching to make it dynamic instead.


texts: Using the User Referral Module, How do I display referral link within a block using PHP?

texts:
I have downloaded the User Referral Module and am trying to display the user's link within a block so I can place it on a specific landing page.

The module out of the box doesn't have Views support, so i was thinking i could add some PHP to a block. Filter by UID of current logged in user.

I wish I was better at PHP, but unfortunately I cannot figure it out.

Here is the section of module code that makes it show up on the user's page:

function referral_user_view($account, $view_mode, $langcod) {
  global $user;
  $referrals = array();
  $link = "referral/" . _referral_uid2ref($account->uid);
  if (!variable_get(REFERRAL_DISPLAY_MODE, 0)) {
    if (user_access(REFERRAL_PERM_USE)) {
      if ($user->uid == $account->uid) {
        // User is viewing own page, show referrals
        $referrals[] = array(
          '#title' => t('Your referral link'),
          '#markup' => url($link, array('query' => NULL, 'fragment' => NULL, 'absolute' => TRUE)),
           '#type' => 'user_profile_item',
        );
        $referrals[] = array(
          '#title' => t('Referrals'),
          '#markup' => l(t('View users you have referred'), 'referral/view'),
          '#type' => 'user_profile_item',
        );
      }
    }
  }

  if (!$user->uid) {
    $referrals[] = array(
      '#title' => t('Referral link'),
      '#markup' => l(t('Register to this site using my referral link'), $link),
      '#type' => 'user_profile_item',
      );

    referral_set_cookie(arg(1));
  }

  if ($referrals) {
    $referrals['#type'] = 'user_profile_category';
    $referrals['#title'] = t('Referrals');
    $referrals['#weight'] = 10;
    $account->content['Referrals'] = $referrals;
    // return array('Referrals' => $referrals); // obsolete from drupal 5
  }
}

function referral_set_cookie($uid) {
  $cookie = array(
    'uid'       => $uid,
    'timestamp' => time(),
    'ip'        => ip_address(),
    'referer'   => $_SERVER['HTTP_REFERER'],
  );

  $cookie_lifetime = variable_get('referral_cookie_lifetime', 1) * 86400;
  setcookie(REFERRAL_COOKIE, serialize($cookie), time() +     $cookie_lifetime, '/');
}

function referral_block($op = 'list', $delta = 0) {
  $title[0] = t('Top referring users');
  switch ($op) {
    case 'list':
      $block[0]['info'] = $title[0];
      return $block;

    case 'view':
    switch ($delta) {
      case 0:
        $block['subject'] = $title[0];
        $block['content'] = referral_block_content();
        break;
    }
    return $block;
  }
}

function referral_block_content() {
$header = array();

I tried this code with no luck:

 $referralLink = url('referral/'. _referral_uid2ref($GLOBALS['user']->uid), array('query' => NULL, 'fragment' => NULL, 'absolute' => TRUE));


texts: How can I use webform to upload assets and create a project that can be assigned to different users

texts: I am trying to put together a creative request form that a client would fill out. A studio manager would then follow up and assign to a project manager. I am using webform and rules as a starting point with the possibility of using Open Atrium.


texts: Export and import modules of an installation

texts:
In almost every drupal installation I set up, I use a package of modules. So my question is simple. Is there any way or module or something like that that will do this in an easy way?

To be more specific I am searching for a tool or something like that that will export a list of selected modules from one drupal installation. Then after a fresh installation, I would import this list and the modules would be automatically installed.

Is there any tool/module that can achieve what I described?

Thx in advance


texts:
Now I have built a search view and expose one parameter for user to filter search results.

The parameter is input via a textfield, i.e.:

 +------------------+
 | car              | [search]
 +------------------+

Is it possible to modify the above search view by:

change the textfield to textarea
such that user can input multiple values (one at each row)
the filter will match any of the values entered
and present results

i.e.:

 +------------------+
 | car              | [search]
 | magazine         |
 | 2012             |
 |                  |
 |                  |
 |                  |
 +------------------+


texts: Force authentication for specific IP range on IIS

texts:
I have a Drupal 6 installation as a corporate Intranet site.  I would like to permit a set of IP ranges the ability to view the site anonymously, and anything that does not match that rule must authenticate (either by form, or by HTTP - either would be fine).

I've looked at httpauth (obsolete) - this could be made to work, but I found it wasn't reliable under IIS.

I looked at securesite (what took the place of httpauth), but was getting issues with the form authentication (didn't look at the http authentication portion in detail).

In both cases, the modules didn't seem to be configurable to configure that behaviour on a per-ip basis, but I expect could be modified to do so.

Anyone know of anything out there that might solve this problem?


texts: Add view with contextual filter to XML sitemap

texts:
I setup a view with the following path www.example.com/profile/% (the user contextual filter i added is the username of the). These displays the profile of each user.

Please is there a way to add the view to the XML sitemap?


texts: Docker website running locally not loading CSS

texts:
I'm completely new to Drupal, and I'm running this multi-container Drupal-Docker app locally, and website is only loading HTML, no CSS.

These are the only error warnings I am getting.

  exception 'PDOException' with message 'SQLSTATE[08006] [7] could not translate host name "dbname=template1" to address: Name or service

Any help?


texts: checking whether the label of views fields is excluded from display?

texts: I am writing a views style plugin . I want to check whether the fields of views has its checkbox of label exclude form display has been checked or not . I tried doing dsm($variables) , but dint found the variable that can give me some idea about the same. Can someone help please?


texts: Views: How to list nodes that are referencing to nodes, pointing to the current node

texts:
I have 3 contenttypes where 2 of them have reference entity fields. Each their own entityfield.

Contenttype C is the parent. Type B points to type C. Type A points to B.

On every Node of type C i want to display a view that lists the nodes of type A pointing to B, that points to C. Is this possible?

Help appreciated.


texts: unable to add configure field to drupal view

texts:
I added a new field to an existing content type. But when I try to add same field or any other field to the view, I don't find it in the list except few.

Eg: I added image field to content type. Then I clicked on 'edit view' for which I want to add this image field. Then I click on add field under fields section. I don't find the fields of image body or anything, except title field others.

Can anybody help me sort out this issue?


texts: Contextual Filters for a Block on a Page

texts:
I am trying to figure out how to create a page with dynamic content within a block.

For example, a simple "About Us" page may have sub pages of "Contact," "Blog," "History," "Locations"

I would like the Page to remain the same, but only the content within the block change.

So, assuming that from an expanding menu you have the choices noted above.  When you click on the "About Us" menu option you get:

About Us

Picture_Default
Text_Default

Now, if you click on the "History" sub menu, you get:

About Us

Picture_Default
Text_Content_Default

History

Text_Content_History

Thus far, I have created a page with the static "About Us" content.  I created a Views block with a contextual filter based on Node ID.  I also configured the blocks to display only on the about and about/* pages.

When I go to domian.com/about I get the default page.  (That works)
If I go to domain.com/about/history, I get a "page not found error" where the static content should be and the correct sub page.

I have been searching for this answer and I am sure it has already been answered, but I am not sure if I am using the right terminology to bring up the relevant results.  If anyone could point me in the right direction, I would greatly appreciate it.

Thanks!


texts: How can I invoke hook function after the block is loaded?

texts:
I have created a view with content types in my Drupal 8 and for this view page I have created a customised filter. The view page is located in sites/mysite/modules/view/config/install

And the customised filter is located in sites/mysite/modules/filter/src/Plugin/Block

The issue for me is that I want to change a title of the filter in hook function in view.module . But it is loaded before the FilterBlock. How can I specify the order of the invoked files?


texts: Show a form element only to certain roles

texts:
Drupal's form API has a visibility state property that allows you to hide certain Form fields depending on the options selected in earlier forms.

Is there something similar for User role (e.g. a particular form field will only display if the logged in user has a certain role).

I know I can hide unwanted form fields according to role via CSS, but I would rather not print out the fields in the first place. I am creating my form inside theme-settings.php

Edit Update:

Here is my code following Rooby's answer:

function legendarysettings_form_alter(&$form, &$form_state, $form_id) {
  // To get the currently logged in user.
  global $user;
  // To target the required form.
  if  ($form_id == 'system_theme_settings') {
    // Set the role ID of the role that can edit.
    $rid = 3;
    // If user doesn't have the role in question.
    if (isset($user->roles[$rid])) {
      // Deny access to the field.
      $form['theme_settings']['admin']['#access'] = FALSE;
    }
  }

This works, except it hides the 'admin' field for role 3 (which is the admin role) but shows it to all other roles. I want the admin field to be only visible to the admin role.


texts:
I created a form in English. I used the localization webform module to translate the fields of the form. In configuration -> Regional and Language -> Translate interface -> Translate. It works!

Now I'd like to translate different e-mails in several languages. For this I enabled the option: "Synchronize webform recipients e-mail across node translations."

Now what I need to do more? I wanted to set up E-mails with  confirmations in different languages or even use different email. I'm a little confused on this part.

Thank you for your help.

Best regards.


texts:
I am using Drupal 7.32 and the latest Boost, Boost Crawler and Cache Expiration modules. My 'normal pages' refresh fine with boost when i amend them ie. articles, Basic Page, Content Type node, but if I change a node which belongs to a Views page (e.g. a News item on a News Blog page contructed with a View), then it does not pull in the latest news item i have just created i.e. does not expire the News Blog page. Within the documentation at https://www.drupal.org/node/545908 it shows the option

[x] Clear all cached views pages associated with a node on update/delete

But I cant see where to set this in the Boost module settings. I think that would fix my problem. Maybe that is referring to old documentation, perhaps the new module does it in a different way.

Can anyone help?


texts: Ajax Form Callback return 500 Internal Server Error

texts:
Build form :

public function buildForm(array $form, FormStateInterface $form_state) {
 $form['service_name'] = [
    '#type' => 'textfield',
    '#attributes' => [
        'placeholder' => t('Поиск по названию'),
        'class' => [
            'input',
            'input_small',
            'input_bordered',
            'input-with-icon',
            'input-with-icon_right',
            'input-search-icon',
            'input_services-search'
        ]
    ]
];

$options = $this->getServicesOrganizations();

$form['services_organizations'] = [
    '#type' => 'select',
    '#options' => $options,
    '#attributes' => [
        'class' => [
            'input',
            'select_small',
            'select_standart',
            'input_bordered',
            'input-with-icon',
            'input-with-icon_right',
            'input-select-arrow-icon'
        ]
    ]
];

$form['services_search_submit'] = [
    '#type' => 'submit',
    '#name' => 'submit',
    '#value' => $this->t('Найти'),
    '#ajax' => [
        'callback' => '::ajaxSubmitCallback',
        'event' => 'click',
        'progress' => [
            'type' => 'throbber'
        ]
    ],
    '#attributes' => [
        'class' => [
            'button',
            'button_small',
            'button_standart',
            'button_text-white'
        ]
    ]
];

$form['system_messages'] = [
    '#markup' => '

',
    '#weight' => 100
];

return $form;

}

Callback method:

public function ajaxSubmitCallback(array &$form, FormStateInterface       $formState)
{
    $ajax_response = new AjaxResponse();
    $ajax_response->addCommand(new HtmlCommand('#form-system-messages',      'test'));
    return $ajax_response;
}

When I click on submit button in form, in browser console appears error:

Uncaught AjaxError:
Возникла AJAX HTTP ошибка.
Полученный код HTTP: 500
Следует отладочная информация.
Путь: /services?ajax_form=1
Текст Состояния: Internal Server Error
Текст Ответа: {}

And in logs:

Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: "The specified #ajax callback is empty or not callable." at /var/www/drupal/stas -m.mfc/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php line 67

Where i make mistake?


texts: Install module that requires composer on server with only FTP

texts:
I am working on website that only has restricted ftp access. Ya, no way around it.

I want to install the module PHPmailer, which uses composer to install libraries.

I have a local composer run dev site, from which I installed properly, then moved the module dir, and composer.json, composer.lock to the server, but when installing the module on the server I get the error

Please install the PHPMailer library by executing 'composer update' in your site's root directory. (Currently using PHPMailer library version Missing).

Does composer update the database or what is going on here?

How can I easily install a module that made it self dependant on composer?


texts: Drupal 7 chosen module use ajax to fill the select

texts:
I have two select elements and depending on what I select in the first select element second should fill from ajax call. First one is the simple select second one use chosen. The problem is if I fill .chosen-results ul with li results in jQuery and press on select elemnt it clears all ul.
    'purchase_type' => [
        '#type' => 'select',
        '#options' => _purchases_fill_type_options(),
        '#attributes' => [
          'class' => ['purchases-funds-report-item-type'],
        ],
        '#empty_option' => t('Select type'),
        '#empty_value' => '',
        '#required' => TRUE,
        '#title_display' => 'invisible',
        '#default_value' => '',
        '#cell_attributes' => [
          'class' => ['purchasetype'],
        ],
      ],
      'account_name' => [
        '#type' => 'select',
        '#options' => [],
        '#empty_option' => t('Select account'),
        '#required' => TRUE,
//        '#chosen' => TRUE,
        '#title_display' => 'invisible',
        '#default_value' => '',
        '#attributes' => [
          'class' => [
            'purchases-funds-report-account-name',
            'common-select-report',
          ],
        ],
        '#cell_attributes' => [
          'class' => ['accountname'],
        ],
      ],

Chosen is commented because I initiate it from jQuery adding class on it and sending to attachBehaviors because these rows are added dinamicly:
$('#purchases-report-funds-edit-form', context).on("gridTableRowAdd", 'tr', function() {
      $(this).find('.accountname select').addClass('chosen-enable');
      Drupal.attachBehaviors(this, Drupal.settings);
    });

And the result of ajax :
var li_options = ['
' + Drupal.t('Select account') + '
'];
$.each(data, function (i, value) {
            li_options.push('
' + value + '
');
          });
$this.parents('tr').find('.chosen-results').html(li_options.join(''));

When I press first select and populate chosen select:

Then I press chosen select and it clears:

This approach is working fine when chosen select options are defined from php code and not dynamically added.
My question is there any event that I should fire on that the list was changed so it doesn't clear it, or another way it can be solved?


texts: Taxonomy jump list in view in parent/child order

texts:
I have a taxonomy vocabulary of universities with their parent states. I then added this taxonomy field to the user profile so I could indicate what university the person was from. I'm trying to get this taxonomy vocabulary to display in an jump menu in a view (Drupal 7, Views 3) and honor the parent hierarchy, but the child/parent relationship is not being honored. This is how my jump list looks:

    California
    University of Georgia
    --Joe
    --Mary
    Georgia
    University of California
    --Mike
    --Jill

I'd like it to look like this:

    California
    --University of California
    ----Mike
    ----Jill
    Georgia
    --University of Georgia
    ----Joe
    ----Mary

I've read many possible solutions that suggest to add, "Taxonomy: Terms on node," but I don't even see that as an option. Any help would be greatly appreciated.


texts: How do I send a drupal_http_request() with GET method?

texts:
Following examples found here and in API, I tried 2 methods, both return a bad request status message.

First method

$data = 'name=value&name1=value1';

$options = array(
  'method' => 'GET',
  'data' => $data,
  'timeout' => 15,
  'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'),
);

$result = drupal_http_request('http://example.com/foo', $options);

dpm($result);

Second method

$data = array(
  'key1' => $value1,
  'key2' => $value2,
);

$full_url = url('http://example.com/foo', array('query' => $data));

$options = array(
  'method' => 'GET',
  'timeout' => 15,
  'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'),
);
$result = drupal_http_request($full_url, $options);

dpm($result);

Which one is the good one and what's wrong ? Thank you

Edit

This is dpm($result)


texts:
I have a view page where the sort criteria are tag names.

I want to have the appropriate tag-name appear as a h2 above the content of that type.

Is there an easy way to do this? Or do I have to mess with Twig templates?


texts:
I have written a custom formatter for taxonomy term fields. Now I would like to expand the module and add a custom entity renderer to show the entity in the very same formatter-like way, using mostly the same code.

The reason I need it is that while theming Search API Views fields, I'm not given an option to format term reference as a field, but only as entity.

I thought I'd provide a custom entity view (via hook_entity_info_alter). But then, how do I provide the HTML output of the entity?


texts: Two concerns: Available for security updates / Image captions

texts:
I am looking at revamping a set of sites from ASP to Drupal. I like a lot of what I see in Drupal, but have two concerns:

In reading about Drupalgeddon, it seems that the problem was that many people didn't even see the security notice before hackers started exploiting the vulnerability. I have no staff, so this means I need to be available immediately to install security updates when they are announced. I don't know that I want to be chained to my websites that way, or leave them potentially vulnerable if I decide to go on vacation for a month.
I've been amazed to find that Drupal has no innate ability to put captions on images. Doing that appears to require choosing between three modules (Image Caption, Image Field Caption, or Image Caption Formatter) with no documentation that compares and contrasts the modules to help with the choice. Putting captions on images is a pretty basic requirement, so it makes me wonder what else I'm going to find out I can't do easily once I start porting content.

Comments?


texts: How do I re-arrange the $node->taxonomy array back into a hierarchical tree?

texts:
In a node I'm creating, there is a hierarchical select widget. The widget saves the 'deepest' term in a given taxonomy.

These terms come out in the $node->taxonomy array in tpl files.

I want to build the tree right back up to the last parent. How do I do this? What is the algorithm? I have a complete sphagetti mess that's not even worth posting here, right now. I have a feeling there's recursion involved somewhere, but I'm missing the specifics - pseudocode please?


texts: Adding a full screen background image to Drupal 7 / Bartik theme

texts:
Has anyone managed adding an image as background to a Drupal 7 with default Bartik theme?

Maybe using a fullscreenr plugin for jQuery?

I'm not sure where to store that code best and do I need to include jQuery or is it already included (I suppose it is included, but you can't call $() for some reason there? What does it mean to be changed in fullscreenr code below?)

And how can I call $.fn.fullscreenr (or whatever should be called to plant the background image) in Drupal?

Thank you! Alex

/**
* Fullscreenr - lightweight full screen background jquery plugin
* By Jan Schneiders
* Version 1.0
* www.nanotux.com
**/
(function($){
    $.fn.fullscreenr = function(options) {
        if(options.height === undefined) alert('Please supply the background image height, default values will now be used. These may be very inaccurate.');
        if(options.width === undefined) alert('Please supply the background image width, default values will now be used. These may be very inaccurate.');
        if(options.bgID === undefined) alert('Please supply the background image ID, default #bgimg will now be used.');
        var defaults = { width: 1280,  height: 1024, bgID: 'bgimg' };
        var options = $.extend({}, defaults, options);
        $(document).ready(function() { $(options.bgID).fullscreenrResizer(options); });
        $(window).bind("resize", function() { $(options.bgID).fullscreenrResizer(options); });
        return this;
    };
    $.fn.fullscreenrResizer = function(options) {
        // Set bg size
        var ratio = options.height / options.width;
        // Get browser window size
        var browserwidth = $(window).width();
        var browserheight = $(window).height();
        // Scale the image
        if ((browserheight/browserwidth) > ratio){
            $(this).height(browserheight);
            $(this).width(browserheight / ratio);
        } else {
            $(this).width(browserwidth);
            $(this).height(browserwidth * ratio);
        }
        // Center the image
        $(this).css('left', (browserwidth - $(this).width())/2);
        $(this).css('top', (browserheight - $(this).height())/2);
        return this;
    };
})(jQuery);


texts: Warning: Invalid argument supplied for foreach() in image_style_create_derivative() (line 902 of image/image.module)

texts:
I'm uploading my images to Rackspace cloud CDN using the following code:

<?php

if (!empty($entries)) {
  foreach($entries as $value) {

    $container_id = $value['cid'];
    $nid = $value['nid'];
    $id = $value['id'];
    $image_path = $value['image_path'];
    $image_style = $value['image_style'];
    $final_image_name_path = $value['final_image_name_path'];
    $container = $value['container'];
    $users_list = $value['users_list'];
    $api_key = $value['api_key'];
    $regions = $value['regions'];
    $abbreviative = $value['abbreviative'];

    $client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
    'username' => $users_list,
    'apiKey'   => $api_key
    ));

    $service = $client->objectStoreService('cloudFiles', $abbreviative);
    $container = $service->getContainer($container);
    $temp_arr = explode("/", $final_image_name_path);
    $end_element = end($temp_arr);

    try {
      $file = $container->getObject($end_element);
      $fileExists = true;
    } catch (Exception $e) {
      $fileExists = false;
    }

    if ($image_style == "245") {
      $image_style_w = "168";
    } else {
      $image_style_w = $image_style;
    }

    $style = $image_style_w . "w_" . $image_style . "h";
    $display_style[$image_style] = image_style_load($style);
    $image_destination = str_replace("rcf:///", "public:///rackspace/", $final_image_name_path);
    image_style_create_derivative($display_style[$image_style], $image_path, $image_destination); // Error is expected here!

    if ($fileExists) {
      $file->setContent(fopen('sites/default/files/rackspace/' . $end_element, 'r+'));
      $file->update();
    } else {
      $container->uploadObject($end_element, fopen('sites/default/files/rackspace/' . $end_element, 'r+'), array());
    }
    drupal_unlink($image_destination);
  }
}
drupal_exit();

?>

Where I'm getting errors in my dblog as

  Warning: Invalid argument supplied for foreach() in image_style_create_derivative() (line 902 of /image/image.module).`

When I tried to check the code there in the image.module its something like this,

foreach ($style['effects'] as $effect) {
  image_effect_apply($image, $effect);
}

Where might I've been wrong in my custom code?

When I've print_r($display_style[$image_style]) this is what I've got.

Array
(
    [isid] => 1
    [name] => 800w_800h
    [module] =>
    [storage] => 1
    [effects] => Array
        (
            [1] => Array
                (
                    [label] => Resize
                    [help] => Resizing will make images an exact set of dimensions. This may cause images to be stretched or shrunk disproportionately.
                    [effect callback] => image_resize_effect
                    [dimensions callback] => image_resize_dimensions
                    [form callback] => image_resize_form
                    [summary theme] => image_resize_summary
                    [module] => image
                    [name] => image_resize
                    [data] => Array
                        (
                            [width] => 800
                            [height] => 800
                        )

                    [ieid] => 1
                    [isid] => 1
                    [weight] => 1
                )

        )

)


texts: How to set permission to ALWAYS be full on for administrator?

texts:
I'm looking for a module that will give the administrator permission on ABSOLUTELY everything.

Not only to retroactively give all permissions after having installed modules in the past. But also for every new module installed.

By default giving the Administrator permission to do EVERYTHING.

I have tried:

https://www.drupal.org/project/fpa

But still a lot of configuration and clicking..

Isn't there a way to click on a sigle box and set everything to ON in one shot for administrator?

I'm the only one touching the website, no collaborators, EVER ;)


texts: Drupal Views - how to show a sporting club's "longest run"?

texts:
I have a database of football games like this:

date, opponent, venue, our score, their score etc

Im trying to find a way to search the database and find the "longest run";  eg the longest winning run or maybe the longest losing run

a season might look like ( there are decades of "seasons")

win, win, loss, loss, loss, win, win, win, win, win, loss.

any suggestions?  ( have to maintain this myself so can't do php)

thanks


texts:
So I am wanting to execute some code when an order is deleted in Ubercart. In order to test hooks, I have the following code:

function loaner_uc_order ($op, &$arg1, $arg2) {

  if ($op == 'delete') {
    $sql = "INSERT INTO {testing} (text) VALUES ('you deleted order number')";
    db_query($sql);
  }

}

The problem is it is just not firing. Am I doing this right? I know the query works because I copy/pasted it into a separate area, and it worked fine. I am honestly stumped.


texts: Views: creating a hierarchy of content - am I doing it right?

texts:
This is a little complicated, but here goes:

I have a taxonomy vocabulary in a tree-structure.
I have a content type with a field of the vocabulary.
I am using the Views Tree module to display a tree of the vocabulary, and want the content to display within the tree. (Please see the illustration below).
In my view I use a relationship to add the links to the content type to the view.
animal

mammal

DOG
CAT

vegetable

flowering plant

ROSE

This would seem to me to be a fairly common thing to do. Am I doing it right? (i.e. is creating a taxonomy vocabulary and using Views Tree the best way to do this?)


texts: Redirect user/register to external user creation

texts:
I have a secondary system handling user authentication, but I would like to use the user creation code from that system instead of Drupal.  I want to redirect the Drupal user creation to the secondary system instead.

I already have my own user creation page, so I don't want to do a form_alter on Drupals user creation, I'd rather just send the user to my creation page instead.

How do I redirect user/register to my code instead of Drupal?


texts:
Is it possible to create "pages" like on facebook where one user can switch through different "pages" (profiles in my case) and write separately on each one. (or upload images, galleries etc.).

Which modules to use, how to set them up ?

Better explanation:
Think of it as myspace website where each profile (band) has bio, gallery, videos, audio etc.
I have created content types for all mentioned groups of content and using views filters and menus to sort them out for individual users (bands), but i want to make role manager, so he can manage several bands.

So for example manager has bands A B C D E and uploads image gallery and somehow tells Drupal that uploaded gallery should go to band C. Same goes with videos, news etc.


texts: Warning when adding Link to a Page (using page manager), Why?

texts:
I am using Drupal 7.
I created a page using page manager.
In the "Basic" tab I gave it a path  (didn't make it my home page): 'abcpath/all'
In the "Menu"  tab I chose "No menu entry.

then I want to structure -> Menus -> add new menu, and created new menu.
In this menu I created new link, using the same path ('abcpath/all').

Now, when I am going back to the page in page manager, to the "Content" tab, I see the following warning:

Warning: strlen() expects parameter 1 to be string, array given in drupal_validate_utf8() (line 1587 of D:\MYSITE\includes\bootstrap.inc).
Notice: Array to string conversion in filter_xss() (line 1442 of D:\MYSITE\includes\common.inc).
Notice: Array to string conversion in filter_xss() (line 1442 of D:\MYSITE\includes\common.inc).
Notice: Array to string conversion in filter_xss() (line 1442 of D:\MYSITE\includes\common.inc).
Warning: Invalid argument supplied for foreach() in drupal_render() (line 5886 of D:\MYSITE\includes\common.inc).

I checked it few times and it's always happen and defiantly because of the link.

can somebody please help here?

Thanks!


texts:
I need to log out users when the browser session is closed and users are visiting a Drupal 7 site.
I tried to modify the lines on the settings.php which calls ini_set() for session values, but it seems this solution works with Drupal 6, but not with Drupal 7.
Is there a way to solve it in Drupal 7?


texts: Disable email updates alert on expired domain

texts:
As per question, my domain already expired for over months now and im not planning on using it anymore but i keep getting the modules updates email alert coming from the domain.
How can i disable it since i can no longer access the domain to change the setting. I find its kinda weird how the domain still able to send the email.

Thanks.


texts: How to progammatically subscribe a user on edit form(user_form)using Simiplenews?

texts:
How to programmatically subscribe a user on edit form(user_form)?

I use the code below in hook_user_presave after I checked if the user is already subscribed.

$subscription_manager = \Drupal::service('simplenews.subscription_manager');
$subscription_manager->subscribe('test@email.com', 'default', FALSE, 'website', 'en');

When I go on the newsletter issues tab from Content, I did not see the newly subscribers

I have tried turning off setting Synchronize between account and subscriber fields on page /admin/config/people/simplenews/settings/subscriber.

I am using Simplenews with the 8.6.15 Drupal version.
Any ideas?
Thanks!


texts: Drupal 7 add ajax listener directly to node form

texts:
I'm trying to register an ajax listener to a checkbox on one of my standard node forms. I want to display certain regions of the form only in case, the field is checked. I can get the drupal ajax ecosystem to work, when I use it in a custom form, but I'm unable to make it work on my node forms.

First I hook into form_alter to check if I'm with the node type I want to add the listener for:

function interceptor_form_alter(&$form, &$form_state, $form_id) {
  if($form_id === 'film_node_form') {
    interceptor_dvd_listener($form, $form_state);
  }
}

Then I try to attach the ajax stuff to my checkbox, which name is field_dvd:

function interceptor_dvd_listener(&$form, &$form_state) {
  $form['field_dvd'] = array(
    '#title' => t('You want to display DVD informations too?'),
    '#type' => 'checkbox',
    '#ajax' => array(
      'callback' => 'interceptor_dvd_listener_callback',
      'wrapper' => 'checkboxes-div',
      'effect' => 'slide',
      'progress' => array('type' => 'none'),
    ),
  );
  return $form;
}

The function interceptor_dvd_listener_callback is never called. I try to print some debug information there, but nothing happens...

function interceptor_dvd_listener_callback($form, $form_state) {
  data_service_log_object($form);
}

UPDATE

After passing $form as reference to interceptor_dvd_listener the ajax callback function got called like expected. I edited my code above.


texts: Creating a content type with dynamic fields

texts:
I'm trying to create a content type where the fields are updated dynamically. For example, I could have two term reference fields: Manufacturer and Product Name. When the user chooses the manufacturer in the form, the Product Name field would only display products that have the selected Manufacturer.

Whats the best way to approach this?


texts:
Have anybody tried this?

Currently I am using Publish Content Module to Un/Publish contents, but the module doesn't support Confirmation action, if somebody hits Publish/Unpublish it just does the action straight away without asking confirmation.

I have been looking for the solution and Rules Link modules advertises it as its promo feature. Being a newbie I am not much aware of Rules power, so, any hint how could I Publish/Unpublish content with this would be very helpful.

So, far I tried by creating new Link which displays in my content type, When I click the link it asks for confirmation, but I couldn't figure out how to exactly Publish/Unpublish the content after that.


texts: $form_state->setErrorByName() for a form in a block doesn't work properly

texts:
I created a very simple module 'testform'. In this module, I generate a form and a block. (via the drush console)

The form contains a textfield ("housename") and a submit button.

In the form Class, I add a condition in the validate handler for display an error when the user submit the form without any data in the textfield.

The form from the form page (no problem)

I load the form page (url path found in the testform.routing.yml)
I click to the submit button without enter any data in the housename textfield
The next page load, the empty housename field is red and there is an error message "the housename field is empty"
=> By this way, all is ok

The form from the block (there is the problem)

I load a page where is displayed the form block
In the block, I click to the sumbit button without enter any data in the textfield
The next page load, the empty housename field is red and there isn't any error message

If I reload the page, the setError message appears

I don't understand why when the form is displayed in a block, the error message doesn't work properly.

This is the code I am using.

The modules/custom/testform/src/Form/DefaultForm.php file

<?php

namespace Drupal\testform\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Class DefaultForm.
 *
 * @package Drupal\testform\Form
 */
class DefaultForm extends FormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'default_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['housename'] = [
      '#type' => 'textfield',
      '#title' => $this->t('housename'),
      '#maxlength' => 64,
      '#size' => 64,
    ];

    $form['submit'] = [
        '#type' => 'submit',
        '#value' => t('Submit'),
    ];

    return $form;
  }

  /**
    * {@inheritdoc}
    */
  public function validateForm(array &$form, FormStateInterface $form_state) {
    $housename = $form_state->getValue('housename');
    if(empty($housename)){
      $form_state->setErrorByName("housename","The housename field is empty");
    }
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    // Display result.
    ksm("Work...");

  }

}

The modules/custom/testform/src/Plugin/Block/DefaultBlock.php file

<?php

namespace Drupal\testform\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Provides a 'DefaultBlock' block.
 *
 * @Block(
 *  id = "default_block",
 *  admin_label = @Translation("Default block"),
 * )
 */
class DefaultBlock extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    return \Drupal::formBuilder()->getForm('Drupal\testform\Form\DefaultForm');

  }

}


texts: How to retrieve "profile_" only filelds?

texts:
Now I load user profile fields of a $uid  by:

$thisuser = user_load(array('uid' => $uid));
profile_load_profile($thisuser);
drupal_json($thisuser);

Is there a quick way to filter only fields with leading profile_ in $thisuser and so drupal_json displays only profile values?


texts: How do I resolve the "Argument 1 passed to drupal_attributes() must be an array" error on my system_settings_form()?

texts:
I don't usually post specific questions like this, and ask for help on a specific issue but I am at the end of my rope wasting time way...

I have a simple D7 module as seen below, when I load the page (who's menu item is exactly where I want it to be) I get the following error:

  Recoverable fatal error: Argument 1 passed to drupal_attributes() must be an array, null given, called in /path/to/site/public_html/includes/form.inc on line 3106 and defined in drupal_attributes() (line 2257 of /path/to/site/public_html/includes/common.inc).

as you can see the form declaration itself is very simple, and everything runs peachy keen until the page load.

note, that I have looked at: 3106 in form.inc and the $element is populated but attributes doesn't exist - what am I missing???

<?php
/**
 * Implements hook_menu().
 */
function attach_images_menu() {

    $items['admin/structure/types/manage/%/attach/images'] = array(
        'title' => 'Attach: Images',
        'page callback' => 'attach_images_settings',
        'access arguments' => array('access administration pages'),
        'weight' => '10',
        'type' => MENU_LOCAL_TASK,
    );

    return $items;

}

function attach_images_settings() {
    //$content_type = arg(4);
    $form['attach_images_amount_'] = array(
         '#type'   => 'textfield',
         '#title'  => 'Amount',
         '#default_value' => variable_get('attach_images_amount_',1),
    );
  return system_settings_form($form);
}

?>


texts:
I have a blog section on a bilingual page that I'm working on and I'd like to show the total number of comments below each teaser. Not to confuse users, the total should be total number of comments for the language that user is in. So, let's say if I have Spanish and English version of the website. If the user is on English, it should only show total number of comments in English not the grand total. Likewise, if the user is on Spanish, it should only show total number of comments in Spanish. Right now, it shows grand total and confuses users. How do I resolve this issue? Any help would be appreciated.

Drupal 7.x


texts: How to show a different product variation other than the default one on page load ( ajax trigger )

texts:
I have a node display for more than one product variation. Normally the user has to select one of the variation options by selecting them from the drop-down list which rebuilds the node display via AJAX.
Now say for instance that I want to link one of the product variations from else where. If I simply link www.example.com/node/10 the default product variation will be displayed which might not be the one I would like to present to the user.

So I probably have to send a query parameter in the URL, for example www.example.com/node/10?product_id=15, and trigger the AJAX event programmatically in my custom module.


texts: Alternative to libraries_get_path() to get a JavaScript file path

texts:
I was crafting the following code in order to alter the path to a JavaScript file.

function MY_MODULE_js_alter(&$javascript) {
      $sm_path = libraries_get_path('soundmanager2'). '/script/soundmanager2.js';
      $javascript['sites/all/libraries/soundmanager2/script/soundmanager2-nodebug-jsmin.js']['data'] = $sm_path;
      }

It works fine, but the only thing that bothers me is that libraries_get_path() is provided by the Libraries API module. Is there an internal Drupal 7 function to act the same way?


texts: When displaying a taxonomy term, how can I also display the teasers of all the child terms of the current term?  I still want to display all the content and fields of the current node, but also display the child teasers.


texts: Display Nested Content Type References In D8

texts:
I would like to know how best to manage a content type having 1:n parent-child relations in Drupal 8.

I need to display a view of the relationships. Although in theory unlimited I anticipate the depth will not exceed 4 generations.

As shown in my diagram below, C is a child of B. D & E are children of C etc:

-instanceA
-instanceB
--instanceC
---instanceD
---instanceE
----instanceF
...

I presume entity reference is the way to go. From my limited D6/7 experience I prefer having a parent ref on a child (having unlimited child inline entity references can seem confusing to my less web savvy users - a single parent from a drop down select is clearer). Although I am happy to be convinced otherwise if other factors outweigh this.

This stack exchange answer suggests the Views Tree module might have worked but it does not seem to be porting to D8.

I think waiting for the Views Field View module to be ported to D8 might provide a solution but this seems overkill.

This is such a basic need I suspect in my lack of experience I am missing a simple solution. Any suggestions how best to approach this appreciated.


texts: How to have the autocomplete option with ajax in a text field?

texts:
I am struggeling with creation of tetxfield with autocomplete option for my Drupal 8. My Drupal website is multilingual, and on one view page we present some content in Default language, by typing in the textfield some other language, I need to change the language of the content. For this I created a filter (Translation language = Content language selected for a page), and I want to expose it in a custom block.

My custom block looks like following:

<?php
/**
 * @file
 * Contains \Drupal\filters\Plugin\Block\FilterLanguages.php
 */
namespace Drupal\filters\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * @Block(
 *   id = "block_filters_languages",
 *   admin_label = @Translation("Filter for languages"),
 *   category = @Translation("Filters"),
 * )
 */
class FilterLanguages extends BlockBase {

  /**
   * {@inheritdoc}
   */

public function build(){

$form['language'] = array(
  '#type' => 'textfield',
  '#placeholder' => t('Choose language autocomplete'),
  '#autocomplete_route_name' => 'filters.autocomplete',

);

return $form;
  }
}

To provide autocompletion option, I have created routing file:

filters.autocomplete:
  path: '/filters/autocomplete'
  defaults:
    _controller:'\Drupal\filters\Controller\AutocompleteController::handleAutocomplete'
 requirements:
    _access: 'TRUE'

And Controller:

namespace Drupal\filters\Controller;

use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Controller\ControllerBase;

class AutocompleteController extends ControllerBase{
  /**
   * Returns response for the autocompletion.
   */
  public function handleAutocomplete(Request $request) {

    $languages = \Drupal::languageManager()->getLanguages();
    return new JsonResponse($languages);
  }
}

I have oriented on the followin tutorial
But the autocompletion still doesnt work. Could you please help me to solve the problem?


texts:
I have two content types, one called Task the other called Task List. Task List uses entity reference field to let users create multiple lists of any Task on the website. I'm using the entity reference module versus flags because I want the user to add addition content to the Task List page.

I'm looking for a way to let users, while on any task page (especially other user's tasks), add that task to any Task List they've created.

So essentially click "add" on a Task page which would then display a list of the user's own Task Lists. Then select one of their lists which would add the Task to the Task List's entity reference field.

Thanks for any help!


texts: How can I print a block (the language switcher) without the block-related classes?

texts:
I'm not sure if this question is phrased correctly; I'm happy to accept any solution that accomplishes my aim.

GOAL: I am trying to print the language switcher block in the header of my theme without the block-related classes, because the theming for these classes assumes that the block will be printed in the main content area of the page.

Usually, I've been adding the language switcher block as a widget using the Panels module.  When I do this, no block-related classes are printed, and it's much easier to style the CSS.  However, I can't add the widget in the header because I'm not using Panels Everywhere and Panels only overrides the main content area of the page.

I looked in locale.module and tried calling the block directly via local_block_view(), but this still adds the CSS classes that I don't want.

Is there a way to print the block without the block classes?  Or, barring that, how can I remove the classes for this specific block?


texts: How do I hide bulk operations form for a specified user role?

texts:
I have a view where I list user's own contents, this contains bulk operations. Users with "add article" permission can see this bulk operations thing but I would like to hide this bulk operations "form element" / "functions" for users in employee role.

How can I do this?


texts: How can I create a block to register a user as a specific role?

texts:
I would like to have a block that would display the standard user registration form but will register the user to a specific role (i.e. "Customer").

I'm thinking about making a block and using some php to get the form I need, display it, and add on the user's role before it is submitted.

I've been tinkering for a little and can't seem to accomplish this. Could anyone help me out with the php I would need to do this?

Thanks


texts: How to edit image field output from template

texts:
My goal is to edit the output of a specific field in a view.

There is an image field, and I would like to specify how it is output. So that instead of

I can output something like

I'd like to be able to edit the output freely and just have access to the image path for this specific view.

I am currently editing

views-view-field--com-retheme-home-news--field-image.tpl.php

However I'm not sure how to actually access the path to the image. Using

<?php print $output; ?>

Only prints out what it would have before.

I understand that I could change the field itself to only present the path, however that isn't an option since there is already a lot of content taking advantage of how the field is already setup.


texts: node gets wrong internal path - translations

texts:
its a bit twisted, but to describe the situation:

whe have a multilingual site but you don't select by language rather by country. (you've for instance BE-FR in your path and not simple fr)
and since there is not a translation for every country, there is also a global english fallback.

now the problem is:
I switch the site language per language dropdown on the frontpage and get redirected to the according frontpage in the other language, but:
on any node link I try then (like further menu items) I only get >>page not found<<
it tries to reach www.example.com/be-fr/nid but the according node lies under www.example.com/en/nid even tough the language setting at the node itself is clear on be-fr.

so the question is how drupal constructes its path. what hooks are there we can look into to find the problem?

hope someone can help us, any clue appreciated!


texts: Creating views or facets search with multiple flags

texts:
So I'm categorising with flags and I will have over 20 per node so that multiple people can flag a node with their opinion... Searching for the past two weeks I have found it hard to work out how I put these flagged results on to the front end, in search, making multiple flag recipes (to show to searchers), with views?

My first question is, do I have to make a view for every single flag I have on the front end? There are over 20 of them, I don't mind doing this but can't this be put in to an exposed view or something so I can have one view with all outputs covered?

How can I mix up certain flags together/make recipes so that if I wanted three certain flags together so that people can search through that output I could, can I do this in views with flags?

My final question is, how do I put the output of a search or a view I make and make it sortable by how many times that node has been flagged with that flag or combination of different flags? If someone wants to see the nodes all flagged with 'river' and that the nodes that come to the top of the search/output/view has had it's 'river' flag flagged by more users than those below it. This will show that that node is definately more 'river' than the other ones.


texts:
I'm trying to get the exposed form to show up for one of my views, but it doesn't seem to be working.

I've got filters exposed in the "Filter Criteria" section, the "Exposed Form In Block" section is set to "Yes", and the block itself has been activated and placed into one of the sidebars, but its still not showing up.

Am I forgetting to do something here?

Edit: Forgot to add that I'm using Drupal 7

Edit 2: Found a post that says to turn Ajax on to get the form to display, but that doesn't work either.

Edit 3: So turning off the "Exposed Form in Block" option gets the filters to display, but for theming purposes I really need this stuff in a block.


texts: Make a field mandatory on workflow transition

texts:
I'm using workflow 7.x.2.x module and I want to make some fields mandatory during a transition.

Can anyone please help me with the ideas.


texts: field_attach_update stopped working - how to debug this?

texts:
I am using this simple code:

$order = commerce_order_load($order_id);
$order->status='completed';
field_attach_update('commerce_order', $order);

To update the status of order to completed.

This code use to work but does not work anymore (the order status is not updated).

How to debug this ?

UPDATE:

Using :

entity_get_controller('commerce_order')->resetCache(array($order->order_id));

Does not work neither.


texts: Drupal commerce: there is a way to apply discount to products with some taxonomies elements?

texts:
I would like to know if there is a way to apply discount to products with some taxonomies values, something similar to "bulk views operations" Or another way where a non developer or not a site-builder it's able to create new discounts.

Thanks

Oskar


texts: Getting error on editing content types: /admin/structure/menu/parents 403 (Forbidden)

texts:
I'm getting errors on editing any content type. Chrome tools reveals that one of them is as follows:

POST http://mysite.local/admin/structure/menu/parents 403 (Forbidden) jquery.js?v=1.4.4:142
c.extend.ajax jquery.js?v=1.4.4:142
Drupal.menu_update_parent_list menu.admin.js?mv8h6q:27
(anonymous function) article:101636
(anonymous function)

I tried this but no change: https://drupal.org/node/1633130

I'm wondering if this pertains more to jquery than anything else. Any thoughts?


texts: Remove "required" status from the Date field

texts:
I have a field that is currently marked as required.  However, I want this to be required for all roles but the Admin.  I've made a module that implements hook_form_alter(), and I have been able to remove the required status for all fields but the Date fields.  Any idea what settings I need to change?

Also, I've tried altering it in hook_form_alter(), as well as doing it in the '#after_build'. I had no luck there either.


texts:
I am currently trying to implement a tooltip using the jQuery extension, qTip2. I have installed both of the files included in the extension (jquery.qtip.min.js and jquery.qtip.js in my /theme/js/ location, and their appropriate CSS sheets in /theme/css) and declared them in my theme's .info.

At the moment, I'm trying to write a function that displays the tooltip "Hello World" whenever someone hovers over an element of with the attribute #T6roll. I have the following as a script in my /sites/js/ location:

Drupal.behaviors.magds = function (context) {
  // Sounds, if using class "sound", these "#T1roll, #T2roll, #T3roll, #T4roll" can be removed, ul.dropdown li a,
  $('ul.links li a, .sound, #T1roll, #T2roll, #T3roll, #T4roll').mouseover(function(){$.fn.soundPlay({url:Drupal.settings.magds.themeAbsolute+'flash/mouseover.wav',playerId:'embed_player',command:'play'});$("#sound").html("mouseover.wav");}).mouseout(function(){$.fn.soundPlay({playerId:'embed_player',command:'stop'});});

  // IE helpers
  if ($.browser.msie && ($.browser.version < 8)) {
    $('#main-menu li').hover(function() {
      $(this).addClass('hover');
      }, function() {
        $(this).removeClass('hover');
    });
  };
};

/*
 * implements jquery.qTip.js
 */

 (function($){
    $(document).ready(function() {
        $('a#T6roll).qtip({
            content: 'Hello World!',
            position: { target: 'mouse'}
        });
    });
 })(jQuery);

However, the site does not seem to be executing this. Is there any ideas as to what might be the cause of this? At first, I thought that it might be the qtip syntax, but I kept it as simple as can be to debug and it's not functioning.


texts: Need to create two views having same content type and title

texts:
I have one content type with the name gallery and uploaded all the images using that content type in different nodes. Now i have two basic pages having views for 2010 and 2011 gallaries.
While i am using views i have differentiated that views using content-title(filter criteria).
Now the problem is the title is same for 2010 and 2011. While i am trying to use one in 2011 gallery using title it is taking from 2010 gallery itself. How to solve this ?


texts:
I have used the webfrom model and webform localization for translate it ,
i have translate it correctly after a few days the webform translate is dispersal , when i have refresh the string the translate is come back , But now the translate does not appear any more , i have refresh string and  try to translate it but without any benefit how i can fix it to take the translate...


texts: Integrity constraint violation occurs when uploading file in webform

texts:
I watched it happens when trying to upload a specific file with the name "קורות חיים.docx", it happens to any visitor how try to upload a resume file with the exact same name in a webform.

this is the error message:

An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /file/ajax/submitted/cvfile/form-HbzcUMPLqQmPttwZ8m5o_NPx-9dhMVALHpji_ckOO3g
StatusText: n/a
ResponseText:
Username *
Enter your ידידים למען הנוער והחברה username.
Password *
Enter the password that accompanies your username.
Error               The website encountered an unexpected error. Please try again later.
Error message
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://webform/cv/קורות חיים_158.docx' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri, filemime, filesize, status, timestamp, type) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array
(
[:db_insert_placeholder_0] => 0
[:db_insert_placeholder_1] => קורות חיים.docx
[:db_insert_placeholder_2] => public://webform/cv/קורות חיים_158.docx
[:db_insert_placeholder_3] => application/vnd.openxmlformats-officedocument.wordprocessingml.document
[:db_insert_placeholder_4] => 12968
[:db_insert_placeholder_5] => 0
[:db_insert_placeholder_6] => 1431424601
[:db_insert_placeholder_7] => default
)
in drupal_write_record() (line 7239 of /home/yedidimorg/public_html/includes/common.inc).

ReadyState: undefined


texts: Displaying page execution time using devel

texts:
How is it possible to use devel module to show Page execution time on a site? I enebled it and it shows numbers only on admin pages.
Thank you for help.


texts: How to add more condition to my conditional field

texts:
im trying to add condition to my fields but it seems it can only accept 1 condition.

example : i have 1 select field for salutation(Mr., Ms., Mrs, Dr., etc) and 1 radio field for gender. if i select Mr. on the select field, the radio will automatically check Male button and other wise. if i select like Dr., Prof. or etc, the radio button will uncheck both button.


texts: Remove field attributes using hook_form_alter()

texts:
How do I remove form element attributes from a form using hook_form_alter()?
For example, given the following HTML markup, how do I remove form-text?
<input type="text" class="form-text required" maxlength="255" size="60" value="" name="title" id="edit-title">


texts: how to add taxonomy terms to admin/config/people/accounts/fields programmatically?

texts:
I know I can use the UI at admin/config/people/accounts/fields to add existing taxonomy fields.

But I want to create them automatically using my module.

I know I can use hook_enable() or hook_install() for this but I don't know which hook or function I need to use to make the field show up in admin/config/people/accounts/fields ( and on the user edit / registration page )

I've read somewhere something about a bundle but I'm not sure if I'm looking in the right direction there.


texts: Webform: File upload - rename files feature

texts:
So in webforms module, there's a checkbox to Rename files.    The File Name pattern text field.    What are some examples on what to use?

I noticed that I put in a text string "fileupload" and it didn't change the files that were uploaded.   It just kept the original file names.