Magento 2.1.7: Unable to process binding "attr: function (){return {id:'billing-address-same-as-shipping-'+ getCode($parent)} }" - magento2

I get an error on my checkout payment page:
knockout.js:3012 Uncaught ReferenceError: Unable to process binding "attr: function (){return {id:'billing-address-same-as-shipping-'+ getCode($parent)} }"
Message: getCode is not defined
at attr (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:3:158)
at update (knockout.js:3659)
at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
at evaluateImmediate (knockout.js:1737)
at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
at knockout.js:3002
at Object.arrayForEach (knockout.js:151)
at applyBindingsToNodeInternal (knockout.js:2974)
at applyBindingsToNodeAndDescendantsInternal (knockout.js:2854)
at applyBindingsToDescendantsInternal (knockout.js:2836)
Does somebody knows how to get this fixed?

Related

NodeJS function on AWS Lambda with mjml returns undefined

I´m implementing an Serverless stack on AWS with a Lambda function that submits an email formatted with MJML library in HTML format.
When trying to isolate the issue, I´ve created a simple function with the next code that runs on AWS lambda and it on itself doesn´t run (the rest does):
import mjml2html from 'mjml';
export async function sendEmail(){
console.log("sendEmail reached");
return mjml2html(`
<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-image width="100px" src="/assets/img/logo-small.png"></mj-image>
<mj-divider border-color="#F45E43"></mj-divider>
<mj-text font-size="20px" color="#F45E43" font-family="helvetica">Hello World</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
`);
Even with this simple function, when calling the AWS lambda, I always get the following error and the console.log() isn´t executing, so I assume the error happens already at the import time:
"errorType": "TypeError",
"errorMessage": "Cannot read property '1' of undefined",
"stack": [
"TypeError: Cannot read property '1' of undefined",
" at isFileType (fs.js:178:19)",
" at Object.readFileSync (fs.js:367:16)",
" at /var/task/src/handlers/webpack:/uglify-js/tools/node.js:20:19",
" at Array.map (<anonymous>)",
" at /var/task/src/handlers/webpack:/uglify-js/tools/node.js:19:30",
" at Object.7199 (/var/task/src/handlers/webpack:/uglify-js/tools/node.js:24:1)",
" at ni (/var/task/src/handlers/webpack:/webpack/bootstrap:19:32)",
" at Object.56069 (/var/task/src/handlers/webpack:/html-minifier/src/htmlminifier.js:8:16)",
" at ni (/var/task/src/handlers/webpack:/webpack/bootstrap:19:32)",
" at Object.1510 (/var/task/src/handlers/webpack:/mjml-core/lib/index.js:100:21)"
]
}
I´ve looked for info on the same issue in mjml repo, mjml documentation, this forum... but no luck.
Could anybody help me identify the issue?
Thanks a lot.

Mat Dialog not displayed after upgrading to angular 13

I'm getting below 2 errors while trying to open mat dialog component. All the configuration is completely used as per the guidelines. But I'm not able to solve this error.
core.mjs:6485 ERROR Error: NG0203: inject() must be called from an injection context
at injectInjectorOnly (core.mjs:4759:1)
at ɵɵinject (core.mjs:4769:1)
at NodeInjectorFactory.InfoDialogComponent_Factory [as factory] (ɵfac.js? [sm]:1:1)
at getNodeInjectable (core.mjs:3565:1)
at instantiateRootComponent (core.mjs:10181:1)
at createRootComponent (core.mjs:12285:1)
at ComponentFactory.create (core.mjs:21638:1)
at ViewContainerRef.createComponent (core.mjs:22902:1)
at CdkPortalOutlet.attachComponentPortal (portal.mjs:535:38)
at MatDialogContainer.attachComponentPortal (dialog.mjs:174:35)
core.mjs:6485 ERROR TypeError: Cannot read properties of undefined (reading 'focusInitialElementWhenReady')
at MatDialogContainer._trapFocus (dialog.mjs:248:33)
at MatDialogContainer._onAnimationDone (dialog.mjs:338:22)
at MatDialogContainer_animation_dialogContainer_done_HostBindingHandler (dialog.mjs:371:100)
at executeListenerWithErrorHandling (core.mjs:15019:1)
at wrapListenerIn_markDirtyAndPreventDefault (core.mjs:15057:1)
at animations.mjs:189:34
at _ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25592:1)
at _ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)

Magento 1 order creation with disabled produt via soap API

I'm using Magento 1.7 and I want to create an order via magento SOAP API with "disabled" product in it.
Is it possible?
Code:
// create order
echo "\nI will create the order: ";
$resultOrderCreation = $proxy->call($sessionId,"cart.order",array($shoppingCartId, null, $licenseForOrderCreation));
echo "\nOrder created with code:".$resultOrderCreation."\n";
Here is the error trace:
I will create the order:
Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Call to
a member function getId() on a non-object in test2.php:175 Stack
trace:
0 test2.php(175): SoapClient->__call('call', Array)
1 test2.php(175): SoapClient->call('6e2ee08630a720a...', 'cart.order', Array)
2 {main} thrown in test2.php on line 175
You need to change Mage_Sales_Model_Quote_Address_Total_Subtotal::_initItem.
Specifically row with code:
if (!$product || !$product->isVisibleInCatalog()) {
return false;
}
Remove/Customize !$product->isVisibleInCatalog().

How can I use a different email send method for the Accounts.sendEnrollmentEmail method in Meteor?

I use Mandrill to send emails from within Meteor. I don't have the default email method configured. I use this smart package https://github.com/Wylio/meteor-mandrill
Is there a way to change the Accounts.sendEnrollmentEmail method to use a smart package to send the email?
Right now I get the error below when I try to use that method.
Here is my error trace
message: Invalid login - 435 4.7.8 Error: authentication failed:
421 4.7.0 ip-10-102-139-231 Error: too many errors stack:
AuthError: Invalid login - 435 4.7.8 Error: authentication failed:
at Object.Future.wait (/Users/Bechard/.meteor/packages/meteor-tool/.1.0.36.15lvyk8++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:326:15)
at smtpSend (packages/email/email.js:91)
at Object.Email.send (packages/email/email.js:168)
at Object.Email.send (packages/meteorhacks:kadira/lib/hijack/email.js:9)
at Object.Accounts.sendEnrollmentEmail (packages/accounts-password/password_server.js:460)
at Object.Utils.create_user (app/server/lib/globals.js:83:22)
at Meteor.methods.singleDonation (app/server/methods/donate.js:73:36)
at methodMap.(anonymous function) (packages/meteorhacks:kadira/lib/hijack/wrap_session.js:182)
at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1599)
at packages/ddp/livedata_server.js:648
- - - - -
421 4.7.0 ip-10-102-139-231 Error: too many errors
at SMTPClient._actionAUTHComplete (/Users/Bechard/.meteor/packages/email/.1.0.4.ioat51++os+web.browser+web.cordova/npm/node_modules/simplesmtp/lib/client.js:826:23)
at SMTPClient._onData (/Users/Bechard/.meteor/packages/email/.1.0.4.ioat51++os+web.browser+web.cordova/npm/node_modules/simplesmtp/lib/client.js:329:29)
at CleartextStream.emit (events.js:95:17)
at CleartextStream.<anonymous> (_stream_readable.js:748:14)
at CleartextStream.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:410:10)
at _stream_readable.js:403:7
at process._tickCallback (node.js:419:13)
Turns out I didn't declare the Mandrill key in my startup function.
I originally had this
Meteor.startup(function() {
return Meteor.Mandrill.config({
username: Meteor.settings.mandrillUsername
});
});
I changed it to this and the email sent fine.
Meteor.startup(function() {
return Meteor.Mandrill.config({
username: Meteor.settings.mandrillUsername,
"key": Meteor.settings.mandrillKey
});
});

SoapClient error fallback in PHP

In PHP, if you try to instantiate a new SoapClient, and the WSDL is not accessible (server down or whatever), a PHP fatal error is thrown:
Fatal error: SOAP-ERROR: Parsing WSDL:
Couldn't load from
'http://example.com/servlet/app/SomeService?wsdl'
: failed to load external entity
"http://example.com/servlet/app/SomeService?wsdl"
Fatal errors in PHP, as far as I know, are not recoverable.
Is there any way to fallback from this? Can this fatal error somehow be avoided?
Edit: I should say that I am running on PHP 5.2, if it makes any difference.
This has already been discussed :
https://bugs.php.net/bug.php?id=47584
http://www.php.net/manual/en/class.soapclient.php#104046
Rasmus himself proposed the following solution:
<?php
try {
$x = #new SoapClient("non-existent.wsdl",array("exceptions" => 1));
} catch (SoapFault $E) {
echo $E->faultstring;
}
echo "ok\n";
See this topic How do I catch a PHP Fatal Error
Basically you cant recover from a fatal error but you can provide a better experience to the user when registering a shutdown function
register_shutdown_function('handleShutdown');
function handleShutdown(){
$error = error_get_last();
if($error !== NULL){
echo "Sorry for the inconvenience, an error just occurred.";
}
}