Commit cfc7d434 authored by profix898's avatar profix898

- 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) {
// Error output to watchdog
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() {
'weight' => 5
);
// Initialize G2 and build the router items ...
// Initialize G2 and build the router items
if (_gallery_init(TRUE)) {
$depth = variable_get('gallery_menu_depth', 5);
for ($i=1; $i<=$depth; $i++) {
......@@ -225,18 +225,23 @@ function _gallery_menu_traverse($tree) {
* Function _gallery_menu_album_path().
*/
function _gallery_menu_album_path($id) {
global $language;
$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()));
// ... and additional parameter (e.g. session id, etc.)
if (($pos = strrpos($path, '/')) !== FALSE) {
$path = substr($path, 0, $pos + 1);
}
// Remove the language-prefix
if (module_exists('i18n')) { // TODO
i18n_get_lang_prefix($path, TRUE);
if (function_exists('language_url_rewrite')) {
$args = explode('/', $path);
$prefix = array_shift($args);
if (!empty($language->prefix) && $language->prefix == $prefix) {
$path = implode('/', $args);
}
}
return rtrim($path, '/');
}
......
......@@ -357,7 +357,7 @@ function _gallery_user_advanced_finished($success, $results, $operations) {
if (isset($results['messages']) && count($results['messages'])) {
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');
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 {
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