In the admin zone, when i open the firebug I'm getting this erros message:

TypeError: registry is undefined
var respondersForEvent = registry.get(eventName);

this errors message appears in prototype.js file. The error disappears when i added this line :

if (element === null) return;

after the function:

function _createResponder(element, eventName, handler) {
    if (element === null) return;
    var registry = Element.retrieve(element, 'prototype_event_registry');

    if (Object.isUndefined(registry)) {
      registry = Element.retrieve(element, 'prototype_event_registry', $H());

    var respondersForEvent = registry.get(eventName);
    if (Object.isUndefined(respondersForEvent)) {
      respondersForEvent = [];
      registry.set(eventName, respondersForEvent);

What i don't understand if this line of code affects in any way the magento functionalities? and what does this function actually do ?

1 Answer 1


Adding the line of code you did will prevent the error from happening, but whatever is triggering that is trying to do so on an element that does not exist, so nothing would have happened anyway.

This block of code creates the event observers when you call $('element').observe('event',function(){});

Since this is from the 1.7 version of PrototypeJS the actual DOM element object is passed into the method to register the event to that DOM element. In all the later versions (1.7.1,1.7.2) only an internal reference ID is passed into this method which is safer and more resource friendly.

  • where we need to add this line ? this will come after put this script on search function. <script type="text/javascript"> //<![CDATA[ var searchForm = new Varien.searchForm('search_mini_form', 'search', ''); searchForm.initAutocomplete('<?php echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete'); //]]> </script> Commented Feb 26, 2016 at 12:20
  • @PratikKamani first verify you are using version 1.7, the code block in the original question for the _createResponder function adds the line if (element === null) return; as the first line of the function. That swallows the error but doesnt get to the root of where the error is being generated from. Commented Feb 26, 2016 at 16:57
  • Hello @GeekNum88, I am facing the same error in my checkout page. And also the checkout steps are not expanding . I have used the line above " if (element === null) return" But got no result. Can you advice how to seek solution for this ? Commented Mar 10, 2016 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.