Nao

  • Dadman with a boy
  • Posts: 16,082
Infraction bugs
« on May 6th, 2013, 09:23 PM »
So, it's up... I disabled all plugins, installed the stuff, re-enabled all plugins; I also updated the database structure manually before, using the same code as in install.sql.

Here's a first one... Click on a profile link, get this:

Code: [Select]
Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'ifnull'
File: /Sources/ManageInfractions.php
Line: 587

I don't know if it's a bug due to my version of phpmyadmin and how it handled my addition, but it's still something I think needs to be pointed out.
Posted: May 6th, 2013, 09:17 PM

Fixed manually through phpMyAdmin; declaration by declaration... Arghh -_-
Did wedge_infractions, while I was at it, even though I didn't get any errors for that one.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Infraction bugs
« Reply #1, on May 6th, 2013, 09:43 PM »
Yeah, that's not setting the table up properly. The installer normally forces the collation properly on install so that everything has the same collation (which should be utf8_unicode_ci IIRC) but if you don't manually specify it on adding tables or columns yourself, it'll use whatever the default for the server is, which looks like utf8_general_ci.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Infraction bugs
« Reply #2, on May 6th, 2013, 09:50 PM »
Yeah, not too cool... :-/
I noticed that plenty of my tables (the ones I added manually year after year...) were in general_ci collation. Uh. Well, as long as it doesn't crash, I guess there's no reason to change it..? (Performance...?? I don't think so..?)

Also, did you look into the session issue? Not that I can't add an isset() test to get rid of the error, but I wanted you to be able to see by yourself, uh....

Oh, and an issue, I'm sure you're aware of it: 'Infraction log' in the board index actually leads to the Moderation log.
Posted: May 6th, 2013, 09:48 PM

Also, for design reasons, the Error log link should have the number of errors next to it, rather than in the title attribute...?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Infraction bugs
« Reply #3, on May 6th, 2013, 09:52 PM »
Quote
Uh. Well, as long as it doesn't crash, I guess there's no reason to change it..? (Performance...?? I don't think so..?)
There is no real performance difference but I seem to recall that unicode_ci is more accurate than general_ci, but it's been a while.
Quote
Also, did you look into the session issue? Not that I can't add an isset() test to get rid of the error, but I wanted you to be able to see by yourself, uh....
You mean the error I stopped getting once I cleared my cookies and relogged in (forcing a rebuild of my session's mod cache)?

I saw that when I first wrote that code, and as soon as the mod cache is rebuilt the error goes away.
Quote
Oh, and an issue, I'm sure you're aware of it: 'Infraction log' in the board index actually leads to the Moderation log.
Yes, because there *isn't* an infraction log yet... think I mentioned that in the changelog that I hadn't written it yet.
Quote
Also, for design reasons, the Error log link should have the number of errors next to it, rather than in the title attribute...?
Adding that is tricky because of the fact that the board index template is reused exactly as-is, so the 'board name' would have to include the number, which would propagate into the title as well. If we made a new part of the template for that, then we would have no such restrictions.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Infraction bugs
« Reply #4, on May 6th, 2013, 10:09 PM »
Didn't read the changelog yet. Actually, I'm instead reading the diff patch directly... :^^;:
It's a huge beast, ah ah.

I'm pretty sure the template can be fixed to show an optional .note box next to board names, either saying $txt['new'] as it does now, or a number to indicate the number of new entries, etc... Instead of just having the 'new' array entry.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Infraction bugs
« Reply #5, on May 6th, 2013, 10:18 PM »
We can do that. We can even go and make a complete new template just for those.
Posted: May 6th, 2013, 10:12 PM

The one problem with doing that, though, is that the implication is we should fetch the number of topics applicable in each case thereafter which is not cheap. Consistency FTW.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Infraction bugs
« Reply #6, on May 6th, 2013, 10:57 PM »
One problem with sessions... In Chrome for Android, I can't remove cookies for an individual site, and I don't want to have to re-log in everywhere (I have 80+ tabs, and quite a few with authentication), just so I don't get these frigging errors anymore... -_-

Is there another way to fix that, then..?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Infraction bugs
« Reply #7, on May 6th, 2013, 11:05 PM »
Quote
In Chrome for Android, I can't remove cookies for an individual site
I find it hard to believe it can;t be done, even iOS can do that :P I suspect it's buried in the settings like it is with Chrome desktop.

I really do not want to create an !empty test, as quick as it might be, for something that *no other user will ever encounter*.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Infraction bugs
« Reply #8, on May 6th, 2013, 11:10 PM »
In Boards.template.php, foreach ($child['display'] as $item => $string) ---> $string is never used... Is this a placeholder for something in the future, or something you forgot to clean up...? If the latter, may I simply rewrite the Boards.php code to remove the associative arrays and just have something simpler..?

What I've done so far, is add an extra 'note' parameter with anything in it. If empty, don't bother. If set, then just so a <span class="note"> with it as the content, and no link. (No sure it's worth linking it... After all, there's a link just next to it..?!)
Quote from Arantor on May 6th, 2013, 11:05 PM
Quote
In Chrome for Android, I can't remove cookies for an individual site
I find it hard to believe it can;t be done, even iOS can do that :P I suspect it's buried in the settings like it is with Chrome desktop.
It's the removal of ALL cookies that's buried in the settings...
And I don't know of any settings to remove an individual cookie in Chrome; all I know is that I do Inspect Element, then Resources, then Cookies, and there's an option to remove them here.
Quote
I really do not want to create an !empty test, as quick as it might be, for something that *no other user will ever encounter*.
........ :-/
How, can't I just force all sessions for 'Nao' to be removed from the database..?

Bed time. Haven't even started doing translations yet...!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Infraction bugs
« Reply #9, on May 6th, 2013, 11:15 PM »
Quote
If the latter, may I simply rewrite the Boards.php code to remove the associative arrays and just have something simpler..?
You can rewrite where it's defined in Subs-BoardIndex.php if you like, since that's where it's defined.

Oh, and $string might not be used, but was $item used? (Since there's no way to iterate over an array just having its keys, unless you grab array_keys then foreach over that)
Quote
What I've done so far, is add an extra 'note' parameter with anything in it. If empty, don't bother. If set, then just so a <span class="note"> with it as the content, and no link. (No sure it's worth linking it... After all, there's a link just next to it..?!)
So, again, are you going to do the same with everything else for consistency?
Quote
And I don't know of any settings to remove an individual cookie in Chrome; all I know is that I do Inspect Element, then Resources, then Cookies, and there's an option to remove them here.
I couldn't find anything about it with a quick search but that's because I don't have a single Android device to look at.
Quote
How, can't I just force all sessions for 'Nao' to be removed from the database..?
If you can find it, sure. That's not very easy either. :/

log_online will tell you what user id is attached to a given session.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Infraction bugs
« Reply #10, on May 7th, 2013, 01:57 PM »
Quote from Arantor on May 6th, 2013, 11:15 PM
Oh, and $string might not be used, but was $item used? (Since there's no way to iterate over an array just having its keys, unless you grab array_keys then foreach over that)
Sorry, I was probably too tired and missed the use of $string... Eh!
It's a bit complicated, although I understand the idea:
- for each virtual board, store one or more random variables,
- then store a display variable that holds all of the random variables, associated with a number_context array,
- at display time, build the title from the number_context array, using the values in the random variables.

It seems to me like overkill for something that few people are going to notice, since it requires them to hover the link, and wait for a second...
Which is why it seemed more natural to me to use a note class next to the board name. Perhaps, we could associate that note class with a title that gives more information on the number, similar to what you did. Perhaps force the note, even if 0 items are in there, but with a notenice class, instead..?
Dunno for sure.

While I'm at it -- I uploaded here a custom version where the number of errors is shown next to the error log link, so that you can get an idea of how it looks... I think it's quite alright that way; but I'm not committing anything without your input anyway. (Plus, I'll probably want to rewrite; or you.)
Quote
So, again, are you going to do the same with everything else for consistency?
For moderation boards, you mean..? Or for all boards?
Quote
I couldn't find anything about it with a quick search but that's because I don't have a single Android device to look at.
There are Android emulators for Windows around, although it's not fun to install them (Android SDK, uh... Takes like an hour to configure properly, or something.) There are also programs that allow you to run Google Play and thus some Android apps, like "BlueStacks", I tried one this morning while writing this post, but I couldn't get Chrome to run on it, so I guess it's a pass... Didn't try other browsers, though, but I suspect they'll work. It's only about being able to run the program in an x86 Android environment, such as the Motorola Razr i...
Quote
log_online will tell you what user id is attached to a given session.
That's what I was planning to do yesterday, but you managed to fix it for me, thanks ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Infraction bugs
« Reply #11, on May 7th, 2013, 03:52 PM »
Quote
- for each virtual board, store one or more random variables,
- then store a display variable that holds all of the random variables, associated with a number_context array,
- at display time, build the title from the number_context array, using the values in the random variables.
Correct. See, this way we can have as many items for the posts/topics box as we like and it's not enforced as being 'posts' or 'topics' - the same mechanism allows us to have 'open/closed bug reports', 'redirects', 'posts/topics' or even SimpleDesk's departments' worth of open/closed tickets, and all do it without any more changes anywhere.
Quote
For moderation boards, you mean..? Or for all boards?
All boards. Either the moderation board behaves like regular boards because it looks like one, or we make all boards act like the moderation board, or we do something totally different presentation-wise for the moderation boards. It should be behaviourally consistent with the other boards.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Infraction bugs
« Reply #12, on May 7th, 2013, 05:29 PM »
What do you think of my suggestions above..?

Also, an issue with moderation boards... Thing is, Wedge.org has the board list on index, but I'm always two inches from replacing it with either a quick list in the sidebar, or just a link somewhere to /do/boards/... But at this point, if I do that -- the moderation area is gone, too. Maybe they should be separated, code-wise..?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Infraction bugs
« Reply #13, on May 7th, 2013, 06:10 PM »
Quote
What do you think of my suggestions above..?
Same as I've said all along: if you put the note stuff next to boards, you pretty much *need* to do it for ALL the other boards because it'll look inconsistent otherwise.

The look works, but I'm distinctly concerned that people will expect it everywhere else, which has serious performance implications.
Quote
But at this point, if I do that -- the moderation area is gone, too. Maybe they should be separated, code-wise..?
It should be where the boardindex. If that's not the front page, that's fine, because a lot of people will still go to the boardindex anyway.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Infraction bugs
« Reply #14, on May 7th, 2013, 06:30 PM »
Okay, I'll give up on that then...

I'm having trouble with the translation overall.
"Issue an infraction"... I get the idea, but isn't an infraction the *cause* of the warning? I do an infraction, you give me a warning.
At least in French... (Infraction comes first, avertissement/warning comes second, punition or sanction (punishment) comes last.)

I'm tempted to keep the earlier terminology in the French version (Sanction, avertissement...), but maybe I should wait until I understand the concept better, maybe...