Skip to content
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

Blank Post and Page lists #6

Closed
khurtwilliams opened this issue Dec 22, 2013 · 19 comments
Closed

Blank Post and Page lists #6

khurtwilliams opened this issue Dec 22, 2013 · 19 comments
Assignees
Labels
Milestone

Comments

@khurtwilliams
Copy link

Installed the Gust plug-in on my WordPress 3.8 blog. After logging into the admin interface I get the post list and preview page but ... the list is empty.

UPDATE 1: Isolated the error to API calls returning 500 error.

UPDATE 2: JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES in views/json.php are only supported in PHP 5.4. Removed them as they are only used for better readability.

"Gust Admin"

@ideag
Copy link
Owner

ideag commented Dec 24, 2013

Hi, could you give me some specifics about your system? WordPress version, PHP version, do you use apache or nginx, etc.

@ghost ghost assigned ideag Dec 24, 2013
@khurtwilliams
Copy link
Author

Wordpress 3.8, PHP 5.3, nginx

Sincerely,
Khürt
http://khurt.com/
Sent from my iPad 

On Dec 24, 2013, at 4:11 PM, ideag [email protected] wrote:

Hi, could you give me some specifics about your system? WordPress version, PHP version, do you use apache or nginx, etc.


Reply to this email directly or view it on GitHub.

@mkjonesuk
Copy link

Hey there :)

Same error here, also can't add any pages, doesn't seem to work. This is on my local dev server so:

PHP Version 5.3.1
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1

@ideag
Copy link
Owner

ideag commented Dec 29, 2013

mkjonesuk, khurtwilliams, still can not replicate this on my server. Thinking it might be browser specific - or maybe you tried on serveral browsers? From screenshot I can recognize Safari, I'll try to get hold of a Mac to test this tomorrow.

The only situation, where I can get blank lists like that is when user has no 'edit_others_posts' permission (author or lower) and does not have any posts authored by himself.

@mkjonesuk
Copy link

Hey there,

I tested on PC and Mac, Chrome and Firefox. This was also tested using a
local dev server on each machine.

I've had issues with this flavour of local dev server and JSON requests?
Not sure if that helps.

Also note that:

Adding posts and pages doesn't work, the save/update button doesn't do
anything.

The markdown/preview screens do not automatically update. You can type text
into the markdown panel but nothing happens.

I can't log into the system using the log on screen at the /gust location.
I get no errors or warnings, it's as if the requests just aren't working.

I hacked around the code and tried to get things working last night but it
wasn't anything in depth but I hope this helps you in some way :-)
On 29 Dec 2013 08:55, "ideag" [email protected] wrote:

mkjonesuk, khurtwilliams, still can not replicate this on my server.
Thinking it might be browser specific - or maybe you tried on serveral
browsers? From screenshot I can recognize Safari, I'll try to get hold of a
Mac to test this tomorrow.

The only situation, where I can get blank lists like that is when user has
no 'edit_others_posts' permission (author or lower) and does not have any
posts authored by himself.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-31313721
.

@ideag
Copy link
Owner

ideag commented Dec 29, 2013

Hey again,

From this it sounds as if my main JS (gust.js) is not loaded or fails to init for some reason. Could you check if there are any errors in the console (Chrome: Ctrl+Shift+I > Console) ? Thanks!

Adding posts and pages doesn't work, the save/update button doesn't do
anything.

The markdown/preview screens do not automatically update. You can type text
into the markdown panel but nothing happens.

I can't log into the system using the log on screen at the /gust location.
I get no errors or warnings, it's as if the requests just aren't working.

I hacked around the code and tried to get things working last night but it
wasn't anything in depth but I hope this helps you in some way :-)

@mkjonesuk
Copy link

Sure thing, here's the console log from my local dev:

13:13:51.625 GET http://wppc.dev/admin-dashboard/post [HTTP/1.1 200 OK 267ms]
13:13:53.564 GET http://wppc.dev/wp-content/plugins/gust/assets/ghostdown.js [HTTP/1.1 304 Not Modified 11ms]
13:13:53.565 GET http://wppc.dev/wp-content/plugins/gust/assets/jquery-fileupload.js [HTTP/1.1 304 Not Modified 25ms]
13:13:53.566 GET http://wppc.dev/wp-content/plugins/gust/assets/countable.js [HTTP/1.1 304 Not Modified 28ms]
13:13:53.566 GET http://wppc.dev/wp-content/plugins/gust/assets/misc.js [HTTP/1.1 304 Not Modified 11ms]
13:13:53.567 GET http://wppc.dev/wp-content/plugins/gust/assets/shortcuts.js [HTTP/1.1 304 Not Modified 14ms]
13:13:53.567 GET http://wppc.dev/wp-content/plugins/gust/assets/jquery.nouislider.min.js [HTTP/1.1 304 Not Modified 14ms]
13:13:53.568 GET http://wppc.dev/wp-content/plugins/gust/assets/gust.js [HTTP/1.1 304 Not Modified 14ms]
13:13:51.954 SyntaxError: Using //@ to indicate source map URL pragmas is deprecated. Use //# instead jquery-1.10.2.min.js:1
13:13:53.813 GET http://wppc.dev/wp-content/plugins/gust//assets/admin-bar-sprite.png [HTTP/1.1 304 Not Modified 4ms]
13:13:54.395 GET http://wppc.dev/api/v0.1/posts [HTTP/1.1 500 Internal Server Error 959ms]
13:13:54.755 [object Object] "error" gust.js:806

@ideag
Copy link
Owner

ideag commented Dec 30, 2013

13:13:54.395 GET http://wppc.dev/api/v0.1/posts [HTTP/1.1 500 Internal Server Error 959ms]

Ok, now we are getting somewhere! Could you check PHP logs/actual output for this call: http://wppc.dev/api/v0.1/posts ?

Thanks in advance!

@mkjonesuk
Copy link

Sure thing, from my most recent request:

127.0.0.1 - - [30/Dec/2013:14:34:41 +0000] "GET /gust/ HTTP/1.1" 303 10 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /gust/post HTTP/1.1" 200 7490 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust/assets/ghostdown.js?v=0.3.3 HTTP/1.1" 304 - "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust/assets/shortcuts.js?v=0.3.3 HTTP/1.1" 304 - "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust/assets/jquery-fileupload.js?v=0.3.3 HTTP/1.1" 304 - "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust/assets/countable.js?v=0.3.3 HTTP/1.1" 304 - "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust/assets/misc.js?v=0.3.3 HTTP/1.1" 304 - "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust/assets/gust.js?v=0.0.1 HTTP/1.1" 304 - "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust/assets/jquery.nouislider.min.js?v=0.3.3 HTTP/1.1" 304 - "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:42 +0000] "GET /wp-content/plugins/gust//assets/admin-bar-sprite.png?d=20120830 HTTP/1.1" 304 - "http://wppc.dev/wp-content/plugins/gust//assets/screen.css" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
127.0.0.1 - - [30/Dec/2013:14:34:43 +0000] "GET /api/v0.1/posts?type=post&page=1 HTTP/1.1" 500 4146 "http://wppc.dev/gust/post" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"

Seems to be the 500 error on the last line that you're after :)

@ideag
Copy link
Owner

ideag commented Dec 30, 2013

@mkjonesuk yeah, that is where the problem is. This is access log you are showing me, but I need error log to see what actually goes wrong there.

@mkjonesuk
Copy link

Ah, sorry - error log showed no errors but when I visit '/api/v0.1/posts' I get this:

<h1>500 Internal Server Error</h1><h3>json_encode() expects parameter 2 to be long, string given (2)</h3><pre>#0 [internal function]: flight\Engine->handleError(2, 'json_encode() e...', '/Users/mkjones/...', 3, Array)
# 1 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/views/json.php(3): json_encode(Array, 'JSON___MWWY__W_...')
# 2 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/template/View.php(111): include('/Users/mkjones/...')
# 3 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/Engine.php(426): flight\template\View->render('json.php', Array)
# 4 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(196): flight\Engine->_render('json.php', Array)
# 5 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(141): flight\core\Dispatcher::invokeMethod(Array, Array)
# 6 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(48): flight\core\Dispatcher::execute(Array, Array)
# 7 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/Engine.php(63): flight\core\Dispatcher->run('render', Array)
# 8 [internal function]: flight\Engine->__call('render', Array)
# 9 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(196): flight\Engine->render('json.php', Array)
# 10 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/Flight.php(43): flight\core\Dispatcher::invokeMethod(Array, Array)
# 11 [internal function]: Flight::__callStatic('render', Array)
# 12 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/gust-api.php(55): Flight::render('json.php', Array)
# 13 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(157): {closure}()
# 14 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(142): flight\core\Dispatcher::callFunction(Object(Closure), Array)
# 15 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/Engine.php(304): flight\core\Dispatcher::execute(Object(Closure), Array)
# 16 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(188): flight\Engine->_start()
# 17 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(141): flight\core\Dispatcher::invokeMethod(Array, Array)
# 18 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(48): flight\core\Dispatcher::execute(Array, Array)
# 19 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/Engine.php(63): flight\core\Dispatcher->run('start', Array)
# 20 [internal function]: flight\Engine->__call('start', Array)
# 21 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/core/Dispatcher.php(188): flight\Engine->start()
# 22 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/assets/flight/Flight.php(43): flight\core\Dispatcher::invokeMethod(Array, Array)
# 23 [internal function]: Flight::__callStatic('start', Array)
# 24 /Users/work/projects/WPDev/wpmac.dev/wp-content/plugins/gust/gust.php(64): Flight::start()
# 25 [internal function]: gust_drop_in(Object(WP_Query))
# 26 /Users/work/projects/WPDev/wpmac.dev/wp-includes/plugin.php(507): call_user_func_array('gust_drop_in', Array)
# 27 /Users/work/projects/WPDev/wpmac.dev/wp-includes/query.php(2154): do_action_ref_array('pre_get_posts', Array)
# 28 /Users/work/projects/WPDev/wpmac.dev/wp-includes/query.php(3243): WP_Query->get_posts()
# 29 /Users/work/projects/WPDev/wpmac.dev/wp-includes/class-wp.php(541): WP_Query->query(Array)
# 30 /Users/work/projects/WPDev/wpmac.dev/wp-includes/class-wp.php(605): WP->query_posts()
# 31 /Users/work/projects/WPDev/wpmac.dev/wp-includes/functions.php(808): WP->main('')
# 32 /Users/work/projects/WPDev/wpmac.dev/wp-blog-header.php(14): wp()
# 33 /Users/work/projects/WPDev/wpmac.dev/index.php(17): require('/Users/mkjones/...')
# 34 {main}</pre>

This is a log from my Mac setup. The previous one was from my PC, both are using a XAMPP server config.

@ideag
Copy link
Owner

ideag commented Dec 30, 2013

@mkjonesuk ok, now I feel silly. I was using some options in json_encode(), that were introduced in PHP 5.4. Facepalm does not even cover it. :)

I'll add a fix in next release. You can edit views/json.php manually. change line 3 to:
echo json_encode($return);
and stuff should start working.

Thanks for all the help debuging this.

@ideag ideag closed this as completed Dec 30, 2013
@mkjonesuk
Copy link

Great, glad I could help. I have it working now :)

@ediasep
Copy link

ediasep commented Jan 9, 2014

Hi, i am already have echo json_encode($return); on views/json.php. But it's not seems to be working.

@ideag
Copy link
Owner

ideag commented Jan 9, 2014

@eedithz could you please provide browser console log and/or server error log? Are you using 0.3.2 version of the plugin?

@ediasep
Copy link

ediasep commented Jan 9, 2014

gust-errors

This is what i see in my chrome console log. Parse error in gust.js file. Yes i am using 0.3.2 version.

@ideag
Copy link
Owner

ideag commented Jan 9, 2014

I see you are using some sort of Disqus plugin? Could you specify what plugin and version it is? And also check if disabling that plugin helps with your situation?

@ediasep
Copy link

ediasep commented Jan 9, 2014

I am using disqus comment system version 2.74, and yes if the plugin is disabled the post and page list are work. Any idea how to make both plugin work? disqus comment system is an official disqus plugin for WordPress.

@ideag
Copy link
Owner

ideag commented Jan 9, 2014

@eedithz i moved this to a separate issue ( #27 ). I'll replicate this on my server and look for solution ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants