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

fix prototype 1.7 issues with google recaptcha #57

Merged
merged 9 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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