Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: Arantor on May 30th, 2013, 12:38 AM

Title: Updated CSS code is buggy
Post by: Arantor on May 30th, 2013, 12:38 AM
I don't know where exactly, but it is.

Just for shits'n'giggles I thought I'd install Wedge on 000webhost, to see if the 'white screen of lying-about-memory' came up. So I'm installing SVN, updated with latest changes plus a few in my local repo but that are absolutely unrelated[1] and I get all kinds of excitement when wading through the install process.

These will produce a couple of thousand errors per regeneration of the CSS.

8: Undefined index: selector
Apply Filter: Only show the errors from this file
File: /home/a2849756/public_html/forum/Sources/Class-CSS.php
Lines 883, 929, 954, 970, 985, 1107, 1239

8: Undefined offset: 3
Apply Filter: Only show the errors from this file
File: /home/a2849756/public_html/forum/Sources/Class-CSS.php
Line: 1325

8: Undefined offset: 4
Apply Filter: Only show the errors from this file
File: /home/a2849756/public_html/forum/Sources/Class-CSS.php
Line: 1326

2: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed
Apply Filter: Only show the errors from this file
File: /home/a2849756/public_html/forum/Sources/Subs-Cache.php
Line: 686


I dunno what's wrong with it since it works fine locally with the same files.
 1. Moving a call hook in index.php, a tweak to number_context in Subs.php and a slight change to the installer to test for SimpleXML.
Title: Re: Updated CSS code is buggy
Post by: Nao on May 30th, 2013, 05:44 PM
This is crazy... :-/

First. Blank page... -_-
Traced it manually to the dynamic group color generator. I didn't notice in the first place, but you use wesql in it, and it's a no-no at this point, because obviously the database isn't even created yet, so...
Added a !class_exists('wesql') test at the beginning of the function.
Works.
Now, page 3... Right after entering my database details... Yay, another blank page.
Turned out that this was the same error; looks like, at this point, the wesql object exists, but the database still doesn't work, or something. So, error.
I replaced the test with if (defined('WEDGE_INSTALLER')).
Good, now I can get to complete the install process, eh...

Last of all. Once installed, an intro text says "you'll have to log in before you can use it blah blah..." Well, that's not true. I'm already logged in, at this point...

Worse, on that same page:

Warning: filemtime() [function.filemtime]: stat failed for /cache/cache.lock in /Sources/Subs-Cache.php on line 1628
Looks like the cache.lock file creator at line 1627 doesn't actually work, or isn't called at all because, ahem... the Cache folder already exists at this point, so your file_exists returns true, but you should be testing for the presence of cache.lock, not the cache folder itself...
If I fix line 1626, and reinstall, I'm still getting an error, because this time it's running cache_get_data() with cache.lock not around yet, so blah, it spits out another error.

My suggestion would be to simply force the creation of cache.lock in the installer...

The only errors in my error log are the ones relating to that one error... Uh.

I'm adding these fixes to my local install. I'll probably even commit them by the time you're back, so you can simply rework my changes if anything doesn't work well for you.
Title: Re: Updated CSS code is buggy
Post by: Arantor on May 30th, 2013, 06:52 PM
And yet, I didn't hit any of those issues :/

cache.lock is in my local repo but for some reason I've marked it as ignore locally. Ideally it should be made by the system rather than by the installer because it shouldn't be owned by the FTP user (since then touch() won't update it)

But the group colours bit I didn't get that for some reason :( It just 'worked' for me in that no fatal errors turned up - but the file just contained { } and ; characters. About 4k's worth in total :/
Title: Re: Updated CSS code is buggy
Post by: Nao on May 30th, 2013, 09:14 PM
Can you try with r2143 then..?

BTW your bugs would imply an indentation error. Did you add any custom CSS files..?
Title: Re: Updated CSS code is buggy
Post by: Arantor on May 30th, 2013, 09:19 PM
I didn't add any files, I literally just pulled in from my local repo. I even reuploaded everything using binary mode in FileZilla (because 000webhost keeps dropping the connection if WinSCP does it) specifically to rule out EOL issues and the like :/

But I'll reupload in a bit and see what happens.
Title: Re: Updated CSS code is buggy
Post by: Nao on May 31st, 2013, 12:23 AM
Reminder ;)

Bed time! I've read about 10% of today's posts... freaky!
Title: Re: Updated CSS code is buggy
Post by: Arantor on May 31st, 2013, 12:24 AM
Yeah, I'm currently writing up IPB at the moment, then I'll abuse my free hosting account again.
Title: Re: Updated CSS code is buggy
Post by: Arantor on May 31st, 2013, 11:07 PM
So I updated it to the latest SVN, and the errors are the same as before - even down to the same lines and the same mashed up CSS file generated in result.
Title: Re: Updated CSS code is buggy
Post by: Nao on June 1st, 2013, 12:04 AM
Hmm.
Can you print_r the contents of $this->rules after it's set up..?

Perhaps I should do a double check on indentation at that moment and die if there is an error...

Or, err... just use the bracket format, which is supported already. Then no need for indenting. But, well... it would feel like a defeat, to me. Just like Sass lost to Scss (oddly.)
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 1st, 2013, 12:10 AM
What I don't get is why it works perfectly locally and not on their crappy setup.

I'll do that shortly.
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 1st, 2013, 02:28 PM
So there's now a print_r($this->rules); statement in Class-CSS.php, at line 879.

Dumping all the CSS files locally gives me something beginning:
Array ( [1] => Array ( [selector] => .plainbox virtual [parent] => 0 [children] => Array ( ) [props] => Array ( [2] => Array ( [name] => padding [value] => .5em 1em [id] => 2 [parent] => 1 ) [3] => Array ( [name] => font-size [value] => .9em [id] => 3 [parent] => 1 ) [4] => Array ( [name] => line-height [value] => 1.4em [id] => 4 [parent] => 1 ) [5] => Array ( [name] => border [value] => 1px solid #bbb [id] => 5 [parent] => 1 ) [6] => Array ( [name] => background-color [value] => #f0f5f0 [id] => 6 [parent] => 1 ) [7] => Array ( [name] => margin [value] => .2em 1px 1em [id] => 7 [parent] => 1 ) [8] => Array ( [name] => border-radius [value] => 4px [id] => 8 [parent] => 1 ) ) ) [9] => Array ( [selector] => .wehead virtual [parent] => 0 [children] => Array ( But the test site just gives me:
Array ( No selector is present in any of the elements so all the stuff is just the boilerplate around it. I've uploaded all the files multiple times so I know it's the current revision. I'd be quite happy to give you FTP access to it for you to play around with it but be warned - it's a crappy free host so all kinds of crap doesn't work properly (like, frequently, FTP)
Title: Re: Updated CSS code is buggy
Post by: Nao on June 1st, 2013, 10:03 PM
Probably best, yeah... I'll try to ftp into this tomorrow.
Title: Re: Updated CSS code is buggy
Post by: Nao on June 2nd, 2013, 08:26 PM
Bump..?
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 2nd, 2013, 08:37 PM
Been busy today and I need to just check they haven't cancelled the account since I got an email saying 'we couldn't find a website'
Title: Re: Updated CSS code is buggy
Post by: Nao on June 2nd, 2013, 11:29 PM
Oh... :-/
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 2nd, 2013, 11:50 PM
Yay for free hosting?
Title: Re: Updated CSS code is buggy
Post by: Nao on June 3rd, 2013, 07:37 AM
So, did they actually remove it, or not..?

And if it's free, it can be reopened again, right..?
Can you at least share the URL? :^^;:
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 3rd, 2013, 04:07 PM
They haven't removed it yet. I see why they think I don't have a site, I put everything in /forum/ rather than public_html but that was for a reason.

I can see why users have trouble with FTP details... the FTP details have no correlation to the account that I use to sign in...
Title: Re: Updated CSS code is buggy
Post by: Nao on June 3rd, 2013, 08:23 PM
.............. :^^;:
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 3rd, 2013, 08:26 PM
But I provided you with the actual FTP details which should work (they work for me in FileZilla)
Title: Re: Updated CSS code is buggy
Post by: Nao on June 4th, 2013, 05:10 PM
Oh, sorry, I'd simply missed your PM.

Phew...

Took me a friggin' HOUR to figure out what was happening.
Turns out, Wedge won't install on this, because they're just incompetent.

From their phpinfo:

pcre

PCRE (Perl Compatible Regular Expressions) Support   enabled
PCRE Library Version   6.6 06-Feb-2006


Yeah, not updated in 7 years...!!!!
And because of that, it doesn't support \h, which was added in v7.2, i.e. a year later.
And Wedge relies on \h for many things.

It's obviously something that can be fixed by changing \h to [\t ], but I don't know if it's worth it...

PS: I didn't bother to do the conversion and try to finish the install process... Really, really couldn't bother. Do it if you're curious ;)
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 4th, 2013, 06:48 PM
How did they manage to get PHP 5.2.4 without updating PCRE?
Title: Re: Updated CSS code is buggy
Post by: Nao on June 5th, 2013, 11:25 AM
I don't know, since indeed it's bundled by default... (5.2.4 + 7.2, how lucky!)

My guess, is that they always install PHP with PCRE disabled by default, and they somehow installed PCRE at some point, but long ago, and never cared to update it...

And yes, that totally sucks. But things like that, should be eye-openers for people who use crappy free hosting, I guess..!
There are enough decent free hosts, really, that we don't need to waste time on these ones, so I decided to just give up on this kind of host, it'll save us time in the long run.
Posted: June 5th, 2013, 11:24 AM

Oh, regarding the id_from_member/id_member_from bug... I know why I didn't find it immediately!
As the bug was in __create(), the first thing I did was look for all Notification object instances... But, this particular one was called with 'self'! So, bam... Never noticed it! I should have been more careful, when incorporating the original patch, I guess.
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 5th, 2013, 02:14 PM
I only found it because I forced every error to include a full backtrace.
Title: Re: Updated CSS code is buggy
Post by: Nao on June 5th, 2013, 04:06 PM
So you didn't notice the name inversion either..? ^^
Posted: June 5th, 2013, 04:05 PM

And how did you test, with two local accounts, maybe..?
Title: Re: Updated CSS code is buggy
Post by: Arantor on June 5th, 2013, 09:39 PM
I didn't notice the inversion :/

I normally have half a dozen local accounts, until I wrote the merge-user code, now I only have two local accounts...