Skip to content

Commit

Permalink
Merge branch 'main' into gridproductimage
Browse files Browse the repository at this point in the history
  • Loading branch information
empiricompany authored Mar 6, 2024
2 parents e459ab6 + 304a23c commit ea049ba
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 75 deletions.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Oauth/Model/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ protected function _initToken()
if (self::REQUEST_TOKEN == $this->_requestType) {
$this->_validateVerifierParam();

if (!hash_equals($this->_token->getVerifier(), $this->_protocolParams['oauth_verifier'])) {
if (!hash_equals((string)$this->_token->getVerifier(), $this->_protocolParams['oauth_verifier'])) {
$this->_throwException('', self::ERR_VERIFIER_INVALID);
}
if (!hash_equals((string)$this->_token->getConsumerId(), (string)$this->_consumer->getId())) {
Expand Down
3 changes: 1 addition & 2 deletions app/code/core/Mage/Sales/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ public function prepareProductEditFormRecurringProfile($observer)
$dependencies = $block
->addFieldMap('is_recurring', 'product[is_recurring]')
->addFieldMap($profileElement->getHtmlId(), $profileElement->getName())
->addFieldDependence($profileElement->getName(), 'product[is_recurring]', '1')
->addConfigOptions(['levels_up' => 2]);
->addFieldDependence($profileElement->getName(), 'product[is_recurring]', '1');
$observer->getEvent()->getResult()->output .= $dependencies->toHtml();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@
grid.reloadParams = {'selected_products[]':categoryProducts.keys()};
}
function categoryProductRowClick(grid, event){
var trElement = Event.findElement(event, 'tr');
var tdElement = Event.findElement(event, 'td');
var isInput = Event.element(event).tagName == 'INPUT';
if(trElement){
var checkbox = Element.getElementsBySelector(trElement, 'input');
if(tdElement){
var checkbox = Element.getElementsBySelector(tdElement, 'input');
if(checkbox[0]){
var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
<?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);
Expand Down
84 changes: 42 additions & 42 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions js/mage/adminhtml/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,7 @@ FormElementDependenceController.prototype = {
* Misc. config options
* Keys are underscored intentionally
*/
_config : {
levels_up : 1 // how many levels up to travel when toggling element
},
_config : {},

getSelectValues : function(select) {
var result = [];
Expand Down Expand Up @@ -512,16 +510,20 @@ FormElementDependenceController.prototype = {
*/
trackChange : function(e, idTo, valuesFrom)
{
let upLevels = this._config.levels_up;
let ele;
if (!$(idTo)) {
var ele = document.getElementById(idTo), cnf = this._config;
if (!ele) {
idTo = 'row_' + idTo;
ele = $(idTo);
if (!ele) {
return;
}
} else {
ele = $(idTo).up(upLevels);
var closest = cnf.levels_up; // @deprecated
if ((typeof closest == 'number') && (closest > 1)) {
ele = ele.up(closest);
} else {
ele = ele.closest('tr');
}
}

// define whether the target should show up
Expand All @@ -548,11 +550,10 @@ FormElementDependenceController.prototype = {

// toggle target row
if (shouldShowUp) {
var currentConfig = this._config;
ele.select('input', 'select', 'td').each(function (item) {
// don't touch hidden inputs (and Use Default inputs too), bc they may have custom logic
if ((!item.type || item.type != 'hidden') && !($(item.id+'_inherit') && $(item.id+'_inherit').checked)
&& !(currentConfig.can_edit_price != undefined && !currentConfig.can_edit_price)) {
&& !(cnf.can_edit_price != undefined && !cnf.can_edit_price)) {
item.disabled = false;
}
});
Expand Down
3 changes: 0 additions & 3 deletions lib/Varien/Directory/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ public function lastDir()
*/
public static function getLastDir($path)
{
if ($path == '') {
$path = $this->getPath();
}
$last = strrpos($path, "/");
return substr($path, $last + 1);
}
Expand Down
8 changes: 2 additions & 6 deletions skin/adminhtml/default/openmage/form.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ea049ba

Please sign in to comment.