Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix prototype 1.7 issues with google recaptcha (#57)
Browse files Browse the repository at this point in the history
* Update Observer.php

* Update config.xml

* update version

* Create prototype.js

* Update modman

* Update modman

* Delete proxiblue/recaptcha directory

* Create prototype.js

* Update modman
  • Loading branch information
empiricompany authored Jun 22, 2021
1 parent 13d28bc commit 4b73e22
Show file tree
Hide file tree
Showing 4 changed files with 7,073 additions and 2 deletions.
25 changes: 25 additions & 0 deletions app/code/community/ProxiBlue/ReCaptcha/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@
*/
class ProxiBlue_ReCaptcha_Model_Observer
{
/**
* Fix Incompatibility Google Recaptcha With Prototype 1.7
*/
public function fixPrototypeVersion() {
// Prototype update only in OpenMage from version 19.4.12
if(method_exists('Mage', 'getOpenMageVersion')) {
if (version_compare( Mage::getOpenMageVersion() , '19.4.12', '>=')){
return $this;
}
}

$head = Mage::app()->getLayout()->getBlock('head');
if (!$head) {
return $this;
}
$headItems = $head->getData('items');
if ( isset($headItems['js/prototype/prototype.js']) ) {
$headItems['js/prototype/prototype.js']['name'] = 'proxiblue' . DS . 'recaptcha' . DS . 'prototype.js';
$head->setData('items', $headItems);
}

return $this;

}

/**
* Check Captcha On Contact Us
*
Expand Down
12 changes: 11 additions & 1 deletion app/code/community/ProxiBlue/ReCaptcha/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<ProxiBlue_ReCaptcha>
<version>2.5.0</version>
<version>2.5.1</version>
<depends>
<Mage_Captcha/>
</depends>
Expand Down Expand Up @@ -94,6 +94,16 @@
</translate>
</adminhtml>
<frontend>
<events>
<controller_action_layout_render_before>
<observers>
<fixPrototypeVersion>
<class>proxiblue_recaptcha/observer</class>
<method>fixPrototypeVersion</method>
</fixPrototypeVersion>
</observers>
</controller_action_layout_render_before>
</events>
<layout>
<updates>
<proxiblue_recaptcha>
Expand Down
Loading

0 comments on commit 4b73e22

Please sign in to comment.