Python Forum
error while previewing locked post - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Board (https://python-forum.io/forum-26.html)
+--- Thread: error while previewing locked post (/thread-44.html)



error while previewing locked post - Kebap - Sep-15-2016

I got the following error message when I edited, then previewed the locked post in the lock test thread.
I only removed the "locked" flag, but left the edit message intact, then clicked "preview", not saving anything


Quote:The following warnings occurred: Warning [2] Illegal string offset 'locked' - Line: 97 - File: inc/plugins/lockposts.php PHP 5.5.9-1ubuntu4.13 (Linux)

File
Line
Function/inc/plugins/lockposts.php
97
errorHandler->error
/inc/class_plugins.php
139
lockposts_checkbox
/editpost.php
927
pluginSystem->run_hooks

I got the same error message when editing a locked thread, then previewing, not unlocking anything. Seems to have to do with previewing locked posts


RE: error while previewing locked post - metulburr - Sep-15-2016

That might be because i deleted all my test users i was using.


RE: error while previewing locked post - Kebap - Sep-15-2016

Negative, this pertains to other users as well. You can try for yourself: Just edit Yoriz' thread here, full edit, then click preview. Error appears at the very top: http://python-forum.io/showthread.php?tid=30


RE: error while previewing locked post - metulburr - Sep-15-2016

OK I see...

Well it does successfully edit the post, because its a warning, not error. But I think the plugin is thinking its still locked when its not, and sparking a warning. I asked the support how to remedy this as i am not sure.

The if condition triggering that is
	if($postoptions['lockpost'] == 1 || ($mybb->request_method != "post" && $post['locked'] != 0))
	{
		$postoptionschecked['lockpost'] = " checked=\"checked\"";
	}
from lockposts.php
http://codepad.org/bXGxQppX


RE: error while previewing locked post - metulburr - Sep-17-2016

I modified the settings in which make this plugin impractical. I removed the ability for regular users to delete their own threads or posts. And they have 10 minutes from the time of posting that their post auto locks. I put the time limit in there for people who mess something up and want to go back and fix. But that should stop the people who get an answer and delete their post or edit it to gibberish. But ill leave the lock mod on just in case.