OssnLocale is not defined when clicking on notifications

Laszlo Orban Posted in Technical Support 8 years ago

Hi all!

I am quite new at OSSN and I can say I am not a big expert in PHP and javascript, so I have come across a problem I am not able to fix in OSSN version 4.3.1

In Internet Explorer the error search feature is enabled to me because of a development consideration. The problem is about a continuous error message mentioned in the subject of this discussion. I am always getting this error message whenever I click to check my notifications or messages on the OSSN topbar. Of course I have got down to conducting an investigation but all I was able to figure out so far is that it should be related to the language settings on the account settings page.

I created a hungarian language package according to the OSSN recommendations and after I installed it and changed my user's language settings to hungarian the error message actually stopped and I was able to check my notifications as well as my messages.

But when I change from hungarian to any other default language the error comes again and the notifications & messages stop working even if I turn off the error search in internet options.
That means the error message does not appear obviously, but the notification box is still unable to show up.

I dug deeper in the source code but for me It seems to be painful to make out the process how OSSN works.

My observations so far:
- At any language settings other than hungarian the languages.php file which contains the OssnLocale variable declaration is somehow unable to be called or included.
- There are no differences between the hungarian and the other core language files.
- Committing a brand new installation is not a solution, the problem still exists.
- I can imagine that maybe an apache or php.ini adjustment causes the failure.
- Sometimes also the variable Ossn is unable to declare.

Please, if anybody has some experience in such cases or a useful piece of advice where to look for the root cause it would be highly appreciate!

Thanks so much!
Laci

Replies
German Michael Zülsdorff Replied 8 years ago

@Ashwin
You might be tired of reading this reminder, but your reports have to comply with the rules: https://www.opensource-socialnetwork.org/wiki/view/705/how-to-report-a-issue-on-github

Just jumping on the train and telling us - It's not working for me, too - is of no help. As Laszlo came already quite close, the first thing to verify would be:

What happens when you're calling YOUROSSNSITE/js/view/ossn.language.js directly?

Just do that with an open Firefox Developer Console (rightclick your page and choose "Inspect")
and proceed by clicking the Network tab.

For your convenience I've attached a screenshot (fullsize image: http://z-mans.net/ossn-reports/2155/ossn-language-js.PNG ) doing right that on my own site.
Please do the same for your own site.
http://z-mans.net/ossn-reports/2155/ossn-language-js.PNG

Hungarian Laszlo Orban Replied 8 years ago

Hi!

Actually the issue can not be solved. I refused to make any further investigation as I am not an expert and I ran out of ideas. All I was able to figure out that according to the Log files, there is a point where Apache always crashes and needs to restart during the loading of OSSN. I am not sure it is concerned to the main issue or It is a completely different one.

Another fact that the developer version of Firefox said one of the included js files did not get a response header for it's request resulting the fact OssnLocale js variable could not be declared. At this stage I gave up, and I changed the server's OS to Linux as it was mentioned. As a matter of fact OSSN is much more faster on Linux. I can imagine partially because Apache does not restart during loading OSSN.

in Ashwin Shahi Replied 8 years ago

Is this issue solved I am facing this same issue.
I have configured OSSN on AWS free tier server

Indonesian Arsalan Shah Replied 8 years ago

OSSN isn't supported officially by iis nor with windows. So please use the Linux instead, however if you wanted to use on windows try to install xampp (not tested) on your windows machine.

Hungarian Laszlo Orban Replied 8 years ago

Hi!

After a desperate investigation I came to an ascertainment that OSSN cannot include a specific javascript file (name: ossn.language.js) which actually do not exists but it is built up with the content of ossn/system/plugins/default/javascripts/libraries/languages.php file in runtime. I installed OSSN to three different hosts.

  1. Localhost with apache 2.0 handler - php 5.5.12
  2. Another localhost with apache 2.0 handler - php 5.6.30
  3. My own website with iis and php 5.6.5

The only one instance that seems to work correctly is the 3rd one with the iis web server. In every three cases I loaded the home page in a browser and I checked their source code. In the head section I saw the js files the page intended to load where I found the ossn.language.js file as well. In firefox they are shown as links, so I was able to reach those files by clicking on them. In the case of my own website I could see all of them, but on the other two hosts the ossn.language.js file was unreachable and the browser told me the page cannot be found. The path for that file was like this:
http://"siteurl"/ossn/js/view/ossn.language.js

In this situation I think it is probably a wrong apache permission setting or something like that. Am I right? And if so, can someone please suggest me some ideas what should I check in my apache settings or can someone perhaps show me a correct apache configuration for ossn?

Thank you very much!
Laci

Hungarian Laszlo Orban Replied 8 years ago

Thank you very much for your ideas. Could you maybe suggest any property I should check in my environment settings that could cause the OSSN site to throw this error message?

German Michael Zülsdorff Replied 8 years ago

Okay, so if you cannot confirm Ossn is running error free even without your language, your environment must be some way broken. And since we can't access your local machine we can't offer any further help. Sorry.
Even more it's not recommend to address an Ossn installation via IP without correct DNS resolving. Put Ossn on a correctly configured machine reachable from the internet.

Hungarian Laszlo Orban Replied 8 years ago

Hi!

  1. Negative Sir. When I made a new installation I did not installed my language package. And it could not work so the error message existed. But as an update, I have just installed my language package and now even with the hungarian settings the error message occurs. It seems to be something else but not language problem. Especially as also the Ossn variable itself is not always declarable. I get error message about it as well.

  2. I have the System Info component but as OSSN is running on localhost you can not visit the site, but anyway the site url is this: http://127.0.0.1/ossn/
    It is Wampserver version 2.5 the PHP version is 5.5.12

German Michael Zülsdorff Replied 8 years ago
  1. Can you confirm that Ossn is running correctly without your language pack? (Remove it to verify)

  2. Install the System Info component and provide the url of your site.