-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix undefined index for REQUEST_METHOD #4646
Conversation
Thank you for your contribution. Can you please provide test instructions on how to reproduce this issue. Thank you. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4646. |
Hi Roland! Thanks very much for testing this! Testing instructions
This will open in port 8888 a websocket server
Hope to be clear, if you have any doubt just ping me. |
@fastslack I have tried but failed. On Windows I get this error: On my Mac I get the error: Do know that on my Mac I use MAMP which runs on port 8888 and MySQL on port 8889. I changed the port in the Websocket and component to 9888 but to no avail. On the Mac I see the notice: |
@roland-d For the mysql access issue seems that its a path error of the configuration include, try: https://github.com/fastslack/matware-libraries/blob/master/cli/WebsocketServer/WebsocketServer#L16
The idea is that script read the Joomla! configuration file, try debugging if your path is correct. For port issue try changing port to 8080. I dont know why it do not work on 'random' ports. I feel that is a problem on the dark side of the moon, i ll never know the origin of the problem. Take in mind that im only talking about MAMP because i dont know what is that thing called Windows :-P |
@roland-d really sorry but i forget one step into testing instruction:
|
@roland-d I tested it using Windows and latest version of WAMP. The errors seems caused by JLog class of Joomla libraries. If you like to prevent this error you could remove this lines: https://github.com/fastslack/matware-libraries/blob/master/cli/WebsocketServer/WebsocketServer#L70 If you do that, the websocket script works fine on Windows. UPDATE: Fix logging bug on WAMP fastslack/matware-libraries@51bb052 |
@fastslack sorry to report but I still can't get this to run. On the Mac I keep getting the "Could not connect to MySQL" and on Windows I now get "Application Instantiation Error" I have set the port to 8080 and also replace my htacess file with the htaccess file provided by you. To make sure the correct path is used for the configuration I have even tried with the full path but the MySQL error is still present. Now I found out that this error is caused by the ->loadDispatcher(). When I disable this part the server starts but when going to Websocket Example, the screen remains empty. No clock appears. I don't know what else to check. |
@roland-d the "Application Instantiation Error" message is caused because you didnt applied this patch: https://github.com/joomla/joomla-cms/pull/6562.patch on your Joomla installation. I havent any Mac here to debug what is the problem with loadDispatcher(), but i think that if you apply the patch, it will work on Windows |
@fastslack I did a clean installation and now the server starts. However when I open the Websocket Example I don't see any clock but in the console I see this notice: Warning: socket_select(): no resource arrays were passed to select in D:\wamp\www\joomla-cms\libraries\matware\socket\websocket.php on line 97 In the log I see this: Perhaps you have some idea about this? |
@roland-d I cant reproduce the notice. What browser are you using? Also, for better debug on javascript you can uncomment this line and check the results on your browser console log: |
@fastslack I am happy to say that I have finally been able to reproduce the issue by using the Chrome webbrowser. Firefox would give the socket issue. Before the patch, the undefined index would show up, after applying the patch, no more notices. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4646. |
@roland-d which version of firefox are you using? i like to fix that problem too :) Im very happy too. Thanks very much for testing it. If you need more information about how to extend the websocket and angularjs code just contact me :) |
@fastslack I am using Windows 8.1 with Firefox 37.0.2. |
I have just tested this here and after the both patches it works good here in Chrome. If i use the last firefox i get the same error as @roland-d (also on a Windows 8.1 host) |
Fix undefined index for REQUEST_METHOD
If we try to catch the input for websocket protocol, $_SERVER['REQUEST_METHOD'] is not set and not needed, so this fix check if this variable is set, if not return ''.