Serious problem with Qooxdoo 5.0.2 RpcPhp and PHP 7.x - qooxdoo

This example code work Ok with PHP 5.x, but using PHP 7.x I get bad response.
(sorry my english!)
This code should trigger a failed event, instead trigger a aborted event.
I'm using Windows 10 x64, xampp-windows-x64-7.3.6-0-VC15 (standard installation), Qooxdoo 5.0.2. and RpcPhp 1.2.0 contrib.
On Base.php you can try any of method_prueba.
Please anyone can help me with this problem. I have huge problems with my old projects. Thanks
I had forgot, I test several servers/xampp configuration (linux/windows, etc), sometimes the problem appear, sometimes not. I can't detect the origin. I think about RpcPhp 1.2.0 + PHP 7 (and maybe Windows) combined. Or some PHP 7 particular configuration.
More crazy, sometimes I get a aborted event, and sometimes I get a failed event but with code 500 and message "Server error". All with this simple example below.
Javascript:
var rpc = new qx.io.remote.Rpc("services/", "comp.Base");
rpc.addListener("completed", function(e){
var data = e.getData();
alert("completed");
}, this);
rpc.addListener("failed", function(e){
var data = e.getData();
alert("failed");
alert(qx.lang.Json.stringify(data, null, 2));
}, this);
rpc.addListener("aborted", function(e){
var data = e.getData();
alert("aborted");
alert(qx.lang.Json.stringify(data, null, 2));
}, this);
rpc.callAsyncListeners(false, "prueba");
Base.php:
class class_Base
{
public function method_prueba($params, $error) {
$error->SetError(0, "prueba");
return $error;
}
/*
public function method_prueba($params, $error) {
throw new JsonRpcException("prueba", 0);
}
*/
}

well, the problem was the handleQooxdooDates constant, from RpcPhp 1.2.0 contrib. Setting false the problem disappear using PHP7.
After 2 years... the solution "came" to me

Related

Protractor Fails on Build Server - ElementNotVisibleError

All my angular e2e tests using protractor with cucumber are running smooth and fine on my machine. But as soon as I run the tests on the build server, I get an error
ElementNotVisibleError: element not visible
Session info: chrome=51.0.2704.84
Driver info: chromedriver=2.21.371459
platform=Windows NT 6.1 SP1 x86_64
In the beginning, I thought this has something to do with timing, some asynchronous stuff that is happening but after hours of debugging I can finally reproduce the bug even on my local machine.
Minimizing the window is not enough but if I quickly drag the mouse to make the window as small as possible, I get this error. So it is just a matter of "window size".
Thus the error message is quite ok, but how are protractor meant to
run on a build server?
And why are some tests passing? Protractor seems to "see" something on the build server, thus
I tried
browser.driver.manage().window().maximize();
I tried
browser.manage().window().setSize(1920, 1200);
and I tried to change my code as suggested here and I tried a lot of more (hopeless) things. Nothing worked.
My big question now: How can I run a protractor test in a stable fashion on a build server (in my case TFS) when there is a rightmost button I want to click on some page?
Short code sample:
browser.get(browser.baseUrl + '#/somePage').then...
element(by.id(buttonId)).click();
Thank you!
UPDATE:
The main reason for my problems was the fact that the screen resolution while running the test on the build server had a width of 1024 and thus setSize(1920, 1200) failed. For that reason I now added an output of the current resoltuion in the onPrepare function, so that I will get a hint in the future:
onPrepare: function () {
browser.executeScript('return { height: screen.availHeight, width: screen.availWidth, top: screen.availTop, left: screen.availLeft};').then(function (result) {
console.log("Screen resolution: ");
console.log(result);
});
browser.manage().window().setSize(1920, 1200);
Of course this could be extended a little bit to throw an exception or something like this.
Sometimes, we need to bring the desired element into view in order to avoid "Element not visible" error. We can do that in two general ways:
use "browser actions":
var elm = element(by.id("buttonid"));
browser.actions().mouseMove(elm).click().perform()
scroll into view:
var elm = element(by.id("buttonid"));
browser.executeScript("arguments[0].scrollIntoView();", elm.getWebElement());
Also linking this answer that has a nice set of things you can try to tackle the problem.

App Certification fails because of PreLaunch Test

When I run the App Certification on my Template 10 based app, I get the following error:
Error Found: The app prelaunch validation detected the following errors:◦The app failed prelaunch test - 49581RisingSoundMedia.ElectionCentral_1.1.7.0_x64__xrbjpqg44kdgm.
•Impact if not fixed: The app will take a longer time to launch, even when prelaunch is enabled.
•How to fix: In the OnLaunched method implementation of the app, ensure you handle the LaunchActivatedEventArgs.PreLaunch option to be prelaunch event aware.
Obviously I can't override the OnLaunched even with Template 10 because the Bootstrap class seals it.
I tried overriding the OnPreLaunchAsync and setting continueStartup = false; but it did not fix the problem.
Any ideas?
This seems to be a known issue with Windows App Cert Kit: https://developer.microsoft.com/en-us/windows/develop/app-certification-kit
"The App Prelaunch Validation test will fail ig you run on a version of Windows-10 released before version 1607(Windows Anniversary Edition). Note that this test is not run as part of the final certification for Windows Store submissions"
Resolution: To ensure the results to this test pass, test with Windows-10 SDK Version (14393) running on Windows-10 Anniversary Edition.
Turns out that I was able to publish to the store, and it passed certification even though it failed the local Windows App Cert Kit locally.
Yes i had this problem, first have you updated to the lastest version of Template 10 (1.1.4): https://www.nuget.org/packages/template10
Next what I had to do was move all of my code that was in OnInitializeAsync and OnStartAsync that was in app.xaml.cs into the App().
You need to keep OnInitializeAsync and OnStartAsync as lean as possible, you should keep only the essential Template10 code in them and add your specific code in App().
public override Task OnInitializeAsync(IActivatedEventArgs args)
{
// content may already be shell when resuming
if ((Window.Current.Content as ModalDialog) == null)
{
// setup hamburger shell
var nav = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);
Window.Current.Content = new ModalDialog
{
DisableBackButtonWhenModal = true,
Content = new Shell(nav),
ModalContent = new Views.Busy(),
};
}
return Task.CompletedTask;
}
public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
{
NavigationService.Navigate(typeof(MainView));
return Task.CompletedTask;
}
In App() I added all my my initialization methods for my app so my App() looks liek this:
public App()
{
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
WindowsCollectors.Metadata |
WindowsCollectors.UnhandledException |
WindowsCollectors.PageView |
WindowsCollectors.Session
);
this.InitializeComponent();
var element = new ViewModelLocator();
//Template10.Services.LoggingService.LoggingService.Enabled = true;
//Template 10 stuff
// DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-Cache
CacheMaxDuration = TimeSpan.FromDays(1);
// DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-BackButton
ShowShellBackButton = SettingsService.Instance.UseShellBackButton;
// DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-SplashScreen
SplashFactory = (e) => new Views.Splash(e);
//My code here
ApiRoot.Instance.Init();
InitDeviceTypeAndResource();
InitApiLanguage();
InitAppLanguage();
InitABCRatings();
//For updating Tiles
RegisterBackgroundTask();
}
I hope that this helps you out!

invalid cross-thread access in release

I have a lightswitch application needs to generate Crystal Report from it's WCF Ria. In the development runtime I am able to generate correctly without errors, but when I push it to release environment it prompt error - invalid cross-thread access.
I've read some articles already and it is very likely Silverlight UI Thread problem
partial void GenerateReport_Execute()
{
try
{
GenerateCrystalReport.Load();
var temp = DataWorkspace.QUMCrystalReportDomainData.GenerateCrystalReport(SearchQuery.SelectedItem.GroupId, sQuarter, sYear, eQuarter, eYear);
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate()
{
var uri = new Uri("C:\\Temp\\ReportTest.pdf", UriKind.RelativeOrAbsolute);
if (AutomationFactory.IsAvailable)
{
var shell = AutomationFactory.CreateObject("Shell.Application");
shell.ShellExecute(uri.ToString());
}
else if (!System.Windows.Application.Current.IsRunningOutOfBrowser)
{
HtmlPage.Window.Navigate(uri, "_blank");
}
else
{
throw new InvalidOperationException();
}
});
}
catch ( Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
Am I doing incorrectly? please help me identify this.
Thanks in Advance
Sam
Answering my question, basically that messagebox at bottom is causing the UI problem.
Lightswitch's dispatcher is not same as wpf's dispatcher(what that messagebox uses), please correct if I'm wrong

Qooxdoo on window ready

I was just trying to fire an event after the qooxdoo application is ready, so I started with the "Hello World" app and appended the recommendation at the very end of the main function:
main : function(){
// Hello World part...
qx.event.Registration.addListener(window, "ready", function() { alert("application ready"); });
}
but, it didn't appear to fire in chrome or firefox (I didn't test IE), so I dug some more and found this and it worked.
if (qx && qx.event && qx.event.Registration)
{
var manager = qx.event.Registration.getManager(window);
var handler = manager.findHandler(window, "ready");
if (handler.isApplicationReady()) {
alert("application ready");
}
}
Can anyone tell my why the recommended method does not work or am I putting it in the wrong place?
Thanks!
Did you get the "recommendation" from the "From jquery to qooxdoo" document?! (It always helps if you cite your sources).
I think you are mixing things here. First, "window ready" is not the same as "application ready". I think "window ready" (as shown in a linked manual page) is a low-level event of the global JS window object. If you are running a high-level qooxdoo application (as it appears) this event has long passed when you register for it in your main method. So the event handler is never run.
In your second code sample you are not listening for an event, but checking a status with isApplicationReady(). This status can return true long after the event that turned the app from non-ready to ready has passed.
override simply the finalize function in the member area of the Application
finalize : function()
{
// Call super class
this.base(arguments);
alert("Hello World");
}
More simple!!!
QX Core Widget "appear" event is equal the same as "onReady" event such in other JS Frameworks like YUI, JQuery or whatever....
http://www.qooxdoo.org/5.0.2/api/#qx.ui.core.Widget~appear!event
has the same effect.
best, Tamer

ExtJS 4 - Load Mask giving errors in IE8 and IE9 when used while opening a window

I have a window which opens up on a button click. The window takes time to load and hence I am using load mask in following way:
handler:function(){
var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Loading..."});
myMask.show();
var winAppln = showWin(myMask);
if(winAppln){
var task = new Ext.util.DelayedTask(function(){
winAppln.show();
});
task.delay(2000);
}
}
I am hiding the mask object in the afterrender function of window in following way:
afterrender:function(){
if(maskObj){
maskObj.hide();
}
}
The above code works fine in all the browsers, except IE (version 9 and 8).
In IE9 and IE8, there is an error generated as "Invalid Argument" in ext-all-debug.js at line 8682 which is as following
me.dom.style[ELEMENT.normalize(style)] = value;
Could anyone guide that what can be a possible reason behind this.
Also, my main purpose is to cover the lag between the click of button & opening of window, so that user is aware about something is happening. Is there a better way of doing this other then using Load Mask, or could Load Mask be used in some different manner, then as shown above?
Thanks in advance.
PS: I am using ExtJS Version 4.0.7
As per the things found by me so far, this issue is caused when the window has modal:true set.
IE 8 and 9 create a conflict between loadMask and modal:true and throw an error.
A workaround for this is to take off modal:true from the window and set it to true in the afterrender event of window once the loadmask hide function has been called as below:
afterrender:function(){
if(maskObj){
maskObj.hide();
}
this.modal = true;
}
Hope this helps someone looking for the same.
There is a bug in ExtJS4 Ext.LoadMask which is a problem in Internet Explorer 7 and 8.
When showing a loading mask, ExtJs tries to figure out the zIndex of the parent element, then setting the zIndex of the loading mask. In Internet Explorer 7/8 an element could also have set the zIndex "auto". parseInt of the string "auto" is NaN. Setting the zIndex to NaN causes an error in IE7/IE8.
The solution: override LoadMask
Ext.override(Ext.LoadMask, {
setZIndex: function(index) {
var me = this,
owner = me.activeOwner;
if (owner) {
index = parseInt(owner.el.getStyle('zIndex'), 10) + 1;
}
if (!isNaN(index)) {
me.getMaskEl().setStyle('zIndex', index - 1);
return me.mixins.floating.setZIndex.apply(me, arguments);
} else {
return '';
}
}
});
This topic is discussed also in Sencha Forums:
http://www.sencha.com/forum/showthread.php?228673-LoadMask-and-setZIndex-and-NaN
http://www.sencha.com/forum/showthread.php?246839
Give it a try with
Ext.getBody().mask("Loading")
I use this instead of LoadMask just because in ext you can't mask more than one component with dimmed background color, .mask() does the trick. LoadMask is prettier, but has some issues, so .mask could work.

Resources