texts:
I'm in the process of porting my contrib module from Drupal 6 to Drupal 7, and I'm getting a little stuck with how I should got about using db_query() in Drupal 7. I know it now uses a similar syntax to PDO, but I'm not quite sure how to translate the following line from the Drupal 6 version of the module:

if ($result = db_query('SELECT name FROM {variable} WHERE name LIKE "%%%s%"', 'csm_node_temp_')) {
while ($array = db_fetch_array($result)) {
  $variables[] = $array['name'];
}

}

This code removes all of the variables that my module has added to the variable table; i.e., all variables with names that start with the string "csm_node_temp". How should I rewrite these lines for the Drupal 7 version of my module?


texts: How do I create a time range form field?

texts:
Is there any way to add time range input fields in a form, for example using code similar to the following one?

$form['notification_hours'] = array(
  '#type' => 'time_range', // type time_range doesn't work
  '#title' => $this->t('Notification hours:'),
  '#default_value' => $config->get('ecc_general.notification_hours'),
  '#description' => $this->t('what are the hours that messages should not be sent?'),
);

I have tried the Time Range and and Time Field modules. I'm able to add the time range field, but I failed to programmatically create it.


texts: Get Field Manage Display configuration in node preprocess

texts:
I am preprocessing the data and I have overridden the node template, during the preprocessing I am not able to figure out how can I respect "Manage Display" configs. As an example if date field is configured to have a specific format, or image field is configured to have specific Image Style.

So my question is how can I call the Manage Display configurations during node preprocessing.


texts: How does drupal.org save users' locations?

texts:
On Drupal.org, when you go to the user profile edit page, there is an option:

Save my location

Your location will be saved and may be shared.

How is this implemented?  Is this through a contributed module(s), or is this something specific to d.o?


texts: How to create a custom Date Formatter for grouping in Views?

texts:
I have a view of content type "event". One of the fields is a category of the event which is a taxonomy list and i have a field for the date and time the event takes place.

Now i have set up the view showing the events in a time period i can set through an exposed filter, grouping the events by their date-field (nr.1) and as a second group field by the category (nr.2).

I am sorting this view with the event-field (ascending) as the first sort criteria and Taxonomy term: Weight as the second sort criteria.

It works as designed, but every event that shares the same time on a given date creates an own group row:

Like this:

Category-Name

4/12/2013

Event1 12.00h
Event2 12.00h

4/12/2013

Event3 13.00h

4/12/2013

Event5 14.00h
Event6 14.00h

What i want to achieve is this:

Category-Name

4/12/2013

Event1 12.00h
Event2 12.00h
Event3 13.00h
Event5 14.00h
Event6 14.00h

Question: is it possible to have a formatter that has stripped out the time, so i can group by date only?

Of course i tried a custom display formats for the date beforehand, but this doesn't affect the grouping.

EDIT: the hint about the RDF module helped partly with this issue. I could remove the extra markup in the date field. Nevertheless the sorting of the date field still takes the time of the event into account. There's another sorting i didn't mentioned in the first place, cause I didn't expect it to be relevant.

The location of an events is referenced as entity and also added to a row of an event and sortet by title (asc). Now the date-field is superceding the title of the location, because the event-time is still taken into account.

I had started another question on this other issue, but actually think it belongs here. I still need to strip out the time somehow...


texts:
I am trying to migrate a Drupal 7 site to a Drupal 8 site. I already created my module for migration and I have a content type that has a title, field_picture and a field_text in Drupal 7.

I want to migrate it to Drupal 8 where field_text = field_description and field_picture is field_image.

I tried the following:

id: drupal7_fruit
label: "Test migration"
migration_group: drupal7
source:
  plugin: d7_node
  node_type: fruit
process:
  nid: nid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: und
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp
  field_description: field_text
  field_image:
    plugin: iterator
    source: field_picture
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
destination:
  plugin: 'entity:node'
  default_bundle: fruit
migration_dependencies: {}

I could migrate description and title, but the image is never migrated.

What am I doing wrong?

EDIT

migrate_plus.migration.drupal7_fruit.yml

    id: drupal7_fruit
label: "Migrate Fruit Content Type"
migration_group: drupal7
source:
  plugin: d7_node
  node_type: fruit
process:
  nid: nid
  vid: vid
  langcode:
    plugin: default_value
    source: language
    default_value: und
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  promote: promote
  sticky: sticky
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp
  field_descricao: field_body
destination:
  plugin: 'entity:node'
  default_bundle: fruit
  migration_dependencies:
    optional: drupal7_image

migrate_plus.migration.drupal7_image.yml

 id: drupal7_image
label: Images
migration_tags:
  - Drupal 7
source:
  plugin: d7_file
  constants:
    source_base_path: ''
process:
  fid: fid
  filename: filename
  source_full_path:
    -
      plugin: concat
      delimiter: /
      source:
        - constants/source_base_path
        - filepath
    -
      plugin: urlencode
  uri:
    plugin: file_copy
    source:
      - '@source_full_path'
      - uri
  filemime: filemime
  status: status
  created: timestamp
  changed: timestamp
  uid: uid
destination:
  plugin: entity:file

Edited my question because @Berdir in the comments said that images or files must have a different migration file but still can't migrate images. I restored my D8 site database to start all from scratch.


texts:
My website is running on Drupal 7.34. When I tried to update it into recent Drupal update 7.71 my URLs are not working (404 error).
The actual URL is https://example.com/content/product-category/pneumatic-accessories?section=buy but when I have done update the URL is like this https://example.com/content/Root_DirContent/product-category/pneumatic-accessories?section=buy the page returns a 404 error.

Please guide me what is the issue and how can I solve it.

Note- Due to this error I revert back to my previous version.


texts:
I want to login to drupal site from another site ( both site hosted on different server)

This is html form to login to drualsite.

<form id="sso_form" method="POST" action="http://www.drupalsite/user/login">
  <input type="hidden" name="name" value="username">
  <input type="hidden" name="pass" value="password">
  <input type="hidden" name="form_id" value="user_login">
  <input type="hidden" name="op" value="Log in">
</form>

submitting form using javascript.

But this is not working for me.

Any idea or another way to do it?


texts: How to display specific button for certain user?

texts:
I have a simple Drupal 7 page with 3 buttons. Page is only accessible by logged-in users.
I have 3 roles - role 1, role 2 & role 3
What I would like to do is to show only button 1 when a user with role 1 logged in, hide the other 2.
How can I achieve this, please?


texts: How to store your own key-value pairs in Redis using PhpRedis with D7 Redis module

texts:
We have the D7 Redis module installed, which is being used as the cache mechanism for D7 caching. That module uses PhpRedis as the underlying library.

I would like to use that same Redis instance to cache a large amount of non-Drupal data that is retrieved from an external API, then will be rendered on a specific Drupal page. I'm wondering how I can get ahold of the Redis object instance that Drupal is already using, so I can use PhpRedis functions like $redis->set(key,value)?


texts: How to add more information about authors with the Bibliography module?

texts:
We are setting up a bibliography for old and very rare resources with Drupal 7 and the Bibliography module. We need to have more information about authors (picture, biography, nationality). We have seen that we could link authors to users but in our case authors don't require to have a real user account (because most of the time authors are dead).

My questions:

How can we add more information to authors?
Is it possible to create some kind of user account without login, password and e-mail ?
Would it be possible to create a specific content type for authors (with fields for picture, biography and nationality) and link it to the biblio author, and in that case how could we do this?


texts:
I have a problem with this code in node.tpl.php

<?php if (isset($node->field_image[$node->language][0])): ?>

    <a href="<?php print $node_url ?>" title="<?php print $node->field_image[$node->language][0]['title'] ?>">
      <?php print theme(
        'image_style',
        array(
          'style_name' => 'teaser',
          'path' => $node->field_image[$node->language][0]['uri'],
          'alt' => $node->field_image[$node->language][0]['alt'],
          'title' => $node->field_image[$node->language][0]['title'],
          'attributes' => array(),
          'getsize' => false
        )
      );?>

<?php endif; ?>

I know above code work if language natural, but my website is bilingual.
How can i solve this problem.


texts: Form display: How to move fields into the advanced group?

texts:
How can I move a field in a node edit form from the main region into the advanced/secondary group region in the right-hand column?

This question asks how to move elements out of the secondary group into the main group, but this is the inverse.

I tried setting a group for my field in a similar way to the above answer:

$form['field_article_language_filter']['#group'] = 'advanced';

This did move it, but I'd like it to be in a group with a summary arrow button to toggle it closed or open.


texts: Render a map with multiple markers from search results in GetLocations

texts:
I have a simple view that uses "Filter criteria" to display nodes of a specific content type filtered by whatever the user types - that's all good and working.

My issue is that every nodes has a GetLocations field that stores an address, and I'm trying to output a map that includes all the markers of the results at the top of the page.

I think I need to have a separate view that loads all the nodes found in the search view and prints the map, but I couldn't get it to work using Contextual Filters.

Any hint?


texts: create a custom form based on user fields

texts:
I created  new menu item witch I want to insert a custom form to edit some user fields :

$items['user/%user/edit-custom'] = array(
        'title' => 'Knowladge',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('user_profile_form_custom', 1),
        'access callback' => 'user_edit_access',
        'access arguments' => array(1),
        'type' => MENU_LOCAL_TASK,
    );
    return $items;

Then the custom function that return the form :

function user_profile_form_custom(){
    module_load_include('inc', 'user', 'user.pages');

    global $user;
    $user = user_load($user->uid);

    $form = drupal_get_form('user_profile_form', $user, 'account', 'custom');

    return $form;
}

When visiting "user/%user/edit-custom" page I can see the profile page, then with some logic code in hook_form_alter I can hide some fields and show up only needed fields...

But the problem that I can't save the form, I get this error :

  Fatal error: Call to undefined function user_profile_form_validate()
  in path_to_drupal/includes/form.inc on line 1514

this solution is inspired from answers described in this post .

Have you any idea please how to solve this, or if you have another way to get some user fields, edit them in a custom page, and save the changes.

Thanks in advance.


texts: Node reference list based on node filtered by group membership

texts:
I have a content type called, "Class Templates" that needs to be able to reference one or more nodes of its own type as a prerequisite list for the classes.
The catch is that I'm using the Organic Groups module to divide up the users into clubs; each club admin will create their own class templates for their clubs use only.

I need to show, to the club admin, only the class templates that are associated to their own club/group, and not all class templates as it is currently happening.

I'm assuming I need a reference view to do this, but I'm buggered if I can figure out how I need to configure it.

UPDATE: I've figured out how to do it via hook_form_alter() and it's just as easy as I'm writing modules as is.  I'm still interested in a way to do this via views/references but I'm working on a timeline so I'll have to push ahead this way for now.


texts:
I try to implement this simple js tooltip script on drupal 6 site.

http://jsfiddle.net/wrN2u/50/

$(document).ready(function(){

$('#container').on('mouseenter', '#radiobtn', showBox);
$('#container').on('mouseleave', '#radiobtn', hideBox);

function showBox(e){
var x = e.pageX + 20;
var y = e.pageY + 20;
$('#hoverbox').fadeIn();
$('#hoverbox').offset({ left: x, top: y });
}
});
function hideBox(){
$('#hoverbox').fadeOut();
}

However, the framework is 1.8.2
The script is not working under 1.3.2 which uses drupal 6
Can somebody help me with js code for 1.3.2?

Thank you very much


texts: Restrict node to be shown only in a view and not by its url?

texts:
I created a node which has an entity reference to select a user. Then, I created a view to show the node only to the user referenced in the node.

This works fine, but the problem is that the node can be viewed directly through its URL. I need to restrict the node to be only shown through the view and not by its URL.

How can I do this?


texts: Update node alias while retaining the old alias

texts:
I want to update many of my node's aliases. I have seen many questions here at Drupal Answers, but nothing I can use, as far as I can see.

What I want to do: I want to update a big portion of URLs (mostly forum nodes) to a new alias and still keeping the old aliases. I can do this by using VBO. However, when I update the URL alias using VBO, all forum nodes as well as other nodes will get the "Has new content" marker saying "updated". I want to avoid the nodes getting this "updated" marker since I have around +10,000 nodes.

I have looked in Rules trying to figure if there is I way I can set the nodes to being marked as "read" when I update the URL alias, but I can't see a way to do this.

The reason I'm not just deleting all aliases and then bulk generate them again, is that it won't keep my current aliases thus giving me many 404 errors in the future.

Is there a way to update the node's alias and still keeping the old alias and not having all the nodes marked as "updated"?


texts: Deleted the Content Type now cannot delete or edit node of that type, but it is visible on site

texts:
I have a node that I can see on my site, but when I try to edit it I get the error:

Notice: Undefined index: my_node_name_node_form in drupal_retrieve_form() (line 763 of /home/sites/my-site-url/includes/form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'my_node_name_node_form' not found or invalid function name in drupal_retrieve_form() (line 798 of /home/sites/my-site-url/includes/form.inc).

I cannot see the node by going to 'content'.

I believe that what has happened is:
I deleted a Content Type that was redundant on my site without realizing that there was a node of that type on the site. I guess that now the node doesn't its content type this is stopping it from being deleted.

I would like to know how to delete this node, or failing that unpublish it.

I know the NID of the node to be deleted.

I guess that one way of doing this would be manually using phpmyadmin. For this approach I would need some guidance on how to go about this as I am not very familiar with either how nodes are spread across the tables in the database or working in phpmyadmin.


texts: How can I create a bulk node creation interface?

texts:
I have a request for an interface where nodes with a small amount of required fields (for example, a title, date, and a node reference) would be able to be created in bulk on one screen.

I am imagining some kind of editable table view/grid with each row representing an individual node.

What would be the best approach to implementing something like this?


texts: $(...).accordion not a function error in drupal7 views accordion module

texts: I had enabled a views accordion for a field in view. On displaying it in a page its not working and I got an error "$(...).accordion is not a function". Can any one help me in solving this?


texts: How to print user role in body profile page

texts: I've got two roles in my website and I'd like to print the role name in the user profile page body classes for the user being viewed. How can I do this?


texts: Is there a function in Drupal Commerce which could perform a buying of a product programmatically?

texts:
For example, I need to perform a purchase of some product by some user programmatically. That as, I call a function having passed papameters such as user_id, product_id and price. By the way, this price can be different from price assigned before.

And after execution of the function it would be considered that the user has bought the product.

For example, a e-shop sells access to some files and salesman wants to gift access to some file to some user upon the occurrence of some event. for example, user's birthday. And in this case this function with params user_id, product_id and price=0 could solve the problem.

Or these problems are solved by another way ?


texts: JS Resize function for div containing a a slideview slideshow and set as a page background

texts:
This is for a drpal 7 install.

Is there a way to apply the same function they discuss in this thread

https://stackoverflow.com/questions/10373349/height-and-width-of-background-picture-adapt-to-each-screen-size

to a whole div instead of a single image? For example, I have a drupal 7 install. I'm using skeleton theme. I have been requested by the client to have a full screen images slider as a the background in the homepage. I have given the images a 1680px Image style and calling the block from a custom template file for the front-page with $ block = module_invoke. That's aright but, it obviously doesn't adjust to screen res. If I give the div one of the skeleton's css classes, the whole layout gets messed up.

I'm trying to find an alternative via custom js.

Is that possible to achieve the same behaviour as in the demo in the link, for the slideview block?

Demo- http://so.devilmaycode.it/height-and-width-of-background-picture-adapt-to-each-screen-size/

If so, please indicate how to add the js to the code, where and how. Thank you!


texts: Has there been any work to get SmugMug to work on Drupal 7? I am about to move forward on developing a solution, but wanted to check before I went forward. I do know there was some to work with MediaWorks, but that is a bit of a limited solution and was developed for Drupal 6.


texts: Does any one know a good module I can use to set a nice popup (supporting html) on the front_page when a user visit the website for the first time??


texts: How to prevent views from loading the results upfront

texts:
I have views block with exposed filters and ajax enabled which was rendered in home page, the problem is when the block is loaded with exposed form views is loading the results too. However I want the results needs to be shown only when the user clicks on the submit button.

If I enable input required, this will work, but the client doesn't want this.


texts:
I am trying to create a Rule set which has 4 Rules under it. Using this Rule set as an action in a Triggered Rule. I want that when any of the these 4 Rules is True, the action is triggered.

But looks like the Rules under Rule Set is assigning them AND condition. How can I set it to OR condition.

I have tried changing the logical operator to Or for each group. But that is not working.

Am I missing something, or this feature is not a part of Drupal 6?


texts: Hook to log results of calls to drupal_mail() made by other modules?

texts:
How can I get the success/failure response of drupal_mail() generated by another modules?

hook_mail_alter() doesn't return success/fail and drupal_mail() is only helpful if the message is coming from my module.


texts:
I recently inherited a legacy project that I've been trying to work with. I defined a custom menu using the menu hook but it looks like anonymous users can't access that menu and instead gets redirected to the user login page. This is a fairly large project and I'm trouble figuring out where exactly the call is intercepted and redirect. Any help would be great.

This is what the redirected looks like if it helps: localhost/user?destination=results

function test_results_menu() {
  $items = array();
  $items['results'] = array(
    'page callback' => 'display_test_results',
    'access callback' => 'test_results_resource_access'
  );
  return $items;
}

function test_results_resource_access() {
  return TRUE;
}

function display_test_results() {
  //  TODO Display results
  return "hi";
}

Update: The odd thing for me is that the project also recently got a rest endpoint using the services module which allows anonymous users to see the data there.


texts: Let custom module access private files via file_get_contents

texts:
I have a custom module (Drupal 7) where I want to read the contents of a file using file_get_contents($file) in the private directory. Theres a access denied error, as the module accesses as anonymous.

I can access the file via browser via the url created with file_create_url(), but gain no access from my module.

Is there a way to grant my module the permission to open files?
Any other ideas are welcome, too.

Thanks, Marc


texts:
Here I want to fetch the nid of matching child term id from my content type product_categories.

I used the below code.

$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->entityCondition('bundle', 'product_categories');
$query->propertyCondition('status', 1);
$query->fieldCondition('field_product_sub_cat', 'tid', $child->tid, '=');
$result = $query->execute();

I execute the above query and it displays correct results.But now I want to fetch the nid, I used below code but its not working.

 $childnid = $result->nid; //Area to explore
//print "<pre>"; print_r ((int)$childnid);
print $childnid;`

can anybody please help me ??


texts: How do I add Custom fields to the Order Information Checkout page in Commerce 2?

texts:
I would like to add a set of additional fields to the order summary so after a user adds a product they would need to fill out some conditional fields of information alongside their billing information.

Drupal Commerce 2 documentation is pretty lacking at the moment and I am expecting to change the YAML files to add new fields. However, there seem to be various places to add new fields but nothing is showing up as additional fields on the order summary page.

What are the steps to add new fields?


texts: Adding an HTML data attribute to rows in Views

texts:
I've tried rewriting the row and also theming the Views row, but I'm not having any luck. Maybe I'm doing something wrong.

I have the format of my view as 'Unformatted View', and in the format settings there is an option to specify the 'Row Class', which is then added to each row. However, I need to add a data-attribute to my rows in addition to a class. The data-attribute needs to be one of the fields - the Taxonomy Term name field (in lower case).

For instance, my field is Taxonomy Term Name. Currently, the HTML markup of each row looks like this:

Term

However, I need it to look like this:

Term

I am finding this fairly difficult to accomplish, and can't find much about it online. Could anyone be of help?


texts: Rule to create a Node from a Webform Submission

texts:
Using Rules with Webform Rules enabled, how would I make a new node after a webform submission and use the submitted values as field values in the node?

In short, how do I turn webform submissions into nodes using Rules.

I've set up the Rule like this:

Where do I go from here? I can't seem to find a way to move webform submission values into the node's fields.

Please note: I have read "Using webform rules to create node after webform submission" and "How to create a node with submissions of a webform?". Unfortunately, neither address my question.


texts: How do I modify the "Formats" dropdown in CKEditor

texts: The CKEditor in Drupal 8 has a Formats toolbar button containing different text formats: "Heading 1", "Heading 2" etc. How can I add and remove items from this list?


texts: Change a block programatically, accesing to the Views results

texts:
I have a Views block, which prints a list of products, in unformatted text. I would like to wrap each of these items with a custom href string, which is somehow convoluted and so it is difficult to set in the Views options. I have managed to do so, by retrieving the Views results with hook_views_pre_render and

foreach($view->result ...

and then print the results directly to screen. If I use, instead,

block_view_VIEWS_MY_VIEW_BLOCK_alter and

$data["content"]["#markup"]

I have the problem that the data is in raw form and cannot achieve my initial goal.
What method should I do for this apparently simple goal? I want the block to be finally printed by Drupal, even if modified with the href added programatically, but the rest of properties (pager, etc.) remaining untouched. Thanks!


texts: Generate image styles with a rule on "node save"?

texts:
This QA has some discussion about the lazy image loading.  Imageinfo_cache is D6 only at the moment, and rules_image_styles apparently runs on every node view which isn't great for performance.

Wouldn't it be possible to just create a rule that fires "on node save" and for all types that include images you'll execute PHP code to generate all image styles?


texts: Better Performance by putting image dimensions

texts:
YSlow advises that all images should have dimension attributes even if they are presented at 1:1 scale, so that the browser knows the dimensions before the images are loaded, to start rendering the page faster.

I have a view of 20 taxonomy titles and their image fields. How I can make Drupal put their dimensions attributes on each image html tag?

I have drupal 7.


texts: hook_node_insert() sporadically not being fired after node_save()

texts:
I have a situation where, every once in a while, I'll save a new node, and hook_node_insert() appears not to be called--AT ALL, for any of the modules that implement it. For example, if I look through recent log messages, there is no watchdog message pertaining to the new node; no "your node has been created" message is displayed to the user; none of my custom modules which implement hook_node_insert() are fired. Yet, the node appears to have been successfully saved: It show up after being saved, shows up in content listings, etc. (Though anything that was supposed to happen via another module's hook_node_insert() call does not happen.)

The maddening thing about this situation is the "sporadically" part: Most of the time everything works as designed, and hook_node_insert() fires, but once in a while it doesn't.(Maybe, once out of ten or twenty times, it doesn't fire.)

So at this point I'm just looking for any clues or hints as to where I should be looking for the problem.
Is there anything that this kind of strange sporadic behavior might point to?

One thing I've wondered is if this could somehow be related so some kind of cache issue. Specifically, I'm using memcached on my site, which I'm using to hold every cache table from my database. Could there be some kind of issue there? I'm starting to experiment with removing certain tables from the memcached cache (like cache_form), but no leads yet.


texts: Possibility to limit old content that is displayed to a new user

texts:
I am setting up a website with Drupal 7. I would like to provide premium content for subscribers on monthly basis. I would like provide ability to buy a recurring subscription.

To avoid leeching old content, that has previously been published, is it possible to limit visibility of blog posts form history?

Let me try to clarify the use case:

I would like to provide content to my Premium subscribers in December 2012. All the users that are members in December 2012 would be eligible to see all the content created then. Since I would like this type of subscription to be real time, it would need to restrict the usage of content created before one's membership. When January 2013 arrives, I would like to have recurring membership continue, but new users that arrive in January, would be restricted to content that have been published only when they are subscribers.

The best would be, that if one purchased Dec 2012, left Jan 2013 away and resubscribed Feb 2013, he or she would see material produced in Dec 2012 and Feb 2013, but not Jan 2013.

Dripping Content would be nice, but I am not providing that kind of cumulative courses but time based content instead, and would not like to provide new users the ability to leech all the old material that they've not paid for at the time.

Thank you in advance!


texts: Why my Scheduled Task Action does not run in Business Rule?

texts:
I have a business rule (Entity Insert) that is supposed to run a scheduled task action after 3 months when you create a new node of certain type. This action have another action inside that is in charge of sending an email.

For testing purposes I have configured the scheduled task to just a minute after the rule is triggered but after that time nothing happens.

When you create the new node, the scheduled task is registered in "Scheduled Tasks" section but not executed. If I trigger the scheduled task manually the email is sent.

I had tried this with a custom date field (just date) and the original creation date of the node. None of them works.

Any idea why this is not working?

Drupal 8.8.1
Business Rules 8.x-1.0-beta9

The schedule task configuration:

Target Entity Type: Content
Target Bundle: XXX
Field: created (also tested with a custom date field: field_surgery_created)
Identifier: created surgery [node:nid]
Time Offset: 1
Time Unit: Minutes
Actions added: Send an email
Tried with "Save entity as the last action of the task" checked and without.

The business rule

Event: Entity insert
Target Entity Type: Content
Target Bundle: XXX
Actions added: Schedule a task

Thanks in advance!


texts: How to auto purge old unapproved comments?

texts:
I would like to know if there is any way to automatically purge old unapproved comments on cron run.

The requirement is -- I have turned on email notification on new comments. I would like to approve only the genuine comments and leave the rest for auto-delete on passing certain time.

Of course I already have mollom, captcha and http:BL to fight spam.


texts:
Tried both modules External Links  and External New Tab  none of my external URL leading links opens in a new tab, what could be causing this? I tried disabling jquery update, didn't help.

If you set option on extlink to add icon to every external link, it does it well, so it means it detects the external links, but when clicked it opens in same tab/page. Tested various browsers.


texts: CKEditor 4 library is not detected by Wysiwyg module

texts:
The Wysiwyg installation instructions tell me to

  Extract the archive and copy its contents into a new folder in the following location:
  sites/all/libraries/ckeditor

  So the actual library can be found at:
  sites/all/libraries/ckeditor/ckeditor.js

These 2 conditions are met, however in the overview of editors, the CKEditor is now red. So it sees something is there, it's just not right.
What can be wrong? where should i be looking to troubleshoot?


texts: Weird gibberish characters appearing on bottom of Drupal 7 pages

texts: What are some reasons to why there would be weird gibberish characters appearing on the bottom of a Drupal 7 site? I work in a linux environment, but sometimes I copy the files over from windows. I'm not sure if that is the culprit, but how would one even debug something like this?


texts: Change plid of existing administration menu items

texts:
I'm building an internal portal for an organisation and I want to change the standard administration menu, putting a number of the front-facing website options under a menu item called 'Website' and the rest under 'Drupal Config'.

So I'm simply trying to change the plid of 'admin/content', but it's not working. Could somebody guide me on where I'm going wrong please?

function eac_sponsorship_menu_alter(&$items) {

    $items['admin/content']['plid'] = 592; //592 is id of 'Website' menu item
    menu_link_save($items);

}

Also are there likely to be any repercussions from doing this?

Note that in the final solution the plid wont be hard coded as "592", but will use a DB look up to get the mlid of the 'Website' menu.

Also it is not a cache issue, when checking the DB the plid of admin/content remains to be '1'.


texts: Image not found --> creates a path that doesn't exists

texts:
I'm trying to make a gallery with the Galleria module.
I did everything that the install guide said (module readme) and got the module to work, one time, but then when I went to my front page and back to the gallery I got the following.

I looked in my field setting and didn't create a sub directory. Then, I checked my "File system" configuration and the public path is said to be sites/default/files.

I have no clue why it needs the other directories or where it gets that path from.

Is there someone who could explain this?


texts: Use a view's result as a javascript setting

texts:
I am trying to integrate the Supersized javascript library (http://buildinternet.com/project/supersized/) into my site.

It requires an array of image urls when initialized.

I would like to use a view to populate this array so that my content editors can easily update the site with new background images.

Does anyone know how to do this with Drupal 7?

I have seen the http://drupal.org/project/supersized module, but as far as I know it doesn't work with views.


texts:
I noticed that drupal always use grey as background and line color with tables.

I prefer to avoir modifying the code of my template. Is there any way to modify the ugly grey drupal tables ?


texts: Custom user profile titles interfering with user views block

texts:
I'm using this function to replace the titles on user pages with a user text field:

function MYMODULE_user_view($account, $view_mode, $langcode) {
  $wrapper = entity_metadata_wrapper('user', $account);
  $auth_name = $wrapper->field_account_auth_name->value();
  if ($auth_name) {
    drupal_set_title('Profile overview for ' . $auth_name;
  } else {
    drupal_set_title('Profile overview for ' . $account->name);
  }
}

It works as it should, but when I add a view block with user entities it makes every page have the same title. It's Profile overview for ' . $auth_name; for the first user with a non-empty field_account_auth_name. If I delete that user the next user takes its place. This is for all pages too, not just ones with the block in it.

If it matters I'm using this function

  function MYMODULE_preprocess_user_profile(&$vars) {
    if ($vars['elements']['#view_mode'] == 'auth') {
      $vars['theme_hook_suggestions'][] = 'user_profile__auth';
    }
  }

with a user entity "auth" I created using Entity View Mode, with this in user-profile--auth.tpl:

<div class="authProfile"<?php print $attributes; ?>>
  <?php print render($user_profile); ?>
</div>

and setting auth as the view mode in the view block. But the title problem happens with the user account view mode as well.


texts:
I am trying to write a custom block module in Drupal 8 that will allow me to place this block into my pages using the block layout screen.

I'm very new to Drupal, so this is very much a "hello world" project (initially) to figure out how this works.  To this end, I have been following Youtube video instructions as well as reading through whatever documentation I can find on Internet and also a couple of books, but to no avail [yet].

What I have done is creating a walker directory in the modules folder, where I have created the Walker.info.yml file, whose content is the following.

name: Walker
description: A filewalker
core: 8.x
package: Custom
type: module

In the same directory, I have created the Walker.module file.

/**
 * @file
 * Code for the walker module.
 */

I have then created the module/walker/src/Plugin/Block/ directory and the WalkerBlock.php file with the following content.

/**
 * @file
 * Code for the walker block.
 */

namespace Drupal\walker\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Provides a walker block
 *
 * @Block(
 *   id = "walker",
 *   admin_label = @Translation("The walker block"),
 *   category = @Translation("Blocks")
 * )
 */

class WalkerBlock extends BlockBase {
  public function build() {
    return array('#markup' => 'Walker block');
  }
}

If I run the command "find . -type f | grep Walker" from my root Drupal directory, I get the following output.

./modules/Walker/Walker.module
./modules/Walker/src/Plugin/Block/WalkerBlock.php
./modules/Walker/Walker.info.yml

Yet, though the documentation and videos I have read suggest that this should be all I require, the Walker block does not appear in the block layout screen as an option that I can place in one of the block regions.

Can anyone see what I'm doing wrong?

I cleared the cache from /admin/config/development/performance.


texts: Generating Views Block to list Taxonomy Terms of nodes curently visible in a Views Page

texts:
I have a Views Page which lists nodes of the content type, Article. This page also contains pagination since I configured it to display no more than 6 articles per page.

So for example, if I have 10 articles, 6 of them would be displayed on page 1 and the remaining 4 would be on page 2. In addition, Article has a term reference field called Tags.

I was wondering if it's possible to have a Views block I can attach to my original View I mentioned earlier (a list of Article content type) that lists Tags belonging only Articles currently visible on the original View on one of the paginated pages.

Going again with my example, I want this Views block to display Tags from the 6 Articles when I'm on page 1. Likewise, I want this block to display Tags from the remaining 4 Articles when I'm on page 2.

Here's a little graphic of what I'm trying to do.
http://i.imgur.com/7rPsLaz.png

Also, I'm not sure if this info is relevant but I plan to use the Context module to attach this Views Block to the Views page.

I was thinking along the lines of Contextual Filters but I'm not quite sure what arguments I would use.

Any help is appreciated.


texts: Cannot Find property after adding it with hook_entity_property_info_alter (callback not firing)

texts:
I'm very new to drupal, so forgive me if this is a simple question, but I have been working on this for a few days and have not yet found a solution.

I have an entity, to which I've added the property "hour_created" via the hook_entity_property_info_alter() function. The property has a getter_callback function that simply returns an integer for now. I can see that this property has been added by calling watchdog("normal", print_r($info, true)) after adding the property in the same hook_entity_property_info_alter() function.

The problem is that it does not appear this property is ever actual added to the entity when I try to look at it through Drupal. I added a watchdog("normal", print_r($item, true)); call in the callback, but the watchdog is never called, and never appears in the logs. To try and get the callback to fire, I have tried the following:

node-load through drush
loading the node through the site directly
directly attempting to access the property with php

Unfortunately, I have had no success with any of my above attempts. I suppose what we can boil this question down to is 'How can I make my entity property getter_callback fire, and why isn't it fired when I load the node?' I apologize if any of this is a little muddled, please let me know if any of this is unclear or if you need more information.

Thanks!

EDIT:
Here's the code for my callback:

function mymodule_test_property_getter_callback($item) {
  watchdog("normal", print_r($item, true));
  return 10;
}

And here's my hook_entity_property_info_alter() function:

function mymodule_entity_property_info_alter(&$info) {
  $info['node']['bundles']['mynode']['properties']['test_property'] = array(
    'label' => t('Just a test!'),
    'type' => 'integer',
    'computed' => TRUE,
    'required' => TRUE,
    'getter callback' => 'mymodule_test_property_getter_callback'
  );
  watchdog("normal", print_r($info, true));
}


texts: How to theme Logintoboggan Access Denied Login Page

texts: I am looking to override Logintoboggan's default access denied login page. I can't seem to find what I name the template file and what the defaults are that are required. Any help is appreciated.


texts: Is there a media-handling module that can handle midi files?

texts: I've been using MP3 Player to provide an on-page mp3 player, but I also need to be able to handle midi files. Right now the best I can do is allow them to be uploaded into the "mp3 file" field, but when it renders the node, it just gives a link to the file, which mean you have to navigate to the file (or open it in a new tab) for the browser to play it.


texts:
i need to put a splash page with flash intro.

I have already a front page with the name page--front.tpl.php and how can i put a new splash -page before this home page.

The new splash page will be a simple html page with a flash intro to navigate to the website's home page.

Any suggestion.

....


texts:
I have a site in Drupal 6 which needs to be 301 redirected to external site. I can see .htaccess file in Drupal which has the following content:

<IfModule mod_suphp.c>
    suPHP_ConfigPath /home/example/php.ini
    <Files php.ini>
        order allow,deny
        deny from all
    </Files>
</IfModule>

But while following this document in Drupal for 301 redirection: https://www.drupal.org/node/38960, it says we need to find "IfModule mod_rewrite.c" to write rewrite rule. In my .htaccess file I don't have "IfModule mod_rewrite.c". What should I do to add the rewrite rule in this case?
Should I need to enable any module to achieve this goal.
Any suggestion?


texts: Should a cache tag only render array for an otherwise empty block work?

texts:
I have a custom blocks that displays results based on an entity query. For some pages the correct result is blank, and I want to hide the block.

When a return an empty array from the block's build() method it appears to cache more or less forever.

If I return a render array that just contains #cache values will that get honored, or will the lack of content invalidate those tags some place another the way?

if (empty($relatedContent)) {
  return [
    '#cache' => [
      'contexts' => ['url'],
      'tags' => ['node_list'],
    ],
  ];
}

For what it's worth, I've been testing the idea and I'm running into issues, but it's not clear yet if that's related to this or some other problem.


texts: Webfrom Validation on textfiled when using default value

texts:
I am having a problem where I need to use the default value of a text field to initially populate the from visually. Unfortunately after doing this the field validates as if it has been filled out by a user.
I am attempting to do a custom validation function to check against the default value of the field. So if the field has its default value to still validate as a mandatory field normally would.

The following is my attempt to do this. Am I going in the right direction?

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

    if ($form_id == 'webform_client_form_6'){
       //kpr($form);
        $form['#validate'][] = 'MY_MODULE_validate_form';
    }

}

function MY_MODULE_validate_form($form,&$form_state){
if ($form_state['submitted']['full_name']['#default_value'] == "Full Name") {
    form_set_error('full_name', t('You Must enter your full name'));
    }

}

Any help is much appreciated.


texts: node_load() Performance and alternatives

texts:
I created a custom module which lists the last X nodes from a certain content type, with the following query:

SELECT n.title, r.teaser, r.timestamp
FROM node n
INNER JOIN node_revisions r ON r.vid = n.vid
INNER JOIN term_node tn ON tn.nid = n.nid
INNER JOIN term_data t ON t.tid = tn.tid
WHERE t.name= 'breaking_news'
AND n.status = 1
ORDER BY n.nid DESC LIMIT 25

Then I do a node_load($nid) to check if there is a image and an audio file inside, for example

$mynode = node_load($queryresutl->nid);
if ($mynode->field_efe_audio[0]['filepath']) {
  $audio = 'yep, has audio';
}

But I've read that node_load() could be a performance killer, so I wonder if this is true and if there's is an alternative to check fields in my module?


texts: How do I configure the trusted host settings?

texts:
I have changed the Trusted Host Settings on my website where I currently installed Drupal beta 8.0 alpha version. But in the error report it is still saying that
"Trusted Host Settings NOT ENABLED" . I have changed the code as follows.

// Before
$settings['trusted_host_patterns'] = array(
  '^www \ .example \ .com$',
);

// After
$settings['trusted_host_patterns'] = array(
  '^www \ .technicalreply \ .com$',
);

The error report is still saying that trusted host settings are not enable. What did I do wrong? How can I fix it?


texts: See a list of fields and what content types they are attached to

texts:
I am trying to troubleshoot an issue with Panels. In one of the content panes, there are token replacements from a field.

I looked at the context menu for the page, and it was provided by a taxonomy. I'm assuming this is a field on a node, but I don't know which one.

We have a number of content types and taxonomies on the site. Is there a way, perhaps through a module, to see a list of all the fields that are on the site, and which content types they are attached to?

I'd like to avoid looking through the fields of each content type one by one, if possible.


texts: Sync +- 70 000 records from CSV into drupal

texts:
I have a CSV file with approx. 70.000 records that I want to import into Drupal 7. Once this is done the client will provide a new CSV file on a daily base that has to sync the updated rows to Drupal.

I wrote a import with Feeds and the Migrate module, but in both cases it takes like forever to import the 70.000 rows. Is there any other solution to import the data faster in Drupal 7?


texts:
I have users who are the owners of some nodes, and each node has a menu link in the main menu. Users can only see the nodes they own, and they cannot see other user's nodes.

The problem now is that the menu is displayed like in the following image, for all the users; it shows links for both the nodes owned by the current user, and the nodes the current user doesn't own.

I would like to display only the menu items corresponding to the nodes owned by the logged in user. How can I do this?


texts: Restrict user access to several actions in function

texts:
I have a function, that returns statistics for the user:

function module_menu() {
  $items = array();
  $items["statistics"] = array(
    'page callback' => 'module_statistics',
    'access callback' => 'user_access',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}

function module_statistics($group_id, $user_id = NULL) {
  global $user;
  if ($user_id == NULL) {
    $user_id = $user->uid;
  }
  $result = module_statistics_table($group_id, $user_id);
  print $result;
}

I want only the administrator to have access to this function with $user_id != NULL. So the user will be unable to watch someone elses statistics. I have an access argument 'admin tasks' for the admin. How to do the else statement:

if ($user_id == NULL) {
  $user_id = $user->uid;
}
else {
  if($user has no access to 'admin tasks') {
    return HTTP 403 Forbidden status code;
    exit from function;
  }
}


texts: How to print node's timestamp in computed field

texts:
I want to save my node's submission timestamp in a computed field. I know that I should use date_format function, but idk how it works.

How can I do that? thanks.


texts: How can I recreate the default frontpage view?

texts:
I accidentally deleted my default frontpage view I was using on a Drupal 8 site, and I can't find how to either recreate it or which path to set on a new view to have it as front page.

How can I achieve this?


texts:
I have a view that pulls data from the Speaker content type, as well as from related sessions (Session content type contains an entity reference to the Speaker, so to get that "reverse lookup" I'm using the "A bridge to the Content entity that is referencing Content via field_speaker" relationship type to get the Content: Title from the session nodes.)

This all works, but I can't get the view to display the way I want when a speaker has more than one session. I've tried grouping by speaker name (Content: Title on the speaker node) and get this:

What I want is this:

Here's the basic view setup:

Can this be done just in the Views UI, or do I need to start fiddling with templates?


texts: Change field type from "text field" to "integer"

texts: I have a field that is numerical in nature and it was setup as text field. The problem is that sorting by ascending, the number 111 comes before 20.


texts:
I recently upgraded Acquia Dev Desktop 2 with the most recent release as of March 23th, for both Windows and Mac. It works great on my Windows machine however, while on my Macbook I'm unable to Install a Drupal 8 Distro or any other Disto available from the pop-up list.

I've tried uninstalling Dev Desktop (while removing all my site/program folders associated with dev desktop) and reinstalling Dev Desktop to find it hasn't resolved the problem.

Is it possible this issue could be application based or am I forgetting a step that is causing the installation not to work?


texts:
I'm creating a Migration from our old website (non-Drupal) to our new Drupal website. On our old website, roles and role assignments were kept in 2 seperate tables. So far, I've written a simple UserMigration and a RoleMigration class. However, I'm in doubt how I should proceed for the RoleMembershipMigration.

In short: Should I manually load roles in a prepare function for the UserMigration, or should this be done in a seperate Migration class altogether? I'm inclined towards the first, since it is not actually a migration to a seperate entity.


texts: How to use predefined drupal elements in a custom block/module?

texts:
This is regarding the user block but the question is general and could be related to any standard block/module: How to use in a custom block elements that have been defined in standard modules? (for example the "username" field defined in the user block)
What is the way to access these elements in my code?

If the above is not clear, in other words what I would like to do is to use the "username" , "password" , "..." and all the elements defined in the user module, as independent elements in my custom block. And then build my own Submit which will include both standard drupal and custom items.

I think hook_form_alter will not do this trick because it is 1 level higher, right? i want to go one step more into details and manipulate the form items, no the form itself.


texts: Can I override/modify an existing hook_widget_info for an existing CCK field type

texts:
I want to modify the default Link field, so that instead of just a text field it will always have a Validate Button next to it (for active checking).

I don't want to create a new Widget, I want to override the basic link, so that any link field deriving from the original will inherit these changes. Also of course, is it then possible to override the override (for a specific link variant - say, Twitter link, to change this new button to a checkbox or just remove it for that type)?
Can I just add in my custom module the link_widget_info() function?

Thanks!


texts: LDAP decrypt function throwing undefined offset error

texts:
The error shows up on all of the pages of a "secondary" site in a multi-site configuration. The main, default, site does not show the error. The complete error message is:

  Notice: Undefined offset: 1 in _ldap_servers_decrypt() (line 97 of
  D:\ms4w\Apache\htdocs\drupal\sites\all\modules\ldap\ldap_servers\ldap_servers.encryption.inc).

A direct "hit" for that message points to this issue for the LDAP module and I have done all of the things suggested to no avail.

The line of code in question reads:

list($encrypted_data, $iv) = explode('::', base64_decode($input), 2);

Displaying the value of $input which should be the encrypted password from the database results in tVIO16QY+vkDieVpCLyAxtU+Ylqoqw==. When base64_decode is applied the resulting value does not contain :: which is why the error is being thrown.

All that said the LDAP configuration is correct and works as it should. Short of deleting all of the LDAP related modules and starting over with them is there anything else I might be able to try?


texts: How can I reorder active menu items programmatically?

texts:
I have an 'audience' menu which has 4 links. When a user visits one of these links, it becomes active, and I want to push it to the front of the menu item list. Outcomes would like like;

Pitchers | Catchers | Hitters | Coaches
Coaches (active) | Pitchers | Catchers | Hitters
Catchers (active) | Pitchers | Hitters | Coaches
Hitters (active) | Pitchers | Catchers | Coaches

How can I accomplish this programmatically? I can't seem to find the right theme_ or hook_ api function to pull this off.

I've tried this, and changing the '#original_link' weight didn't seem to make a difference (note, I have other things going on here):

function apple_menu_link__menu_audience_gateway(&$vars) {
  $element = $vars['element'];
  $submenu = '';

  if($element['#original_link']['in_active_trail'] == TRUE) {
    $element['#original_link']['weight'] = 50;
  }

  if ($element['#below']) {
    unset($element['#below']['#theme_wrappers']);
    $submenu = '
' . drupal_render($element['#below']) . '
';
  }

  $output = l($element['#title'], $element['#href'], $element['#localized_options']);

  return '
' . $output . $submenu . '
';
}

Also, I'm using Panels, Panels Everywhere, Page Manager, and MiniPanels — this could inform the ultimate solution.

Thanks all.


texts: Sort taxonomy terms alphabetically by default

texts: I created a taxonomy vocabulary and added some taxonomy terms to it. How can i sort alphabetically the listing of terms in taxonomy vocabulary page. The same sorting needs to reflect in content type fields when this vocabulary is added as term reference.


texts:
How to pass float field value from node(content type A) to another node(content type B)?
which content type B referenced to content type A by using reference from url widget.
thanks


texts: Migrate Organic Groups from a Drupal 6 database to Drupal 7

texts:
I'm using migrate_d2d to migrate my Drupal 6 site to Drupal 7. I've already created several working migration classes to migrate the content of the D6 site into the D7 site. Now I'm working on migrating the organic groups and the related user memberships. I've read that OG (i'm using 7.x-1.19) got a build in migrate routine. When I checked /admin/config/group/group-migrate, I hoped to see some settings where I could insert the data of my legacy database, my User Migration class, click a button and be done with it. :-D
Unfortunately, that's not the case.

I have a hard time to find any documentation of how to use the migration functionality which comes with OG. Could anyone please give me a hint how one is supposed to migrate OG groups/memberships from a D6 database to a D7 database?

Many thanks!


texts: Entity Translation's Language Switcher (Content) is not showing

texts:
Before using Entity Translation, I used the Language switcher (User interface text) to allow the users to switch between languages on the header.

On the 'Configure entity translation' page, under the heading 'Enable a different language switcher', it states:

  When the Entity translation module is installed, a second language switcher block is made available on the site called Language switcher (Content). Enabling this block rather than the default language switcher block, Language switcher (User interface text), will ensure that the language of the content is updated when the language switcher is used.

However, when I place the 'Language switcher (Content)' block in the header, it does not even show up. Switching back to 'Language switcher (user interface)' shows it again, but then it won't ensure the language of the content is updated using the languages switcher.


texts: change the list option based on the selection type

texts:
In a form, user have an option to choose the submission type. Based on the selected submission type, user should get an option to choose sub-type. Please let me know how this is done in Drupal 7. Please suggest a module.

If user select e-book, sub-type should change to case:1 (see image)
If user select e-project, sub-type should change to case:2
If user select e-lab manual, sub-type should change to case:3


texts: How to insert images into custom block type

texts:
This might be a really stupid question because I am overlooking something really simple but here is my issue. I have created a custom block in the custom block library in Drupal 8. I would like to insert images into the block from the images folder in my theme (not upload images using ckeditor).

Normally in Drupal 7 I can manually insert the image using an  tag and all is good. In Drupal 8 this method is not working for me. Here is an example of the code that I enter into the source view:

<img class="socialmedia" src="/themes/custom/mytheme/images/social_media/facebook.png" />

However this does not work - no image is being displayed. I have verified that the path is correct, the spelling is correct, and tried with and without the leading slash. Nothing works.

I found a similar question, but the answers supplied don't address the question as they use php code.

What has changed between Drupal 7 and 8 in this regard? What am I missing?

Thanks


texts: Theme goes away when I write .htaccess file

texts: I had got a .htaccess file from: https://github.com/drupal/drupal/blob/7.x/.htaccess and copied it to /var/www/drupal/.htaccess. I got to my web browser and my default theme has disappeared. I copied it to test, and my theme was back. How can I keep my theme and have .htaccess (I need it for clean URLs)?


texts:
I have configured my clients online Vineyard store to display a flat rate up to £50 and free shipping thereafter.  However they are now selling Vineyard Tour vouchers which are free to ship.

I am trying to set up a condition whereby:

If the cart only contains a vineyard tour voucher or if the order is over £50 make the shipping rate free.
or

If the cart contains any other product (as well as a voucher) and is less than £50 standard shipping rate of £8.50.

Any help would be appreciated.

Best

Tom


texts: Create Famous button in article type with value stored in database

texts:
I have two user roles: editor and publisher.

I want to add a Button in article which says Make This Famous. This button is only visible to Publisher and when the Publisher clicks it, it'll ask for confirmation and if confirmed, the article will be Famous.

Once the article is famous the Button would be disabled for Publisher and the text/label would change to Already Famous. But for Admin The same  Button would still be active with text/label Make This Infamous.

I want the process to be like:

Editor can create articles and publish it
Only Publisher can make the article famous by clicking the Button displayed in article.
Once article is made famous only Admin can make it infamous.
Once the article is famous, it'd display in article saying This content is Made Famous by Username of the Publisher On the Date made famous. This is just like Submitted by in Drupal.
For Anonymous users, If the article is not Famous, it'd not display anything about famous, it'll just display the article as it is.

I have been looking for this for few days, used Workflow and Workbench Module, but those are big and complex solutions. I am not looking for content revisions and those things, just a simple Button which can make the content famous and store the time in database, so, it'd display nicely in articles.

Is there any simpler module or easy way I can accomplish this?


texts:
I am trying to import a CSV from a url using the feeds module, I set everything up but when I start the import I get the following error:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: XXXXX StatusText: OK ResponseText: Fatal error: Unsupported operand types in XXXXX/sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 149

I have traced that error to this code, specifically the last line:

  public function getConfig() {
    $defaults = $this->configDefaults();
    return $this->config + $defaults;
  }

Any idea why I am getting this error?

I removed the default mappings because they were for an RSS feed, with GUID title etc....Could this have something to do with it? Are those required?


texts: redirect multiple nodes on same page in core search results

texts:
I'm using drupal's core search module with pathauto module for URL aliasing. I have one testimonials page where different contents under testimonials category get display in this page. Now, in the search results one of these content get display and lead to node/35 and  node/36 in same search result page.

In URL alias I tried to give /testimonials in each content but it gives error that this URL alias is already in use.

I want to redirect this link on the testimonials page (abcd.com/testimonials). Means

node/35 -> abcd/testimonials
node/36 -> abcd/testimonials
node/37 -> abcd/testimonials

How can I achieve this? Any suggestions or links will be appreciate.

Thanks in advance...


texts:
I designed my site with Acquia Dev Desktop on my PC and now it's finished and I uploaded folder of my site to public_html folder in cpanel. I export my database on my computer and import it to my host. but now when I enter my url in address bar of a browser only front page shown, for example when I click on other content of my site it gos to a white page and nothing will loaded.
what should I do? pleas help me.
which command of setting.php file should change after importing database on server?
this is my site: http://www.setareonline.ir


texts: How do I forcefully uninstall any module having content?

texts:
I want to uninstall the Field module, but this module can not be uninstalled; when I try, I get the following message.

  Field API to add fields to entities like nodes and users. Machine
  name: field Version: 8.0.6 Required by: TextNodeAdmin ToolbarAdmin
  Toolbar Extra ToolsFileOptionsAggregator (disabled) ImageAccelerated
  Mobile Pages (AMP) (disabled)Custom BlockBook (disabled)Text
  EditorCKEditorCommentInterface TranslationConfiguration Translation
  (disabled)

How do I forcefully uninstall any module that is having dependency or content inside, for example the Node module, the Views module, or any entity having content in it?

I tried using \Drupal::service('module_installer')->uninstall(['admin_toolbar']); but then my site breaks.


texts: View footer area to capture main view search terms

texts:
I have a page with a main view which is a Google map display which shows node locations. I can filter these through exposed filters but I can't get these filters to also apply to another view which I placed in the main view footer area.

I thought about using contextual filters in that embedded view, but none seem to do the job when the URL follows the following pattern : /pagename?key1=value1&key2=value2 and so on....

Any idea how I could pick up the search terms from the main view within that embedded view ?


texts: How to add a path filter to views 3 in Drupal 7?

texts:
This doesn't have to do with contextual filters but is it possible to add a filter criterion to views so that it filters the aliased path to a node?

Content:Path is available as a display field but why not as a filter too? Kind of similar question to this


texts: File path set in File field does not show up in hook_node_insert

texts:
I have a content type called project which has a File Field.  Inside this File Field I have set the File Path to be "project".

I have also created a custom module that implements hook_node_insert.  Inside this implementation I am printing the path to my log as so:

watchdog('node path','Node Path= ' . file_create_url($file->uri));

but when I look in my log I see this:

Node Path= http://localhost:8888/sites/default/files/Bubble%20Sort_6.zip

instead of  what I might hope for:

Node Path= http://localhost:8888/sites/default/files/project/Bubble%20Sort_6.zip

The file is correctly created inside the relative directory "project" but the path I get from hook_node_insert does not include this relative path.  Once again confused.

Any ideas?


texts: Webform confirmation url token not converted to value on form submission

texts:
I have a webform that when submitted, should redirect the user to a custom URL that is passed in to a a field (destination_url) via URL parameter. I am attempting to use the Confirmation URL setting (at /admin/structure/webform/manage/[form_name]/settings/confirmation) with a token. Based on the field name, it appears that the token to use would be [webform_submission:original:values:destination_url] or [webform_submission:original:values:destination_url:raw]. However, whenever I submit the form, I get an error saying
 Confirmation URL [webform_submission:original:values:destination_url] is not valid.

While searching around, I found this patch, that supposedly fixed a similar error. Just for grins I debugged that code, and noticed that when it gets to that code, the value of $confirmation_url is still the token itself, not the value represented by the token. I have made sure the form settings are saved before submitting the form, and have refreshed the form page before submitting again, along with clearing the cache. Is there something I'm missing that is causing the token not to be evaluated?


texts: Is it possible to hide a field on a form without writing code?

texts:
there are good instructions on hiding a field using a hook.

Is there a simpler way of doing this? I would like to hide a term reference field on a node edit form but use the default value for it.


texts: How do I show an image using a relative or external url?

texts:
Seems like a simple issue but can't find a simple solution.

Basically I have the feeds module populating a content type from another database which has relative URLS of images. ie. /images/image1.jpg

I'm storing this value in a text field type.

Is there a way to easily translate the output of this field into <img src="$value"> ?


texts:
I have a custom content type (books); on submission of the content type, I want to add a confirmation form for the content type. How can I do that?

How can I append the confirmation form with content type form, and how are the values saved after positive confirmation?


texts: How can I limit the number of upload files programmatically?

texts:
I need to limit the number of upload files programmatically because the max number of files is 10 or unlimited and I need 14 upload files. Is it possible? I found the Upload max files module, but my question is if it is possible, programmatically.

I have installed Drupal 6.


texts: Why variable_get() returns all values of checkboxes list, even if checkbox is not selected?

texts:
I have checkboxes list in system settings form:

$form['mymodule_menu_perm_menus'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Menus'),
    '#options' => menu_get_menus(TRUE),
    '#default_value' => variable_get('mymodule_menu_perm_menus', array()),
);

return system_settings_form($form);

I submit this form with two checkboxes selected.

But on other page variable_get('mymodule_menu_perm_menus') return all values :/

Clearing cache doesn't help


texts: how to make term reference field choose term from a multi level taxonomy vocabulary

texts:
I have a taxonomy voc 'area' that has three levels, region > province > town and city.

I then have a content type 'members' which has these three term reference fields that retrieve region, province and town and city respectively from the area vocabulary.

I used feeds to transfer a csv file of members with one member per row, each with region / province / town city. The result after the feed upload looks great.

Using views to make a block and page I have contextual filters show those same terms and they expand quite nicely via a block from region to a province page, each showing how many 'members' there are per page in parenthesis, drilling down to a town and city page. It's all very nice.

However when I try to manually enter a Member I need to enter region, province and town city using a a select field each time. Using hierarchical select doesn't work because I think it doesn't know which level to choose a term from. The result always skews the view, because for example, province field is choosing a town city, or vice versa, or a region. I do not know how to make it choose the level in the select field i want.

I am clueless. I do not even know if I am asking the correct question because I do not know if my error lies elsewhere.


texts: How to do a "Corner Stamp" with Masonry Views?

texts:
I am building a jQuery Masonry based website, and have content listed as responsive Masonry bricks thorugh Masonry Views.

I need to be able to insert a so called "Corner Stamp" (a static right corner element) in the views results, so that the results wraps around the corner stamp, as described here: http://masonry.desandro.com/demos/corner-stamp.html

In my case the corner stamp will be a unique View or Block with navigational features.

My question is:
How can I insert the corner stamp into a result set listed with Masonry Views?

Is this possible through Masonry Views (possibly with a template), or should I use jQuery Masonry without the module somehow?

Thank you in advance!


texts:
I have used drupal built in form user_login and user_register_form, Is there a way to control label and textbox field separately, because in my markup each label and text field have different wrapping divs. For example, I have render a particular field like below:

<?php print render($form['name']); ?>

If I apply a wrapping div around this then it is applicable on both label and text field but I have separate divs with different class for each label and field. Is this possible?


texts: How to write a simple test case for users by using drupal_mail() function?

texts:
I have written a custom module for sending email to registered users.
And I want simple test case for that users email module.

In this module I am taking a user from database and selected users preferred language and sending emails.

Same as I want .test file, I don't know how to write .test file for this module.

I am using the SimpleTest module, version 7.x-2.x (in Drupal 7).


texts:
I want to migrate some users from my Drupal 7 installation to a new Drupal 8 installation. I do not want to migrate the whole site or any content. And I also do not want to migrate all users.

The problem is the password; I can export from Drupal 7 and import users to Drupal 8, but the passwords do not work anymore. I've also tried to update the hashes (password) in the database directly; so I copied the password fields from Drupal 7 to Drupal 8. That also doesn't work; I think the salt changed in Drupal 8.

Is there any solution for this?


texts: How to allow an OG group admin to create and add a user to a group?

texts:
I have a situation where our D7 site is connected to a LDAP server (with LDAP) module. However, I need a way to allow an Organic groups administrator to add a user (who has not yet logged in) and automatically enroll that user in that same group.

How might I address this?

My first thought is to just build a form where the OG admin adds the user name to a queue. When that user finally logs in, I would use the user_save() hook to add them to the appropriate group.


texts:
How can I integrate core poll module with rules?

I found the advpoll module but it is still in dev version and throws errors everywhere.

I am looking to simply trigger a rule after user votes on a poll.

Are there any alternatives to achieve the same functionality?


texts: CCK field related to non-drupal table columns

texts: I need to define a CCK field that contains data from a non-Drupal table called Customers; i would like the field to show the list of Customers and saving the id_customer inside the node. Is there a way to do it without having to create Customers as node?


texts: node translations and too many menu items

texts:
I use Drupal 7, locale and the i18n modules. I've setup a mini site with node translation.

I have the following EN nodes:

node/1 About
node/2 Terms
node/3 FAQ
node/4 Contact

and the following FR nodes:

node/5 A propos [translation of node/1]
node/6 Contacter [translation of node/4]

The main site is the English one and the French menu will always be equal or a subset of the English one (same structure).

I've implemented the site using 2 menus, one for EN (4 links + Home) and one for FR (2 links + Home). This works but doesn't scale well if I have many (500) nodes per language and:

I decide to add a new language
I decide to reorder some nodes around (change parents etc)

I've also implemented the site using 1 menu (the "Main Menu") and it contains all links (4 links + 2 links + Home). This works but still has the previous disadvantages and in addition:

links are mixed when the user is selecting parent menus

So, my question is, assuming I need a 1-to-1 mapping from EN to FR, or a subset of EN but with the exact same structure, isn't there a simpler way to solve this? Ideally I'd want to have a single Menu which would specify something like:

/about -> node/1, /fr/about -> node/5
/terms -> node/2
/faq -> node/3
/contact -> node/2, /fr/contact -> node/6

Is this possible?


texts:
Summary

Nodes display links to shared document(s)

Example

PDFs to upload only once before I create the workshops:

Booking Form Primary School
Booking Form Secondary Schoool
Risk Assessment for Primary School
Risk Assessment for Secondary School

Then I would like to be able to be able to create a workshop node using a custom content type and while creating this node, be able to click check boxes of some of the forms above.
When viewing the node of the workshop, for the ticked forms to be displayed as Links to download the PDFs.

This is so that when creating lots of Workshops, I can just tick the boxes for the form downloads to be displayed on each workshop page.

My Attempt

I created a taxonomy called: Forms.
For this vocabulary I added a file field: field_form
Then I added the terms and uploaded a document for each
Then in the Content Type adding a term reference field linking to the vocabulary.
This is where I get stuck. In the Content Type Display it only shows links to the term page and not the File download.

How would I setup the ability to upload some PDFs and then be able to then create some nodes that display links to these PDFs as downloads?


texts: After modules update I have an error ServiceNotFoundException

texts:
I try to update my website with drush up --no-core and after that my website is down like a charm with this error :

  Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
  The service "leaflet.service" has a dependency on a non-existent
  service "geofield.geophp". in
  Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processReferences()
  (line 58 of
  /home/webmaster/www-data-dev/my_website/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php).

How to debug this error ?

Drupal core 8.4.4


texts: Why we need hook_cron if the cron job requires a path?

texts:
In drupal we have a hook_cron() which runs on cron.

But in cron job we have to specify a path, the cron will access that path and will run the code in the page callback function of that path.

So my question is that why then we need hook_cron() if we can do this by creating path using hook_menu with a page callback and use that path in the cronjob?

Can someone explain this to me?


texts: Is it possible to have i18n without l10n?

texts:
What I mean by this is: Is it possible to have translated content* without having a translated interface?  Can we make the interface always be in English, even if I am translating content into Spanish?

* I'm use Entity Translation, but I imagine that this question would apply equally to i18n module.


texts: How to count entity references from same field in different entity types?

texts:
I have three entity types:

Company
Team (has field_company which is an entity reference to    Company)
Employee (also has field_company, and field_team which is an
optional entity reference to Team)

The idea is that all Employees are at least part of a Company, and possibly part of a Team within that Company.
Using the Reference Field Option Limit module I have limited the options shown for field_team to only show Teams for the selected Company.

So far so good.

Now I want to create a table view with the following columns:

Company Name
Team Count
Employee Count

I have created two relationships to referencing entities for field_company, and created a type filter for their types (Employee and Team). The problem is that Companies with no Teams, or no Employees are filtered out.

Any help with solving this deceivingly simple problem would be greatly appreciated!


texts: I am a bit confused on the appropriate way to generate a drupal page for handling ajax posts. For example I'm creating a custom module that has favorites buttons. When a user clicks the button the ajax request sends the data to example.com/ajaxscripts/process.php. I need to create a page at process.php to handle the request but it shouldn't generate the full drupal theme. Rather it should just have access to the core drupal information such as $user and drupal database functionality. How can I create such a page? It seems that tying to use hook_menu() would force a full page rendering.


texts: Checkboxes in exposed form in block aren't checked in initial state

texts:
I have views with exposed form.

In filter criteria I have filter category which has 4 checkboxes.

If I choose to display exposed form in block, in initial state checkboxes aren't checked but results appears for each of them. It seems like a bug, user is not selected nothing but results are there. I want to these checkboxes be checked in initial state when the page is opened.

If exposed form isn't displayed in block, the checkboxes are checked in initial state.

I also try to change with form alter but without success, I couldn't print anything

function module_form_alter(&$form, &$form_state, $form_id) {
    switch ($form_id) {
        case 'views_exposed_form':
            krumo($form);
        break;
    }
}


texts:
i've setup a content type that contains two image fields. One for a main image and the second for 4 smaller images. The trouble i'm having is when you select your image and click upload, there is no response from the browser.

So instead of this:

I get this:

Interestingly enough, the images to actually upload, it just doesn't tell the user. Now that wouldn't have been an issue but the second image field requires the user to upload more than one image but because nothing changes, they are unable to.

The only way to add another image is to edit the content and then go and add the second image (and repeat if more images are required). I must have done something wrong?

Just checked the console and I get this JS error:

Uncaught TypeError: Cannot read property 'length' of undefined jquery.js:583
jQuery.extend.each jquery.js:583
Drupal.behaviors.conditionalFields.attach conditional_fields.js?n4i4te:122
(anonymous function) drupal.js?n4i4te:76
jQuery.extend.each jquery.js:605
Drupal.attachBehaviors drupal.js?n4i4te:74
Drupal.ajax.commands.insert ajax.js?v=7.26:542
Drupal.ajax.success ajax.js?v=7.26:400
ajax.options.success ajax.js?v=7.26:164
options.success jquery.form.js?v=2.69:150
cb jquery.form.js?v=2.69:401

Issue may be related to:
https://drupal.org/node/1789040

UPDATE:
Deactivating the Conditional Fields module fixes the issue but there must be another way?


texts:
I've got an e-shop for which I'm getting pretty accurate shipping rates from Australia Post eDRC (uc_auspost_2).

The problem is that sometimes I get overcharged because of the weight of the packaging material, envelope and a bunch of business cards I chuck into each package. On the other hand, I want to avoid overcharging customers by raising product weights.

Is it possible to automatically add say 200 grams to the weight of each package before requesting shipping rates? There is the Shipping rate markup configuration, but that only adjusts the rate after it has been received for a particular package weight.


texts: DateTime shows a different value when editing a node

texts:
I am using Feeds to import field data into nodes.

For a Date field, I am using "YYYY-MM-DD HH:MM:SS" as the format for importing.

When viewing the node, it shows the correct imported date.

However, when editing the newly imported node, the Date is correct but the time changes.

With the field setting set to change the time to the user's timezone, the following shows in the field.

I tried changing the field settings to have no time zone conversion, but the following was shown instead.

What can be done to make the time show correctly when modifying the node?


texts:
I'm trying to build a scayt module to be able to use the CKEditor scayt Plugin. I tried to use this module but it did not work for me. https://github.com/nikhildodeja/scayt  I created my own but I get a WSOD when I veiw a node creat page. The module is below. What am I doing wrong?

        <?php

    /**
    * @file
    * Definition of \Drupal\scayt\Plugin\CKEditorPlugin\Scayt.
    */

    namespace Drupal\scayt\Plugin\CKEditorPlugin;

    use Drupal\ckeditor\CKEditorPluginBase;
    use Drupal\editor\Entity\Editor;

    /**
    * Defines the "Scayt" plugin.
    *
    * @CKEditorPlugin(
    *   id = "scayt",
    *   label = @Translation("Scayt CKEditor")
    * )
    */

    class Scayt extends CKEditorPluginBase{

    /**
    * Implements \Drupal\scayt\Plugin\CKEditorPluginInterface::getDependencies().
    */
    function getDependencies(Editor $editor) {
    return array('panelbutton','floatpanel','menu','menubutton','dialogui','button');
    }

    /**
    * Implements \Drupal\scayt\Plugin\CKEditorPluginInterface::getLibraries().
    */
    function getLibraries(Editor $editor) {
    return array();
    }

    /**
    * Implements \Drupal\scayt\Plugin\CKEditorPluginInterface::isInternal().
    */
    function isInternal() {
    return FALSE;
    }

    /**
    * Implements \Drupal\scayt\Plugin\CKEditorPluginInterface::getFile().
    */
    function getFile() {
        return 'libraries/scayt/plugin.js';
    }

    /**
    * Implements \Drupal\scayt\Plugin\CKEditorPluginButtonsInterface::getButtons().
    */
    function getButtons() {
    return array(
      'Scayt' => array(
        'label' => t('Spell Check'),
        'image' => 'libraries/scayt/icons/scayt.png',
      ),
    );
    }

    /**
    * Implements \Drupal\scayt\Plugin\CKEditorPluginInterface::getConfig().
    */
    public function getConfig(Editor $editor) {
    return array();
    }
    }


texts: Is there a way to let users edit something only if they are a members of an OG?

texts:
We have a number of different users who want to edit 'sections' of our website. This mostly aligns to Organic groups.

Is there a way to allow people to edit pages of a group which they are members of?


texts:
I wanted to be able to control the layout and containers for all elements (choice,title,vote etc) inside my poll block and decided to add my own template for the same.

Like any noob, I checked the block with devel and got the block template file,preprocess methods used (in my case poll-vote.tpl inside drupal core poll module and the template_preprocess_poll_vote inside poll.module) and the candidate file name for the template as poll-vote-block.tpl.php inside my themes directory (sites/all/themes/my_theme) and in the theme's corresponding template.php used the preprocess function as follows:

function my_theme_preprocess_poll_vote(&$variables) {
  echo 'Im in';
  $form = $variables['form'];
  $variables['choice'] = drupal_render($form['choice']);
  $variables['title'] = check_plain($form['#node']->title);
  $variables['vote'] = drupal_render($form['vote']);
  $variables['rest'] = drupal_render($form);
  $variables['block'] = $form['#block'];
  // If this is a block, allow a different tpl.php to be used.
  if ($variables['block']) {
    $variables['template_files'][] = 'poll-vote-block-custom';
  }
  print_r($variables['template_files']);
}

Initially I set the template_files value as 'poll-vote-block' and it didn't seem to be affecting the block, which i confirmed with devel again.

I printed the echo message to ensure the preprocess was called and it did print it. I renamed the template_files (and the template file) and printed it to get the following:

Array ( [0] => poll-vote-block [1] => poll-vote-block-custom )

I once came across theme templating in drupal docs that preprocess methods are not necessarily overridden but placed in a queue... to me it appears that my preprocess method's tpl file is set with lower priority and hence unable to override. Hence I'm unable to fulfil my requirement of theming the poll block

It'd be nice know if I'm mistaken with this conception and hope someone would provide me some insight on this to get my problem solved.

Thanks in advance!!

Edit

The problem was finally solved. I created a block-poll.tpl.php file and was then able to override the default poll-vote.tpl.php with my preprocess method and poll-vote-block-custom.tpl.php.

Apparently just like the case where one needs block.tpl.php for his block-module-delta.tpl.php to override a default functionality this might've been my case.

Marking jimajamma's answer as solution as it proves to be a good documentation and reference material worth being a wiki for Drupal theming for novice developers.

Cheers!!


texts: Control access to node by entity reference on User record

texts:
Let's say I have a Content Type of fruit. I want to control access to individual nodes of type fruit by an entity reference on a user record. What is the best way to do that?

In other words, if a user record has an entity reference field which references the nodes titled "orange" and "banana", he should only have access to those two nodes of the Content Type fruit.

[Someone below suggests Node Access User Reference, but that doesn't actually apply to this situation].


texts: Set up a subtheme that is used by mulitple sites, but has different JavaScript for each site

texts:
I have a Drupal 8 base theme and a subtheme. There are 3 sites with different DB's that will share this single subtheme.

Each site will use different JS scripts (eg: Google Tag Manager, Parse.ly) that are typically added in html.html.twig and each site will also use JS files that have site-specific code.

It's hard to find documentation on D8 regarding this, but the closest idea I can come up with is either somehow doing this with theme settings or it needs to be done with a custom module that calls these specific files/scripts from the subtheme based on whichever domain/site you're on.

How can I set this up?


texts: Page Manager on a variant of the node url

texts:
I have overriden the default /node/%node layout using panels and the page manager, now I need to add some different content when the URL is /node/%node/step2.

I have added a variant, and on the selection rules I added the URL path on /node/*/step2. I also tried different URL paths like /node/%node/step2 or even */step2.

But if I go to that URL it doesn't show up, and returns me a 404. This seems odd since that, if no other variant would be found (like my new /node/%node/step2), the default /node/%node page should be shown instead of a 404.

So my question is: why am I receiving a 404 instead of my "step2" variant, or even the default node page?

I'm using Page Manager 7.x-1.12.


texts: Intermittent "Cron already running error"

texts:
I get the error every once in a while then Cron completes successfully, then the error crops up again some hours later, and after about 3-4 tries the system completes cron again without a problem, all of this without my intervention. I don't understand it! I've googled and found several posts about how to fix the error once it happens but nothing that I could find tells me how to prevent this error from happening in the first place and why it happens so randomly. I'm running the latest D7 with cron set to run every hour. Any insight would be highly appreciated!

  cron  09/17/2013 - 14:15  Cron run completed. Anonymous (not verified)
      cron    09/17/2013 - 14:15  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 14:15  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 14:15  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 13:14  Cron run completed. Anonymous (not verified)
      cron    09/17/2013 - 13:12  Cron run completed. Anonymous (not verified)
      cron    09/17/2013 - 13:12  Cron run completed. Anonymous (not verified)
      cron    09/17/2013 - 13:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 13:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 13:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 13:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 13:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 12:12  Cron run completed. Anonymous (not verified)
      cron    09/17/2013 - 12:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 12:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 12:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 12:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 12:12  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 12:11  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 11:59  Attempting to re-run cron while it is already running.  Anonymous (not verified)
      cron    09/17/2013 - 10:49  Cron run completed. Anonymous (not verified)


texts:
i have a content type having two major fields.

A  and B

Now i want to get all resutls of those nodes .

if A having value of 1 or B having value of 2.

if anyof node matched with one field i need to show result.

How to do this in views ?

Thanks.


texts: In Views, use group type's image in a field when a group content type is fitered

texts:
I currently have a view that filters through a certain content type, which is a group content type. I am displaying fields such as title, body and last comment. I would also like to add an image field, which comes from the content type's group.

Is there a way to do this in Views?

I am using Drupal 7, and Views 3.


texts:
Task

I have been issued to alter the cart form view Shopping cart form (Commerce Order) on the site.com/cart page of the Drupal 7's commerce module. This includes adding extra choices such as sizes together with simply updating the quantity of each product.

My attempts so far

I've tried overriding commerce_cart_block just realise it was commerce_cart_form that was in charge of the content. Now I've tried a module that's called Commerce Cart View Override and it helps me have a template file called views-view--commerce-cart-form.tpl.php inside my template to display the content.

However I'm not really sure what I'm supposed to do now. In my mind I would override the table that show the items and the form surrounding it. I echo'ed get_defined_vars() in the template just to realise that there are quite many variables passed.

Question

What I desire is an elegant solution that allows me to append more forms to modify existing cart session, all in the /cart page, and also be able to have full control of the current cart table.

What is the ideal way for me to customize the /cart page? Am I on the right path, or there some simplier alternatives that I have missed? Personally I want a coded solution and not a database saved one.


texts: How can I implement this floating sidebar block?

texts:
I'm going to implement a floating sidebar block that can contain user's selections. It is a kind of cart. Please check the image below.

If the use press 'Add to my favorite', then it should be contained in the sidebar.
The floating sidebar block should slide up and down with buttons. Each item of it should be removed if the user press some kind of cross mark at the edge of item.
After selection, the user can check all the items which have selected using 'View my favorites' button.

What is the right solution to do this?
I was thinking that I needed to use 'Views module'. But I can't imagine how to make this sidebar slided.


texts: What is the best way to create a Drupal pricing table for Drupal Commerce? I love the pricing table mentioned in this discussion. But I can't believe there is no ready-made module. What's your recommended architecture?


texts: Taxonomy view with attachment, only display 2nd level when parent is selected

texts:
I got a taxonomy view like this, D7:

Country 1

City 1
City 2
City 3

Country 2

City 4
City 5

i managed to implement it using a block for first level "Taxonomy term: Parent term (= 0)" and a second level with a view via an attachment via a contextual filter "Taxonomy term: Name (translated)".
currently the whole tree is displayed, found tons of questions asking how to display first level only, my question is how to display only the selected second level. if i click "country 2", i'd only like to see City 4 & City 5 expanded, but 1-3 collapsed:

Country 1
Country 2

City 4
City 5


texts:
I'm trying to add a custom condition in a query:

 $today = new DrupalDateTime();
 $today = $today->format("m-d");
 $ids = Drupal::entityQuery('user')
  ->condition('status', 1)
  ->condition("date_format('field_birthday','%m - %d')", $today, '=')
  ->execute();

Error:

  PHP message: Uncaught PHP Exception
  Drupal\Core\Entity\Query\QueryException:
  "'date_format('field_birthday','%m-%d')

Version Drupal 8.8.4

What is the best way to solve this?


texts: How to make my new administration page use my administration theme?

texts:
I’ve created a user role of accountant and for this role have created a single page using Views. This page started out as a clone of another admin views page.

Unfortunately this page is using the website’s main theme CSS instead of the admin CSS and is causing some real problems.

I’ve been looking how to have this page NOT load the theme CSS, and use the admin CSS instead.

The accountant role has very limited permissions.

How can I correct this??


texts: Easy PHP, Radioactivity module: Read out a node's current energy?

texts:
Sorry, this is a super stupid problem but I'm new to PHP and failed at solving it myself.

On my node I have an energy field (Radioactivity module) and a computed field. The computed field is supposed to read out the node's current energy, plug it into a function and return another value.

I have tried all of

float( $entity->field_energy ),

float( $entity->field_energy[0]['value'] ), and

float( array_pop(array_pop(field_get_items($entity_type, $entity, 'field_energy'))) )

to read out the node's current energy, but everythings gives me an error. When I replace the above with a static number everything works fine.

Can anyone tell me how to read out the energy? I don't even know what data type is used to store the energy.

(I couldn't add a radioactivity tag. Unfortunately I don't have enough reputation points for doing so.)


texts: How to add a field to Browsing Widgets partial form?

texts:
I have a content type Task which has a field that references to other content type Project, so when I create a new Task, I can reference it to a project. I would like to add this to the Commons Browsing Widgets partial form.

How can I add a dropdown list to this form that shows the projects where user can link the task? I was trying to add it by adding it to code in .module file, in the form_commons_bw_partial_node_form_alter() part but I didnt manage to get it working..