This topic was marked solved by Nao, on June 6th, 2013, 12:05 PM

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Updated CSS code is buggy
« 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.
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: Updated CSS code is buggy
« Reply #1, 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.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Updated CSS code is buggy
« Reply #2, 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 :/

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Updated CSS code is buggy
« Reply #3, 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..?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Updated CSS code is buggy
« Reply #4, 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.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Updated CSS code is buggy
« Reply #5, on May 31st, 2013, 12:23 AM »
Reminder ;)

Bed time! I've read about 10% of today's posts... freaky!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Updated CSS code is buggy
« Reply #6, 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.
Re: Updated CSS code is buggy
« Reply #7, 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.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Updated CSS code is buggy
« Reply #8, 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.)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Updated CSS code is buggy
« Reply #9, 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.
Re: Updated CSS code is buggy
« Reply #10, 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 ( [0] => 11 )... not repeated because it's all good.

But the test site just gives me:
Array ( [0] => Array ( [props] => Array ( [1] => Array ( [name] => [value] => [id] => 1 [parent] => 0 ) [2] => Array ( [name] => [value] => [id] => 2 [parent] => 0 ) [3] => Array ( [name] => [value] => [id] => 3 [parent] => 0 ) [4] => Array ( [name] => [value] => [id] => 4 [parent] => 0 ) [5] => Array ( [name] => [value] => [id] => 5 [parent] => 0 ) [6] => Array ( [name] => [value] => [id] => 6 [parent] => 0 ) [7] => Array ( [name] => [value] => [id] => 7 [parent] => 0 ) [8] => Array ( [name] => [value] => [id] => 8 [parent] => 0 ) [9] => Array ( [name] => [value] => [id] => 9 [parent] => 0 ) [10] => Array ( [name] => [value] => [id] => 10 [parent] => 0 ) [11] => Array ( [name] => [value] => [id] => 11 [parent] => 0 ) [12] => Array ( [name] => [value] => [id] => 12 [parent] => 0 ) [13] => Array ( [name] => [value] => [id] => 13 [parent] => 0 ) [14] => Array ( [name] => [value] => [id] => 14 [parent] => 0 ) [15] => Array ( [name] => [value] => [id] => 15 [parent] => 0 ) [16] => Array ( [name] => [value] => [id] => 16 [parent] => 0 ) [17] => Array ( [name] => [value] => [id] => 17 [parent] => 0 )

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)

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Updated CSS code is buggy
« Reply #13, 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'

Nao

  • Dadman with a boy
  • Posts: 16,082