addCookie method throws 'addCookie called with non-cookie parameter' - cookies

I am struggling with this error message which has no direct forum discussion anywhere. From some of the things I saw around the web I tried:
Changing localhost to 127.0.0.1
Played around with browser.driver.manage() v/s browser.manage()
Cleaning out/updating my node modules
The same code runs on other machines with same configuration (Win 10, chromedriver 2 etc.)
The code essetially gets the cookie value through API calls before
and uses it as such:
browser.get(URL);
browser.manage().addCookie('cookie_name', value);
Any help would be appreciated!

Assumption that you are on Protractor 5.0.0. Adding cookies have been changed in selenium webdriver 3 and was noted as a breaking change in the Protractor changelog:
Before:
browser.manage().addCookie('testcookie', 'Jane-1234');
After:
browser.manage().addCookie({name:'testcookie', value: 'Jane-1234'});

The answer above did not work for me because i kept getting this error:
"Expected 2-6 arguments but got 1"
This is what I had to do to make it compile at least:
(browser.manage() as any).addCookie({name:'cookieName', value: 'cookieVal'});
Here is the thread I got this info from:
https://github.com/angular/protractor/issues/4148
It is still an open issue.

Related

ember-electron application start (code hierarchy)

I'm trying to move a very old 2.x ember-electron application to new electron with ember-electron and got application window with blank screen and error in console:
(node:9061) electron: Failed to load URL: serve://dist/ with error: ERR_FILE_NOT_FOUND
The calling file ../new-ember-electron/electron-app/src/index.js has lines from old applications:
const emberAppLocation = 'serve://dist';
mainWindow.loadURL(emberAppLocation);
File ../new-ember-electron/app/router.js has:
this.route('index', { path: '/' }, function() {}
Files ../new-ember-electron/app/routes/index.js, ../new-ember-electron/app/controllers/index.js and ../new-ember-electron/app/templates/index.hbs also exist.
So, it's unclear what exactly is not found and how to find a more detailed error (application developer console doesn't have errors). But if to change the mentioned 2 lines in ../new-ember-electron/electron-app/src/index.js to:
const emberAppLocation = '../app/index.html';
mainWindow.loadFile(emberAppLocation);
then application shows content of the correct file, despite nothing working in it, even <LinkTo>...</LinkTo> is not treated as a link.
Would you please help me to understand how an ember-electron application should be structured and which way is called for the recent versions?
Used versions: node - 16.14.0, electron: 17.0.1, ember-cli: 3.28.5, ember-electron: 3.1.0, OS: darwin x64.
Thank you.
Thank you, jacobq, I've looked at your example and used emberAppUrl to start from ember-dist/index.html file. After few more changes related to require/requireNode (fixed with webPreferences options in mainWindow) the app rendered index.html file. But a problem with app location happens again right on {{ content-for "body" }} in index.html: "Uncaught Error: Cannot find module 'app-name/app'" where app-name is the application name set up as 'name' in /package.json and as 'modulePrefix' in config/environment.js. The error itself comes from /node-modules/ember-cli/lib/utilities/ember-app-utils.js, 'contentFor' function called with 'app-boot'. The ember-cli itself constructs the /app-name/app path. So, the question now is what exactly ember-cli expects to find during the boot with the new structure? Or maybe some config variable should be added to let know Ember about the /app-name/app location?
Edited:
jacobq, yes, the only difference in index.html is application name: "testapp". RootURL is set in ../testapp/config/environment.js:
podModulePrefix: 'testapp/pods',
environment,
modulePrefix: 'testapp',
rootURL: process.env.EMBER_CLI_ELECTRON ? '' : '/',
locationType: process.env.EMBER_CLI_ELECTRON ? 'hash' : 'auto',
The full error:
It happens when testapp.js file is called from index.html, on code included from ember-cli:
if (!runningTests) {
require("testapp/app")["default"].create({"LOG_TRANSITIONS":true,"LOG_TRANSITIONS_INTERNAL":true});
}
First thing I'd like to plug is joining the #topic-desktop channel on the Ember.js community Discord server: https://discord.com/channels/480462759797063690/488735754139336714
(it's often easier to work things out by chatting there as there's lower latency than typically found with forum post/reply platforms)
Secondly, there are lots of breaking (but good) changes between ember-electron 2.x and 3.x, so I'd encourage you to work through the upgrade guide here: https://ember-electron.js.org/docs/guides/upgrading
That said, I suspect that the problem you're seeing is related to the change from serve:// to file://. Have a look at the demo app I just spun up here:
https://github.com/jacobq/ember-electron-demo
You can see the new emberAppURL here:
https://github.com/jacobq/ember-electron-demo/blob/cf7c5dee2cd975f8c67ed1dfc61eb717461f5b7d/electron-app/src/index.js#L13
Basically, ember-electron v3.x puts the usual dist output from ember build into <project_root>/electron-app/ember-dist/ now.
FWIW, I'm actually stuck on 3.0.0-beta.2 in my application because I am using IndexedDB and don't have migration code to deal with origin-related issues of switching to file:// scheme. I don't recommend that you use that version, but you could try it if you wanted to see if that changes the error you're encountering (because that beta still uses electron-protocol-serve).

How to get Instance name in CommandBox CF 2018?

I recently started using commandBox to run ColdFusion in my local environment. After I played around for a while one issue I run into was related to adminapi. Here is the code that I use in one of my projects:
adminObj = createObject("component","cfide.adminapi.runtime");
instance = adminObj.getInstanceName();
This code is pretty straight forward and work just fine if I install traditional ColdFusion Developer version on my machine. I tried running this on commandBox: "app":{ "cfengine":"adobe#2018.0.7" }
After I run the code above this is the error message I got:
Object Instantiation Exception.
Class not found: com.adobe.coldfusion.entman.ProcessServer
The first debugging step was to check if component exists. I simply checked that like this:
adminObj = createObject("component","cfide.adminapi.runtime");
writeDump(adminObj);
The result I got on the screen was this:
component CFIDE.adminapi.runtime
extends CFIDE.adminapi.base
METHODS
Then I tried this to make sure method exists in the scope:
adminObj = createObject("component","cfide.adminapi.runtime");
writeDump(adminObj.getInstanceName);
The output looks like this, and that confirmed that method getInstanceName exists.
function getInstanceName
Arguments: none
ReturnType: any
Roles:
Access: public
Output: false
DisplayName:
Hint: returns the current instance name
Description:
The error is occurring only if I call the function getInstanceName(). Does anyone know what could be the reason of this error? Is there any solution for this particular problem? Like I already mentioned this method works in traditional ColdFusion 2018 developer environment. Thank you.
This is a bug in Adobe ColdFusion. The CFC you're creating is trying to create an instance of a specific Java class. I recognize the class name com.adobe.coldfusion.entman.ProcessServer as being related to their enterprise manager which controls features only available in certain versions of CF as well as features only available on their "standard" Tomcat installation (as opposed to a J2E deployment like CommandBox).
Please report this to Adobe in the Adobe bug tracker as they appear to be incorrectly detecting the servlet installation. I worked with them a couple years ago to improve their servlet detection on CommandBox, but I guess they still have some issues.
As a workaround, you could try and find out what jar that class is from on a non-CommandBox installation of Adobe ColdFusion and add it to the path, but I can't promise that it will work and that it won't have negative consequences.

Redmine_RE plugin is not saving the data

i am using the Redmine.3.1.0.Then i have installed redmine_re plugin.But when i try to save the requirement using the Redmine_re plugin i am getting the following error
NameError (undefined local variable or method `connection' for #<ReArtifactRelationship:0x800ddb0>):
lib/plugins/acts_as_list/lib/active_record/acts/list.rb:220:in `bottom_item'
lib/plugins/acts_as_list/lib/active_record/acts/list.rb:214:in `bottom_position_in_list'
lib/plugins/acts_as_list/lib/active_record/acts/list.rb:205:in `add_to_list_bottom'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
pls suggest how to resolve this error
#ste26054
I did not develop this plugin, but I think the support for redmine 3.1.0 is only partial at the moment. (And you may get other errors even after fixing this).
I believe you are getting an error because of this: Deprecate #connection in favour of accessing it via the class
And your error is related to this file:
In this method:
def scope_condition()
"#{connection.quote_column_name("source_id")} = #{quote_value(self.source_id)}
AND
#{connection.quote_column_name("relation_type")} = #{quote_value(self.relation_type)}"
end
Try to add self.class. in front of connection
You may have to repeat this for other files in the code.
If your changes are working, I would suggest you to submit a pull request on their plugin github page :)

Facebook Comment widget returns "Content no longer available"

Following the upgrade from Graph 1.0 to Graph 2.0 the comment widgets have stopped working for me, returning the following JSON response following any attempt to post a comment:
{
bootloadable: {}
error: 1357031
errorDescription: "The content you requested cannot be displayed right now. It may be temporarily unavailable, the link you clicked on may have expired, or you may not have permission to view this page."
errorSummary: "This content is no longer available"
ixData: {}
lid: "0"
payload: null
}
I've been through the steps so far of regenerating the comment code, making sure the comment block code itself is set to use version 2.3 (as well as trying without this just to be safe). The error code itself doesn't return anything in the FB docs, and the only reference I can find to the error description is from 2 years ago to which FB noted that it was a server issue. Given that our comments have been broken (and thus hidden) for 2 months now I don't think that's the problem.
I've confirmed that the code pulls in sdk.js rather than all.js using the code they provide and I just can't seem to get it to work. Any help would be appreciated!
Have you have tried to re-upload these files?
admin.css
class-admin.php
class-fronted.php
facebook-comments.php

Symfony2 + DataFixtures + Capifony - FATAL ERROR Doctrine Proxies - Cannot redeclare unserialize()

For 2 weeks i'm struggling with fallowing problem.
Im using DataFixturesBundle to load my fixtures to database. Everything works fine.
I decided to use capifony (capistrano) to deploy my application on production.
That went well too. I have implemented all things i wanted capifony to do for me with my app on production server.
But I do get one error and I dont even know what bundle is causing that.
IMPORTANT This error only shows on production server, it does NOT matter if i'm on DEV or PROD environment ( also DEBUG ), but the error never shows on my local hosts (tested on 2 computers, mac & win ).
Fatal error: Cannot redeclare Proxies\TestBundleEntityPartnerProxy::unserialize() in /public_path/testapp.com/app/releases/20110929191120/app/cache/dev/doctrine/orm/Proxies/TestBundleEntityPartnerProxy.php on line 489
And that is right. Doctrine makes two the same methods both for unserialize() and both for serialize() in the same class (proxy).
This only happens on my production server. I can't even make the problem shows on my local host. On my local host there are no two methods with the same name (unserialize() and serialize()). There is one unserialize() and one serialize()
Any help would be appreciated.
Cheers, Bart
fixed here:
https://github.com/doctrine/doctrine2/pull/177
This is not capifony, but some edge case bug or situation. I'm not sure what's causing it yet. Some details here:
http://groups.google.com/group/symfony-devs/browse_thread/thread/435a19119e9d6bdb