KiamLaLuno

Crazy form

  1. function book_access_permissions_form(&$form_state, $node) {
  2.   $grants = array(
  3.     'view' => array(),
  4.     'update' => array(),
  5.     'delete' => array(),
  6.   );
  7.   $grant_ids = array(
  8.     'grant_vi

Fix for Fix for Custom menu items

  1. <?php
  2. // Database query checking for nodes of node type personal-ad and where author matches the logged in users id.
  3. $count = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE uid = %d AND type

Fix for warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /var/www/html/dccaucus.com

  1. $plid = db_result(db_query("SELECT mlid FROM {menu_links} WHERE menu_name = 'primary-links' and link_path = '%s'", 'media'));
  2. dsm($plid);
  3. $links = array('media/news', 'media/press');
  4.  
  5. $args = arra

book_access.test

  1. <?php
  2. // $Id$
  3.  
  4. /**
  5.  * @file
  6.  * Test file for Book Access module.
  7.  *
  8.  */
  9.  
  10. class BookAccessTestCase extends DrupalWebTestCase {
  11.   /**
  12.    * Check that the current user can/cannot view/update/d

Problematic query

  1.       $bool = db_result(
  2.         db_query("SELECT 1 FROM {book_access} WHERE nid = %d AND rid = %d"),
  3.         $nid, $rid
  4.       );
  5.  
  6.       drupal_write_record('book_access', $row, $bool ?

Query without db_placeholders()

  1.   $results = db_query(
  2.     "SELECT nid FROM {node_access} WHERE realm = 'book_access' AND gid IN (%s) AND grant_update > 0",
  3.     implode(', ', $roles)
  4.   );
Syndicate content