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

SQL error on unpublish #20

Closed
stitot opened this issue Sep 19, 2011 · 6 comments
Closed

SQL error on unpublish #20

stitot opened this issue Sep 19, 2011 · 6 comments

Comments

@stitot
Copy link

stitot commented Sep 19, 2011

When trying to unpublish an item I get the following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND id=2' at line 3 SQL=UPDATE joomla_members SET state = 0 WHERE checked_out = 0 OR checked_out = 42) AND id=2

Unpublishing/publishing categories work fine.

@mbabker
Copy link
Contributor

mbabker commented Sep 19, 2011

Removed the erroneous closing parentheses, thanks for the report.

@stitot
Copy link
Author

stitot commented Sep 19, 2011

Better now, but when publishing/unpublishing one item in a category, ALL items gets published/unpublished. And, unpublish have no affect on the site. Unpublished items gets displayed.

@mbabker
Copy link
Contributor

mbabker commented Sep 19, 2011

I went back and reviewed the parent publish function and the correct fix
was to add an opening parenthesis to the checked out portion of the query
versus removing the closing parenthesis. It should be good now.

On 9/19/11 4:44 PM, "stitot"
reply@reply.github.com
wrote:

Better now, but when publishing/unpublishing one item in a category, ALL
items gets published/unpublished.

Reply to this email directly or view it on GitHub:
#20 (comment)

@stitot
Copy link
Author

stitot commented Sep 19, 2011

Yes, that fixed the DB update part, but still unpublished items gets displayed on the site.

@mbabker
Copy link
Contributor

mbabker commented Sep 19, 2011

@AmyStephen, is it intentional to have the default query if the state filter isn't active to pull published and unpublished items? Seems to me the default should be published only for unauthenticated users and all items if you have front end management capability.

@mbabker
Copy link
Contributor

mbabker commented Sep 19, 2011

Here's a diff with how I handle the filtering in the front end with my podcast component. Basically, if you don't have edit or edit state permissions, you only see published items. I also have a clause that handles the publish_up time so only published articles that aren't set for the future aren't displayed.

https://gist.github.com/1226459

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

No branches or pull requests

2 participants