Commit cfc7d434 authored by profix898's avatar profix898
Browse files

- bugfix: incorrect arguments for watchdog() call (#220137)

- task: language prefix handling in gallery_menu
parent ad84f1fd
...@@ -708,7 +708,7 @@ function gallery_error($msg, $ret = NULL, $serious = FALSE) { ...@@ -708,7 +708,7 @@ function gallery_error($msg, $ret = NULL, $serious = FALSE) {
// Error output to watchdog // Error output to watchdog
if (in_array(GALLERY_ERROR_WATCHDOG, $error_mode)) { if (in_array(GALLERY_ERROR_WATCHDOG, $error_mode)) {
watchdog('gallery', $message, WATCHDOG_ERROR); watchdog('gallery', $message, array(), WATCHDOG_ERROR);
} }
} }
......
...@@ -61,7 +61,7 @@ function gallery_menu_menu() { ...@@ -61,7 +61,7 @@ function gallery_menu_menu() {
'weight' => 5 'weight' => 5
); );
// Initialize G2 and build the router items ... // Initialize G2 and build the router items
if (_gallery_init(TRUE)) { if (_gallery_init(TRUE)) {
$depth = variable_get('gallery_menu_depth', 5); $depth = variable_get('gallery_menu_depth', 5);
for ($i=1; $i<=$depth; $i++) { for ($i=1; $i<=$depth; $i++) {
...@@ -225,16 +225,21 @@ function _gallery_menu_traverse($tree) { ...@@ -225,16 +225,21 @@ function _gallery_menu_traverse($tree) {
* Function _gallery_menu_album_path(). * Function _gallery_menu_album_path().
*/ */
function _gallery_menu_album_path($id) { function _gallery_menu_album_path($id) {
global $language;
$path = urldecode(gallery_generate_url(array('itemId' => $id), FALSE, FALSE)); $path = urldecode(gallery_generate_url(array('itemId' => $id), FALSE, FALSE));
// Strip off the base path ... // Strip off the base path ... and additional parameter (e.g. session id, etc.)
$path = substr($path, strlen(base_path())); $path = substr($path, strlen(base_path()));
// ... and additional parameter (e.g. session id, etc.)
if (($pos = strrpos($path, '/')) !== FALSE) { if (($pos = strrpos($path, '/')) !== FALSE) {
$path = substr($path, 0, $pos + 1); $path = substr($path, 0, $pos + 1);
} }
// Remove the language-prefix // Remove the language-prefix
if (module_exists('i18n')) { // TODO if (function_exists('language_url_rewrite')) {
i18n_get_lang_prefix($path, TRUE); $args = explode('/', $path);
$prefix = array_shift($args);
if (!empty($language->prefix) && $language->prefix == $prefix) {
$path = implode('/', $args);
}
} }
return rtrim($path, '/'); return rtrim($path, '/');
......
...@@ -357,7 +357,7 @@ function _gallery_user_advanced_finished($success, $results, $operations) { ...@@ -357,7 +357,7 @@ function _gallery_user_advanced_finished($success, $results, $operations) {
if (isset($results['messages']) && count($results['messages'])) { if (isset($results['messages']) && count($results['messages'])) {
drupal_set_message(theme('item_list', $results['messages'], t('The following messages occured:')), 'notice'); drupal_set_message(theme('item_list', $results['messages'], t('The following messages occured:')), 'notice');
drupal_set_message('<strong>'. t('Invalid user items were skipped.') .'</strong>', 'notice'); drupal_set_message('<strong>'. t('Invalid user items were skipped.') .'</strong>', 'notice');
watchdog('gallery', theme('item_list', $results['messages'], t('The following messages occured:')), WATCHDOG_NOTICE); watchdog('gallery', theme('item_list', $results['messages'], t('The following messages occured:')));
} }
else { else {
drupal_set_message(t('User synchronization successfully completed.')); drupal_set_message(t('User synchronization successfully completed.'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment