Jump to:
| Project: | Keyboard shortcut utility |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | nestor.mata |
| Status: | fixed |
Issue Summary
This error shows for Drupal 6.5 & 6.6 when attempting to access admin/settings/shortcut.
// $Id: common.inc,v 1.756.2.29 2008/10/22 19:26:01 goba Exp $
1447 // Append active class.
1448 if ($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) {
1449 if (isset($options['attributes']['class'])) {
1450 $options['attributes']['class'] .= ' active';
1451 }
1452 else {
1453 $options['attributes']['class'] = 'active';
1454 }
1455 }
// $Id: shortcut.module,v 1.2.2.2 2008/10/08 21:49:30 karpuz Exp $
264 function theme_shortcut_admin_list($shortcuts = array()) {
265 $headers = array(t('Shortcut'), t('Description'), t('Actions'));
266 $rows = array();
267 foreach ($shortcuts as $shortcut) {
268 $shortcut_string = shortcut_shortcut_to_string($shortcut);
269 $rows[] = array(
270 $shortcut_string,
271 $shortcut['title'],
272 l(t('Edit'), 'node/' . $shortcut['nid'] . '/edit', drupal_get_destination())
273 . ' | '
274 . l(t('Remove'), 'node/' . $shortcut['nid'] . '/delete', drupal_get_destination())
275 );
276 }
277 $output = l(t('Add a new shortcut'), 'node/add/shortcut', drupal_get_destination());
278 $output .= theme('table', $headers, $rows, array('class' => 'shortcut_admin_list'));
279 return $output;
280 }See http://drupal.org/files/issues/shortcut_6_1_314740.patch
+++ shortcut.module 2008-10-09 11:46:24.000000000 +0000
+ $output = l(t('Add a new shortcut'), 'node/add/shortcut', array(drupal_get_destination()));
At first the patch suggestion to change line 277 from drupal_get_destination() to array(drupal_get_destination()) is successful and access to admin/settings/shortcut does no produce an error, however once any Keyboard Shortcut nodes are created the result is the same fatal error. Building on the suggestion, when all 3 references (lines 272, 274, 277) are changed to and then admin access is successful. Without these changes shortcuts do not seem to execute.
In addition to the Fatal error issue there seems to be additional issues with internal/external URL settings. If "Type of action or URL" is changed at any point from "Go to an Internal URL" (ie node/add) to "Go to an External URL" (ie http://www.google.com) the result is the external URL is getting a prefix of the Drupal base path, ie:
At first attempt, after array(drupal_get_destination()) edits, the Keyboard Shortcuts for external URLs worked successfully but once any edits or change from external to internal are made URLs get the base path prefix (ie double http://). Removing all Keyboard Shortcut nodes (reflected in database shortcuts table) and then trying again results in the same base path prefix for external URLs. The s_type field (0,1,2) used to identify type of shortcut is corrrectly showing while related s_action field (admin/settings, anyfunction(), www.google.ca) is also correct so this does not seem to be a database issue.
From the 3 Shortcuts I've created (PATH 0, FUNCTION 1, EXTERNAL 2) Mozilla Firebug shows the following Javascript output (keys codes removed ie*,) in the HTML header:
shortcutsDown.push({ie *, func_name:"shortcut_call_path", param:"http://www.google.ca" });
shortcutsDown.push({ie *, func_name:"anyfunction()", param:"" });
shortcutsDown.push({ie *, func_name:"shortcut_call_path", param:"node/add" });I believe "shortcut_call_path" string needs to be removed from s_type 3 (EXTERNAL) shortcuts but I have been unable to determine where the logic structure is in the module to do so.
In summary, it looks like the array suggestion needs to implemented while the s_type 3 (EXTERNAL) logic may need tweaking.
Other Suggestions:
Comments
#1
on my site too
Fatal error: Unsupported operand types in /var/www/web3/html/includes/common.inc on line 1445
#2
Subscribing - seeing this error as well
#3
I have not reviewed or followed up on my earlier note. I hope to try over the next few days.
#4
I am getting the same error. Could be a useful mudule. Is this module supported anymore?
#5
i just installed it. Got the same error. Is this module supported anymore???
#6
looks as if this is unsupported, but I thought I would add the same error. Fatal error: Unsupported operand types in ****/public_html/crm/includes/common.inc on line 1582. I am now using d6.15 so the line # is different.
#7
About the use of destination in the l() function is fixed in version 6.x-1.2
Also the issue with external url's.
Now, about:
I will consider this suggestions for version 6.x-1.3
~Nestor
#8
As the bug report is fixed, I'll change category to feature request to do the suggestions as requests.
#9
A new version will come out soon