Uncaught TypeError: Cannot read property 'Version' of null in outlook-web-16.01.js - outlook-addin

outlook-web-16.01.js:13 Uncaught TypeError: Cannot read property 'Version' of null
at Object.callback (outlook-web-16.01.js:formatted:4686)
at rt (outlook-web-16.01.js:formatted:4272)
This is what I get when I tried to use
Office.context.auth.getAccessTokenAsync(function (result) {

After overriding everything inside <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1"> problem has solved.
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
...
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
...
<WebApplicationInfo>
<Id>9b096de7-56af-4b5c-bab5-360fcdf1b2e2</Id>
<Resource>api://localhost:44349/9b096de7-56af-4b5c-bab5-360fcdf1b2e2</Resource>
<Scopes>
<Scope>user.read</Scope>
<Scope>files.read</Scope>
<Scope>profile</Scope>
</Scopes>
</WebApplicationInfo>
</VersionOverrides>
</VersionOverrides>

As far as we can see this is a Microsoft bug and is fixed by switching to "Try the new Outlook".
It appears that the current (legacy) UI is trying to access a method that is available only in the "new" API. The only solution would be to modify Microsoft's Javascript API to add the Version property (and link to your own imported version of this rather than the CDN), or wait until Microsoft completes the switch-over.

Related

PrestaShop Call to undefined method FrontController::parseCMSContent() after update to 1.7.8.2

I created some custom shortcodes for my PrestaShop by creating a file (override/classes/controller/FrontController.php) with a method like :
public static function parseCMSContent($content)
{
...
}
And in my module and cms smarty templates I changed:
{$cms.content nofilter}
to:
{FrontController::parseCMSContent($cms.content) nofilter}
Everything was working fine with Prestashop 1.7.7.5, but the update to 1.7.8.2 broke the whole thing.
I get a 500 error saying :
PHP Fatal error: Uncaught Error: Call to undefined method FrontController::parseCMSContent() ... .module.pscustomtextpscustomtext. ...
It's still working fine with debug mode enabled though..
I can't find anything about the function being deprecated, any idea on how I could get this working again please?
In case this can help anyone, I fixed this by moving my override into a new smarty plugin.
I created a file vendor/smarty/smarty/libs/plugins/function.get_shortcoded_content.php
I added my shortcodes in:
function smarty_function_get_shortcoded_content($params, &$smarty)
{
...
}
And in my smarty files I called:
{get_shortcoded_content content=$cms.content}
instead of:
{$cms.content nofilter}
It seems to work all fine again.

Flow saying "Required module not found" for <Image> sources

We have an existing React Native project (version 0.22.2) and I'm trying to set up the Flow type checker (version 0.23) on certain files. However, Flow is giving a lot of errors for the require()s calls we're using for <Image> sources. For example, we have this code in one of our components in Header.js:
<Image source={require('./images/nav.png')} style={styles.navIcon} />
Which React Native handles fine and it works. However, Flow seems to be trying to treat the require() as a regular module require and not finding it, and giving errors like this:
Header.js:30
30: <Image source={require('./images/nav.png')} style={styles.navIcon} />
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ./images/nav.png. Required module not found
How can I tell Flow to stop giving these errors? I've tried adding .*/images/.* to the [ignore] section of my .flowconfig, but that doesn't change anything.
You can use the module.name_mapper.extension option in .flowconfig. For example,
[options]
module.name_mapper.extension= 'png' -> '<PROJECT_ROOT>/ImageSourceStub.js.flow'
which will map any module name ending in .png to an ImageSourceStub module, as if instead of writing require('./foo.png') you had written require('./path/to/root/ImageSourceStub').
In ImageSourceStub.js.flow you can do
const stub = {
uri: 'stub.png'
};
export default stub; // or module.exports = stub;
so that Flow knows that require('*.png') returns a {uri: string}.
See also the Advanced Configuration docs.
I don't have a real answer besides to say that flow in React Native seems really dodgy today and it would not surprise me if flow just simply doesn't support this usage at all, but I'd love to be totally surprised!
Personally, as a work-around, I'd just add a higher level component and ignore the flow errors in that file.
// Picture.js
// (No #flow tag at top of file)
const Picture = ({ source }) => (
<Image source={require(source)} />
)
Then use <Picture source="my/path/pic.jpg" /> instead.
Had same issue, for JPG files, solved with this .flowconfig
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.jpg$' -> 'RelativeImageStub'

Titanium : How to load an external custom AlertDialog in Alloy?

I code all my project in Alloy, so no classic Titanium here.
I want to load an external custom AlertDialog (located in views/popup.xml) in my index. So my need is to show an alert and destroy it (for ie.) by clicking the OK button. The Help button should do another action.
My popup.xml file :
<Alloy>
<AlertDialog id="popup" title="Error popup"
message="There is an error" cancel="1">
<ButtonNames>
<ButtonName>OK</ButtonName>
<ButtonName>Help</ButtonName>
</ButtonNames>
</AlertDialog>
</Alloy>
My index.js file :
function openPopup(e) {
var page = Alloy.createController('views/popup').getView();
page.show();
};
openPopup();
But this gives me an error :
[DEBUG] [iphone, 8.1, 192.168.0.1] Native
module:alloy/controllers/views/popup
[ERROR] [iphone, 8.1, 192.168.0.1] Couldn't find module:
alloy/controllers/views/popup
[ERROR] [iphone, 8.1, 192.168.0.1] TypeError: 'undefined' is not a
constructor (evaluating 'new (__p.require("alloy/controllers/" +
name))(args)')
I have no popup.js and I didn't require any file in index.js too. So my questions are : How to load a controller dynamically? How to remove (or destroy) it with an addEventListener on "click" action? Thank you.
Agree with turtle. When you create a controller it implicitly knows you are referring to a view in the the app/views directory.
And you should improve your code slightly by not creating a local variable (for garbage collection purposes). So instead of:
var page = Alloy.createController('views/popup').getView();
page.show();
You should just do:
Alloy.createController('views/popup').getView().open();
You can find more info about this in a splendid article by Fokke Zandbergen.
/John

Primefaces p:fileUpload not working [duplicate]

This question already has an answer here:
Manually adding / loading jQuery with PrimeFaces results in Uncaught TypeErrors
(1 answer)
Closed 7 years ago.
Im using Primefaces4.0 with JSF2.0, i know some basics of Primefaces.
For me p:fileUpload is not working, it was working before. don't know what happend
when i select any file from the file chooser no file populated in file pan of p:fileUpload.
here is my code:
<p:panel style="font-size:15px;" header="Upload">
<p:fileUpload fileUploadListener="#{addAgentxls.handleFileUpload}" mode="advanced" dragDropSupport="true"
update="messages status" sizeLimit="100000" style="font-size:12px;" />
<p:growl id="messages" showDetail="true"/>
<p:outputLabel id="status" style="font-size:13px;" value="#{addAgentxls.status }"/>
</p:panel>
class file:
#ManagedBean(name = "addAgentxls", eager = true)
#SessionScoped
public class AddAgentUsingXLS {
public AddAgentUsingXLS(){
}
public void handleFileUpload(FileUploadEvent event) {
FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
web.xml:
<!-- File Uploading Constraints -->
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
i also see This done nothing for me
there is an error on google chrome browser
Uncaught TypeError: Object [object Object] has no method 'fileupload'
fileupload.js.xhtml?ln=primefaces&v=4.0:1
does it worth anything?
Solved.. ! i was using newer version of jQuery.js which was conflicting with Primefaces
please consider the suggestion on the following stack overflow link.
In JavaScript can I make a "click" event fire programmatically for a file input element?
Same issue. jQuery(".primeFacesHiddenAwayButton type=['file']").click() worked fine on IE as well as firefox ( My firefox is not the latest due to Selenium driver constraints). In any case, in chrome the JS button simply did not work. This is, apparently, a security feature built into the browser. You can try the suggestion on the provided link.

Migrating code from OpenLaszlo 3.3 to 5.0: TypeError #1007 Instantiation attempted on a non-constructor.

I ported some parts of the code from OL 3.3 to OL 5.0 recently. I thought that everything will work but when i try to run it using the ant script i have I am getting this error.
[echo] C:\Program Files\OpenLaszlo Server 5.0.x\Server\lps-5.0.x/WEB-INF/lps/server/bin/lzc.bat
[exec] Compiling: C:\Workspace\application\client\src\TestClient.lzx to TestClient.swf10.swf
[exec] compiler output is Loading configuration file C:\Program Files\OpenLaszlo Server 5.0.x\Server\lps-5.0.x\WEB-INF\frameworks\flex-config.xml
[exec] C:\Documents and Settings\310773\Local Settings\Temp\lzswf9\Workspace\application\client\src\build\TestClient\app.swf (289808 bytes)
So, I took the folder and i compiled it directly in Laszlo. It's not showing any error but when the swf is about to load the main page I am getting this error. Any idea why?
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at $lzc$class__mvz/$mvx()
at LzNode/__LZresolveReferences()
at LzNode/__LZcallInit()
at LzCanvas/__LZcallInit()
at LzCanvas/__LZinstantiationDone()
at LzInstantiatorService/makeSomeViews()
at LzInstantiatorService/checkQ()
at Function/http://adobe.com/AS3/2006/builtin::call()
at LzEvent/sendEvent()
at LzIdleKernel$/__update()
That's the error message you get when you try to instantiate a class which is not defined. Here is an example:
<canvas>
<class name="myclass">
<handler name="oninit">
// Instantiate a class which is not defined
var x = new lz.missingclass();
</handler>
</class>
<myclass />
</canvas>
Check for missing <includes> of classes which are being instantiated through scripts. You can always check the list of Adoboe Flash Run-Time Errors as well, sometimes there is useful information contained here.
Edit: Solution to problem added
This commment pointed to the problem:
I found that this line is causing the problem. <attribute name="dp"
value="$once{new lz.Datapointer()}" />. Any idea why?
If you check the OpenLaszlo reference for 5.0, you will see that the class names (on the left side in the class browser) use different case; some classes use camel case (lz.Browser, lz.DataElement), others use all lowercase (lz.view, lz.datapointer). In your case, you should have used lz.datapointer instead of lz.Datapointer.
Therefore this code will compile and run without any problems:
<canvas>
<class name="my_class" extends="node">
<attribute name="dp" value="$once{new lz.datapointer()}" />
</class>
<my_class oninit="Debug.inspect(this.dp)" />
</canvas>
A good way to test for the correct name of a class is to use the JavaScript in console in DHTML runtime, where you have auto-completion for lz.??? classnames:
Debugging SWF #1007 errors in OpenLaszlo
If you run into a #1007 error in the SWF runtime, I would compile the application for DHTML with the debugger disabled and the JavaScript error console open. Try this:
Change the line of with the $once{} constraint to
<attribute name="dp" value="$once{new lz.Datapointer()}" />
Compile the app in Chrome using DHTML runtime and debug=false. You should see the following error in the JavaScript console:
Click on the right side on error-1007.lzx:3, and you'll see the generated JavaScript code with the line causing the error
This line fails:
this.setAttribute("dp",new (lz.Datapointer)())
and you can even reproduce the error by typing new (lz.Datapointer) into the console.
Just as a point of info: The case of class names was "regularized" in 4.0 so that the case of a class that implements a tag is the same as that tag. See Mapping Class and Tag Names.
Here is an example of the problem and a workaround:
1) PROBLEM:
Here is the code of a short OpenLaszlo application demonstrating the problem:
<canvas width="1000" height="584">
<view name="myContainer" width="500" height="500">
<handler name="oninit">
var objCB = new lz.combobox(this);
</handler>
</view>
</canvas>
In this example there is no <combobox> tag in the application so the compiler does not think it needs to include the OpenLaszlo <combobox> class code in the application. Hence, when we try to instantiate a combobox with the line "var objCB = new lz.combobox(this);" the compiler throws the following error:
ERROR #test1007error.lzx≈5: TypeError: Error #1007: Instantiation
attempted on a non-constructor.
2) WORKAROUND:
The solution for the problem is to add an include in your application for <combobox>:
<canvas width="1000" height="584">
<include href="lz/combobox.lzx" />
<view name="myContainer" width="500" height="500">
<handler name="oninit">
var objCB = new lz.combobox(this);
</handler>
</view>
</canvas>
This time the error is not thrown and we see the combobox appear at the top left of the application when we run it.