Restrict thread & post visibility to Topic Starter & Team only in one board

Started by FireDitto, September 07, 2012, 10:51:39 PM

Previous topic - Next topic

bigdy

I've successfully installed this mod but i can't seem to get it to work properly.

I have CHECKED "Enable the Private Topics mod".
Entered in my board ID: "19"
Set a custom text for the Board and MessageIndex last topic cell: Blank

Thought it might have been a problem with Pretty URLs so, in the settings of Pretty URLS, I set it to disabled. No difference.  Then I uninstalled PrettyURLs.  No difference.

Do I need to change user groups or board permissions in any fashion?

Mods installed:
Pretty URLs
Disable 'last edit by...' for Administrators
SimplePortal
Private Topics
Separate the sticky topics
SMFPacks Shoutbox
Auto Respond
Ohara YouTube Embed
Bad Behavior mod
Gravatar 4 SMF
SMFPacks WYSIWYG Editor
Custom Form Mod
Tapatalk SMF 2.0 RC5/Final Plugin
Spoiler Tag
AutoAward

THANKS

Suki

Welcome to SMF

What exactly is the problem? does your users can still see the private topics? did you configure the permissions?


* Suki should really submit the mod to the modsite as its confusing having to answer multiple topics
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

bigdy

Hello Suki,

First thank you for the welcome.  After I posted I saw that this was my first post :)  I also thank you for monitoring other threads.  I'm sure it would indeed be much easier for everyone if this had it's own thread.   

I found the problem!  After you replied back I went and poked around a bit more.  Here's what is happening:

The board ID of the forum I want to set to 'private' is "19" -  I entered "19" (no quotes) into the Private Topic settings page.  When I went back and browsed the forum today it seems the Private Topic was set to board ID"9". Somehow entering 19 into the settings makes the module apply the setting to board ID 9.  Additionally, changing it to "9" results in the Private Topic being applied to board ID 9. 

Make sense?

Suki

Well, the mod does check and make sure you only enter a valid number, that is, if you enter "19"  the mod will change it to just 19, this is made to avoid possible errors since a lot of peoplr do actually enter things like "19"  or board 19  or 19.0, etc.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

bigdy

This is not what happened though.

I entered board id:
19

No quotes or anything.  Just the number 19. 19 is a valid board and the board it should have been applied to. 

For some reason, however, Private Topic applied the setting to Board ID 9.  Like it didn't even register the 1.


Suki

Does the setting still displays 9 ?

You can simply enter 19 and hit save, the mod will no longer assign private topics to board 9 but will now assign private topics to board 19.

It might be the case that you hit 1 but the number never appeared on the text field as there is no way the mod can skip a valid number, the regex simply cannot perform that, it was designed to only allows numbers from 1 to 9 and 0, meaning 19, 9 119 or 1119 are all valid numbers.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

FireDitto

Quote
An Error Has Occurred!
The database value you're trying to insert does not exist: topic

It's still cropping up. I don't know where or why. It's not telling me more than that which I quoted and I am not a coder to find out for you.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Suki

Who said something about doing my job for me?
You don't need to be a coder to find out, its as simple as telling me what are you doing the moment the error appear.

I don't remember at first glance what caused the error but I def know I fixed it (I checked my local repo to see if there was some commits that weren't sent to github but there isn't any, meaning the latest version is on github) so please do try the latest version on github, you don't say if you actually tried it already, perhaps I should figure it out that too?
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

FireDitto

There is no need to be snippy!
I did install the new one; I thought that would be obvious.

I was responding to THIS request last time I said that the same thing was happening;
Quote from: Suki on October 19, 2012, 08:33:42 AM
uh, perhaps was a missing edit on github, can you tell me the exact line where the error is, on the error log the line should appear.

The error log says;

QuoteApply Filter: Only show the error messages of this URL
http://rohsii.dreamscaperpgs.net/index.php?board=27.0
Apply Filter: Only show the errors with the same message
The database value you're trying to insert does not exist: topic
Function: doGet
Apply Filter: Only show the errors from this file
File: /home/<removed>/public_html/rohsii/Sources/PrivateTopics.php
Line: 112


I also get this error if I do not insert at least one member name to the invitation part;
Quotehttp://rohsii.dreamscaperpgs.net/index.php?action=post2;start=0;board=1
Apply Filter: Only show the errors with the same message
The database value you're trying to insert does not exist: users
Function: doSave
Apply Filter: Only show the errors from this file
File: /home/<removed>/public_html/rohsii/Sources/PrivateTopics.php
Line: 74
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Suki

Not, its not obvious, I will still assume you have the previous mod installed until you tell otherwise as you having the old mod is the only reliable info you provided me, I cannot assume or make assumptions on what you already did, thats why I ask for all details.


About the $topic error, you still have some code let from the old installation, I checked the current one and all instance of $pt->doGet(); are precedeed by the call to the class, for example:

$pt = new PrivateTopics($context['latest_post']['topic']);
         $ptCache = $pt->doGet();

That is, every call to the class PrivateTopics must pass a valid topic ID, in the example above, the topic ID its $context['latest_post']['topic']

So please do check that all the calls made like this:  new PrivateTopics  are indeed passing a value between ()  you can do this with any code editor or even a text editor that has a search function.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

OK, I was able to reproduce the $topic issue.  The issue was because you tried to edit a topic that wasn't marked as private but was in a board marked for private topics.

I committed a fix for that, now the mod will perform the update only if there was a previous record on the private topics table.

I also added the possibility to left the text box empty, meaning only the topic starter will be added to the lsit of users capable of seen the topic and of course the people with permissions.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

FireDitto

Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

Okay! Installed the latest edition and I have the following;

Quote
An Error Has Occurred!
The database value you're trying to insert does not exist: topic_id

I didn't type in a User ID number, and the above error cropped up. It still posted, it just tossed up the error page rather than going to view the topic. As a result it doesn't list the topic as private and editing it to make it private doesn't 'stick'.


Entering a username into the "Type the user ID" worked perfectly, and upon editing it has the check box ticked, and the ID's of the two accounts in question listed.


Selected boards are still vanishing however;
Quote
An Error Has Occurred!
The database value you're trying to insert does not exist: topicp.

I can't seem to find anything in particular that links them together to suggest why they would all be bringing up that error. Some of them are listed as 'Read Only', some are 'Default'

Ah! They're all boards with children! The children boards themselves work -- UNLESS they have a child as well.



Also, regarding this post (below) I have no idea what you mean :/ Code-talk generally goes over my head. Is it still relevant to the latest update?

Quote from: Suki on November 21, 2012, 04:41:04 PM
About the $topic error, you still have some code let from the old installation, I checked the current one and all instance of $pt->doGet(); are precedeed by the call to the class, for example:

$pt = new PrivateTopics($context['latest_post']['topic']);
         $ptCache = $pt->doGet();

That is, every call to the class PrivateTopics must pass a valid topic ID, in the example above, the topic ID its $context['latest_post']['topic']

So please do check that all the calls made like this:  new PrivateTopics  are indeed passing a value between ()  you can do this with any code editor or even a text editor that has a search function.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Unruler

Mod seems to work fairly randomly for me.

Sometimes it gives me the message:

An Error Has Occurred!
The database value you're trying to insert does not exist: topic_id


Even though it will create the thread.

And I managed to hide only one topic out of five created. I checked for guest. I've tried to edit created threads so checkbox to make it private would be ticked but it appears to be un-ticked every time I edit the thread again. Then I tried to insert my username ID, but that didn't help either.

So all in all I managed to hide just one thread and I'm not sure how that happened.

Suki

Quote from: Unruler on December 06, 2012, 10:14:48 AM
Mod seems to work fairly randomly for me.

Sometimes it gives me the message:

An Error Has Occurred!
The database value you're trying to insert does not exist: topic_id


Even though it will create the thread.

And I managed to hide only one topic out of five created. I checked for guest. I've tried to edit created threads so checkbox to make it private would be ticked but it appears to be un-ticked every time I edit the thread again. Then I tried to insert my username ID, but that didn't help either.

So all in all I managed to hide just one thread and I'm not sure how that happened.

did you tried the last version updated on github?  if not, download the mod again, uninstall it and install the new version. It should cover the whole topic_id error.

Quote from: FireDitto on November 26, 2012, 08:06:34 PM
I didn't type in a User ID number

how exactly did you enter the number?

gotta check the child boards issue, they are usually a real pain to deal with.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

FireDitto

Quote from: Suki on December 06, 2012, 03:15:14 PM

Quote from: FireDitto on November 26, 2012, 08:06:34 PM
I didn't type in a User ID number

how exactly did you enter the number?

Um, not the ID number, so much as a member's user-name and it brings up a drop-down that you click and it adds it similar to the PM system. If I don't put at least one other member's name in before clicking to post the topic, it results in the error popping up, and the topic not being privatised when I go back and check it.


Quotegotta check the child boards issue, they are usually a real pain to deal with.
Not surprised >< Good luck
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Unruler

Quote from: Suki on December 06, 2012, 03:15:14 PM
did you tried the last version updated on github?  if not, download the mod again, uninstall it and install the new version. It should cover the whole topic_id error.

I'm pretty sure I did. Since there is no other way to get older version and the last update to files was made 14 days ago, I tried it at 5th of December which is two days ago.

Suki

Quote from: Unruler on December 07, 2012, 09:01:04 AM
Quote from: Suki on December 06, 2012, 03:15:14 PM
did you tried the last version updated on github?  if not, download the mod again, uninstall it and install the new version. It should cover the whole topic_id error.

I'm pretty sure I did. Since there is no other way to get older version and the last update to files was made 14 days ago, I tried it at 5th of December which is two days ago.


And cna I ask you how exactly did you create those topics?  the exact steps you made?
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Unruler

Quote from: Suki on December 07, 2012, 10:59:37 AM
Quote from: Unruler on December 07, 2012, 09:01:04 AM
Quote from: Suki on December 06, 2012, 03:15:14 PM
did you tried the last version updated on github?  if not, download the mod again, uninstall it and install the new version. It should cover the whole topic_id error.

I'm pretty sure I did. Since there is no other way to get older version and the last update to files was made 14 days ago, I tried it at 5th of December which is two days ago.

And cna I ask you how exactly did you create those topics?  the exact steps you made?

I just went into category and pushed create topic then I ticked the checkbox with make this topic private on it. I've tried to add my name in the field with user ID and I've tried to go with just a checkbox. But it worked only once for some reason...

Suki

The topic creator is already added to the list of persons capable of see the topic so you don't need to type your name on it, try adding someone else name, the mod includes an autosuggest feature that will detect the name your type and will give you possible usernames.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: