updated core to 7.53

This commit is contained in:
Bachir Soussi Chiadmi
2016-12-23 10:39:24 +01:00
parent e7aa033981
commit 400dd6e9f4
337 changed files with 9443 additions and 2570 deletions
+14 -15
View File
@@ -950,7 +950,7 @@ function hook_node_info() {
* 'recent', or 'comments'. The values should be arrays themselves, with the
* following keys available:
* - title: (required) The human readable name of the ranking mechanism.
* - join: (optional) The part of a query string to join to any additional
* - join: (optional) An array with information to join any additional
* necessary table. This is not necessary if the table required is already
* joined to by the base query, such as for the {node} table. Other tables
* should use the full table name as an alias to avoid naming collisions.
@@ -974,7 +974,12 @@ function hook_ranking() {
'title' => t('Average vote'),
// Note that we use i.sid, the search index's search item id, rather than
// n.nid.
'join' => 'LEFT JOIN {vote_node_data} vote_node_data ON vote_node_data.nid = i.sid',
'join' => array(
'type' => 'LEFT',
'table' => 'vote_node_data',
'alias' => 'vote_node_data',
'on' => 'vote_node_data.nid = i.sid',
),
// The highest possible score should be 1, and the lowest possible score,
// always 0, should be 0.
'score' => 'vote_node_data.average / CAST(%f AS DECIMAL)',
@@ -1079,19 +1084,9 @@ function hook_delete($node) {
* @ingroup node_api_hooks
*/
function hook_prepare($node) {
$file = file_save_upload($field_name, _image_filename($file->filename, NULL, TRUE));
if ($file) {
if (!image_get_info($file->uri)) {
form_set_error($field_name, t('Uploaded file is not a valid image'));
return;
}
if (!isset($node->mymodule_value)) {
$node->mymodule_value = 'foo';
}
else {
return;
}
$node->images['_original'] = $file->uri;
_image_build_derivatives($node, TRUE);
$node->new_file = TRUE;
}
/**
@@ -1299,6 +1294,10 @@ function hook_validate($node, $form, &$form_state) {
* The node to be displayed, as returned by node_load().
* @param $view_mode
* View mode, e.g. 'full', 'teaser', ...
* @param $langcode
* (optional) A language code to use for rendering. Defaults to the global
* content language of the current request.
*
* @return
* The passed $node parameter should be modified as necessary and returned so
* it can be properly presented. Nodes are prepared for display by assembling
@@ -1312,7 +1311,7 @@ function hook_validate($node, $form, &$form_state) {
*
* @ingroup node_api_hooks
*/
function hook_view($node, $view_mode) {
function hook_view($node, $view_mode, $langcode = NULL) {
if ($view_mode == 'full' && node_is_page($node)) {
$breadcrumb = array();
$breadcrumb[] = l(t('Home'), NULL);