$2sxc is not defined - runtime-error

After adding Content module to a page, I just get a round blue icon with white glasses. Clicking on it produces an error in the console:
ReferenceError: $2sxc is not defined 1 ui.html:20:5
<anonymous> http://localhost/DotNetNuke/desktopmodules/tosic_sexycontent/dist/ng/ui.html:20:5
Clicking 'Change Template / Layout' in pencil menu also does nothing. This happened after upgrading from 2sxc 8.12 to 9.02. I checked the file and of course could not see $2sxc defined anywhere. I have installed on other sites and not had this problem, but it is failing on my localhost installation. DNN 9.1.1 I have tried uninstalling 2sxc and deleting all the Tosic... files I can find, then reinstalling, but I get the same results.
Similar to: Having some issues with 2sxc version 9.x: unable to select App/Content layout
Does anyone know how to fix this? Thx.

I fixed this after a little debugging and following the code. The problem happens on localhost implementations. There is a file: DesktopModules\ToSIC_SexyContent\dist\ng\ui.html
that contains the code in a script container:
var
path = window.location.pathname,
isDevMode = window.location.hostname === 'localhost',
apiUrl;
The problem is that it thinks it is in 'DevMode' when it is on localhost and therefore sets:
devPath = 'http://2sxc.dev/desktopmodules/tosic_sexycontent/dist/a4/';
which is certainly not a valid URL on my system, and apparently not on the web either. So the solution is to have it avoid 'DevMode' and everything works as it should. I did this by modifying the 'localhost' to be 'xlocalhost' and it worked like a charm. You could also just set it to false.

So this was a bug in that version, it's fixed now.

Related

unable to launch custom brackets.exe

I have created a desktop app using brackets-shell version sprint-38. I have done the following changes.
config.h -changed APP_NAME from 'Brackets' to 'MyBrackets'.
appshell_config.gypi - changed appname from 'Brackets' to 'MyBrackets'.
Gruntfile - changed build.name from 'Brackets' to 'MyBrackets'.
After building brackets-shell with these changes i used to get 'MyBrackets.exe'
inside brackets-shell/release folder.
while executing the exe one file chooser popup comes, and node & MyBrackets.exe processes will start in the background.
his works fine with Sprint38,But after migrating to brackets-shell tag version release-1.3 or master, this dose not work. The file chooser is not coming as well as no node process starts.
Is any thing i am missing with the latest release ?
Bingo!!!
I got the problem. actually xcopy command is not generating properly in MyBrackets.vscsproj file. and this is well know problem i think so. To fix this problem one fix-msvc.sh file has written.
Since brackets.vscsproj name is hardcoded here so changes is not reflecting in my MyBrackets.vscsproj

Why does Symfony2 set the error_reporting?

I've been trying to remove the E_NOTICE and E_STRICT error levels to avoid this error:
Runtime Notice: Only variables should be passed by reference
I tried modifying php.ini but didn't work, error_reporting always is -1. Then I tried setting it dynamically in the current action, and worked fine. Then I also tried the same in the first line in app_dev.php and didn't work. Which means Symfony2 is setting it dynamically somewhere.
What should I do?
EDIT
For those who are not familiar with the error:
$user = $this->('security.context')->getToken()->getUser();
$first = reset($user->getRoles()); // error
$roles = $user->getRoles();
$first = reset($roles); // works fine
Whilst the notice is not 'retarded', this is a reasonable question in other contexts so: this is set in the Kernel instance, instantiated in app_dev.php (or app.php).
The second parameter to the construct is a boolean debug flag, and if true then error_reporting is set to -1 and display_errors to 1, otherwise default and 0 respectively.
$kernel = new AppKernel('dev', false);
symfony documentation
Hope this helps.
I got the same error in the following scenario i.e.
Scenario:
I lost the development environment for my existing LIVE project. But I got the whole code from GIT repo and then installed the symfony 2.4.2 (same version as on LIVE site) in my new development environment. Then I found that the web-application pages working on the LIVE site are broken in my new DEV environment.
Solution:
I spent quit a lot time to understand why the problem is then I found that i.e.
When I installed symfony 2.4.2 in my development environment using composer.phar then it created a new web/app_dev.php file in my development environment and it has the following entry to turn it off i.e.
Debug::enable();
Just comment the above line then the php notices will be off and then all the pages that were giving me notices are fixed.
I hope this will be helpful for someone having the same problem like me. Good Luck!
Cheers.
PS: But I will recommend to enable the above line in your new development projects so that you can see the PHP notices and then remove them during development.

convert .WAR for auto deploy in karaf/servicemix

I've got very simple .WAR containing example servlet. I'm able to deploy it in servicemix using the following command:
osgi:install file:///home/seiho/apache-servicemix-4.4.2/deploy/TestServlet.war?Bundle-SymbolicName=TestServlet&Webapp-Context=/TestServlet
And then see it in my browser. But only with full path to a file, e.g.: localhost:8080/TestServlet/index.html or localhost:8080/TestServlet/TestServlet (my servlet is TestServlet class).
I'd like to launch the index.html page automatically after entering: localhost:8080/TestServlet
how to do it?
MORE IMPORTANT
I need a way to convert the .WAR file or servlet project (I've got the sources) so that new .WAR file can be auto-deployed by copying it to $SERVICEMIX_HOME/deploy directory.
I've tried editing the MANIFEST.MF file, but with no success. Probably I'm doing something wrong.
Thanks for any advice/help.
To be recognised as a wab, you need to add a context path header to your manifest:
Web-ContextPath: TestServlet
It's working now! I was doing my MANIFEST.MF according to this page: http://team.ops4j.org/wiki/display/ops4j/Pax+Web+Extender+-+War+-+OSGi-fy
The problem was that for some reason "Bundle-Version: 1.0" line was required as opposed to optional as stated on that page.
Honestly, just adding the Bundle-Version fix-it.
I knew it was something wrong with the MANIFEST.MF and after Holly Cummins' question I played with it a bit more. Thanks Holly.
I still can't do anything with the manual site launching (have to manually enter the index.html).
http://localhost:8080/TestServlet/ gives me this:
HTTP ERROR 404
Problem accessing /TestServlet/. Reason:
Not Found
Powered by Jetty://
http://localhost:8080/TestServlet/index.html gives me proper site.

Compile error in empty cocos2d 2.0 (iPhone)

When I try to compile new cocos2d+box2d project in xcode4.
I got error message like:
/Users/bla-bla/Cocos2d testing/Cocos2d testing/libs/cocos2d/CCDirector.h:32:9: fatal error: 'kazmath/mat4.h' file not found [2]
/Users/bla-bla/Cocos2d testing/Cocos2d testing/libs/cocos2d/CCNode.h:37:9: fatal error: 'kazmath/kazmath.h' file not found [2]
File I checked, what is wrong?
This is caused by having a space in the path name to your project. To work around this, you'll need to add the following under your project's configuration... in Build Settings, in the group of Search Paths, set the Header Search Paths to the following value:
"${SRCROOT}/Cocos2d testing/libs/kazmath/include"
Be sure to include the double-quotes.
did you check in Finder to see if there is a real folder named kazmath in the same path as where CCNode is ? if not, there is probably a flaw in the templates install script for that version of coco. But dont rely on the 'tree view' of the Xcode project navigator to really know whether a file is present or not. If the path is wrong in the include, suggest you report it to the coco team. You could temporarily fix the import statements to get going, but that would be throw-away code :) when coco issues another release candidate, presumably fixed.
Ensure you are editing the right header search paths for the right target. 1 hour of my life wasted editing the main project or the app rather than the test!

javascript is not working in my wordpress on (wamp + windows 7)

i installed wordpress on my localhost (wamp on windows 7) but javascript is not working on my admin area
any help ?
EDIT
i'm tracking the problem
it seems it's from /wp-admin/loadscripts.php line 123 "get_file" function .. when it's getting the javascript from the file it replaces " with \" it did preg_replace but it seems that there is something else .. i tried different function file_get_contents for example and still the same problem
here is 1 of the errors from firefox error window
Error: syntax error
Source File: mylocalhost/wordpress/wp-admin/load-scripts.php?c=1&load=jquery,utils&ver=0e4de088c1d51cff99f6e17399d2c995
Line: 21, Column: 58
Source Code:
Wa=/^(\\s|\\u00A0)+|(\\s|\\u00A0)+$/g,Xa=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn
The reason for this is often conflicting plugins. If you installed any new plugins recently, try deactivating them one by one and see whether you can find the culprit.
Also, look in Firebug's "Net" tab to see whether there are any missing resources.
i solved that !!
when we open a javascript file and output in windows we need stripslashes and everything will work perfectly
stripslashes was the culprit. Spot on! If you guys have installed WAMP and are running wordpress on it. Go to WAMP > PHP Settings > and uncheck all Magic quotes options if they are checked and restart WAMP, You are good to go. Cheers.

Resources