updated core to 7.58, security update
This commit is contained in:
@@ -212,7 +212,7 @@ function hook_taxonomy_term_view($term, $view_mode, $langcode) {
|
||||
* documentation respectively for details.
|
||||
*
|
||||
* @param $build
|
||||
* A renderable array representing the node content.
|
||||
* A renderable array representing the term.
|
||||
*
|
||||
* @see hook_entity_view_alter()
|
||||
*/
|
||||
|
||||
@@ -8,8 +8,8 @@ files[] = taxonomy.module
|
||||
files[] = taxonomy.test
|
||||
configure = admin/structure/taxonomy
|
||||
|
||||
; Information added by Drupal.org packaging script on 2014-11-19
|
||||
version = "7.34"
|
||||
; Information added by Drupal.org packaging script on 2018-03-28
|
||||
version = "7.58"
|
||||
project = "drupal"
|
||||
datestamp = "1416429488"
|
||||
datestamp = "1522264019"
|
||||
|
||||
|
||||
@@ -492,6 +492,7 @@ function taxonomy_update_7004() {
|
||||
'bundle' => $bundle->type,
|
||||
'settings' => array(),
|
||||
'description' => 'Debris left over after upgrade from Drupal 6',
|
||||
'required' => FALSE,
|
||||
'widget' => array(
|
||||
'type' => 'taxonomy_autocomplete',
|
||||
'module' => 'taxonomy',
|
||||
@@ -557,7 +558,7 @@ function taxonomy_update_7005(&$sandbox) {
|
||||
// of term references stored so far for the current revision, which
|
||||
// provides the delta value for each term reference data insert. The
|
||||
// deltas are reset for each new revision.
|
||||
|
||||
|
||||
$conditions = array(
|
||||
'type' => 'taxonomy_term_reference',
|
||||
'deleted' => 0,
|
||||
|
||||
@@ -25,7 +25,7 @@ function taxonomy_help($path, $arg) {
|
||||
$output .= '<h3>' . t('Uses') . '</h3>';
|
||||
$output .= '<dl>';
|
||||
$output .= '<dt>' . t('Creating vocabularies') . '</dt>';
|
||||
$output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => url('admin/structure/taxonomy'), '@perm' => url('admin/people/permissions', array('fragment'=>'module-taxonomy'))));
|
||||
$output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => url('admin/structure/taxonomy'), '@perm' => url('admin/people/permissions', array('fragment' => 'module-taxonomy'))));
|
||||
$output .= '<ul><li>' . t('<em>vocabulary</em>: Music') . '</li>';
|
||||
$output .= '<ul><li>' . t('<em>term</em>: Jazz') . '</li>';
|
||||
$output .= '<ul><li>' . t('<em>sub-term</em>: Swing') . '</li>';
|
||||
@@ -1023,7 +1023,7 @@ function taxonomy_get_parents($tid) {
|
||||
$query->join('taxonomy_term_hierarchy', 'h', 'h.parent = t.tid');
|
||||
$query->addField('t', 'tid');
|
||||
$query->condition('h.tid', $tid);
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
$query->orderBy('t.weight');
|
||||
$query->orderBy('t.name');
|
||||
$tids = $query->execute()->fetchCol();
|
||||
@@ -1081,7 +1081,7 @@ function taxonomy_get_children($tid, $vid = 0) {
|
||||
if ($vid) {
|
||||
$query->condition('t.vid', $vid);
|
||||
}
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
$query->orderBy('t.weight');
|
||||
$query->orderBy('t.name');
|
||||
$tids = $query->execute()->fetchCol();
|
||||
@@ -1129,7 +1129,7 @@ function taxonomy_get_tree($vid, $parent = 0, $max_depth = NULL, $load_entities
|
||||
$query->join('taxonomy_term_hierarchy', 'h', 'h.tid = t.tid');
|
||||
$result = $query
|
||||
->addTag('translatable')
|
||||
->addTag('term_access')
|
||||
->addTag('taxonomy_term_access')
|
||||
->fields('t')
|
||||
->fields('h', array('parent'))
|
||||
->condition('t.vid', $vid)
|
||||
@@ -1249,7 +1249,7 @@ class TaxonomyTermController extends DrupalDefaultEntityController {
|
||||
protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
|
||||
$query = parent::buildQuery($ids, $conditions, $revision_id);
|
||||
$query->addTag('translatable');
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
// When name is passed as a condition use LIKE.
|
||||
if (isset($conditions['name'])) {
|
||||
$query_conditions = &$query->conditions();
|
||||
|
||||
@@ -150,7 +150,7 @@ function taxonomy_autocomplete($field_name = '', $tags_typed = '') {
|
||||
|
||||
$query = db_select('taxonomy_term_data', 't');
|
||||
$query->addTag('translatable');
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
|
||||
// Do not select already entered terms.
|
||||
if (!empty($tags_typed)) {
|
||||
|
||||
@@ -1025,7 +1025,7 @@ class TaxonomyRSSTestCase extends TaxonomyWebTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp('taxonomy');
|
||||
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access', 'administer content types'));
|
||||
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access', 'administer content types', 'administer fields'));
|
||||
$this->drupalLogin($this->admin_user);
|
||||
$this->vocabulary = $this->createVocabulary();
|
||||
|
||||
@@ -1983,3 +1983,113 @@ class TaxonomyEFQTestCase extends TaxonomyWebTestCase {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that appropriate query tags are added.
|
||||
*/
|
||||
class TaxonomyQueryAlterTestCase extends TaxonomyWebTestCase {
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Taxonomy query tags',
|
||||
'description' => 'Verifies that taxonomy_term_access tags are added to queries.',
|
||||
'group' => 'Taxonomy',
|
||||
);
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp('taxonomy_test');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that appropriate tags are added when querying the database.
|
||||
*/
|
||||
public function testTaxonomyQueryAlter() {
|
||||
// Create a new vocabulary and add a few terms to it.
|
||||
$vocabulary = $this->createVocabulary();
|
||||
$terms = array();
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
$terms[$i] = $this->createTerm($vocabulary);
|
||||
}
|
||||
|
||||
// Set up hierarchy. Term 2 is a child of 1.
|
||||
$terms[2]->parent = array($terms[1]->tid);
|
||||
taxonomy_term_save($terms[2]);
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$loaded_term = taxonomy_term_load($terms[0]->tid);
|
||||
$this->assertEqual($loaded_term->tid, $terms[0]->tid, 'First term was loaded');
|
||||
$this->assertQueryTagTestResult(1, 'taxonomy_term_load()');
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$loaded_terms = taxonomy_get_tree($vocabulary->vid);
|
||||
$this->assertEqual(count($loaded_terms), count($terms), 'All terms were loaded');
|
||||
$this->assertQueryTagTestResult(1, 'taxonomy_get_tree()');
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$loaded_terms = taxonomy_get_parents($terms[2]->tid);
|
||||
$this->assertEqual(count($loaded_terms), 1, 'All parent terms were loaded');
|
||||
$this->assertQueryTagTestResult(2, 'taxonomy_get_parents()');
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$loaded_terms = taxonomy_get_children($terms[1]->tid);
|
||||
$this->assertEqual(count($loaded_terms), 1, 'All child terms were loaded');
|
||||
$this->assertQueryTagTestResult(2, 'taxonomy_get_children()');
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$query = db_select('taxonomy_term_data', 't');
|
||||
$query->addField('t', 'tid');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
$tids = $query->execute()->fetchCol();
|
||||
$this->assertEqual(count($tids), count($terms), 'All term IDs were retrieved');
|
||||
$this->assertQueryTagTestResult(1, 'custom db_select() with taxonomy_term_access tag (preferred)');
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$query = db_select('taxonomy_term_data', 't');
|
||||
$query->addField('t', 'tid');
|
||||
$query->addTag('term_access');
|
||||
$tids = $query->execute()->fetchCol();
|
||||
$this->assertEqual(count($tids), count($terms), 'All term IDs were retrieved');
|
||||
$this->assertQueryTagTestResult(1, 'custom db_select() with term_access tag (deprecated)');
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$query = new EntityFieldQuery();
|
||||
$query->entityCondition('entity_type', 'taxonomy_term');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
$result = $query->execute();
|
||||
$this->assertEqual(count($result['taxonomy_term']), count($terms), 'All term IDs were retrieved');
|
||||
$this->assertQueryTagTestResult(1, 'custom EntityFieldQuery with taxonomy_term_access tag (preferred)');
|
||||
|
||||
$this->setupQueryTagTestHooks();
|
||||
$query = new EntityFieldQuery();
|
||||
$query->entityCondition('entity_type', 'taxonomy_term');
|
||||
$query->addTag('term_access');
|
||||
$result = $query->execute();
|
||||
$this->assertEqual(count($result['taxonomy_term']), count($terms), 'All term IDs were retrieved');
|
||||
$this->assertQueryTagTestResult(1, 'custom EntityFieldQuery with term_access tag (deprecated)');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the hooks in the test module.
|
||||
*/
|
||||
protected function setupQueryTagTestHooks() {
|
||||
taxonomy_terms_static_reset();
|
||||
variable_set('taxonomy_test_query_alter', 0);
|
||||
variable_set('taxonomy_test_query_term_access_alter', 0);
|
||||
variable_set('taxonomy_test_query_taxonomy_term_access_alter', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies invocation of the hooks in the test module.
|
||||
*
|
||||
* @param int $expected_invocations
|
||||
* The number of times the hooks are expected to have been invoked.
|
||||
* @param string $method
|
||||
* A string describing the invoked function which generated the query.
|
||||
*/
|
||||
protected function assertQueryTagTestResult($expected_invocations, $method) {
|
||||
$this->assertIdentical($expected_invocations, variable_get('taxonomy_test_query_alter'), 'hook_query_alter() invoked when executing ' . $method);
|
||||
$this->assertIdentical($expected_invocations, variable_get('taxonomy_test_query_term_access_alter'), 'Deprecated hook_query_term_access_alter() invoked when executing ' . $method);
|
||||
$this->assertIdentical($expected_invocations, variable_get('taxonomy_test_query_taxonomy_term_access_alter'), 'Preferred hook_query_taxonomy_term_access_alter() invoked when executing ' . $method);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user