Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release 3.3.0 Beta
#26
well its all fixed now, and uploadify sucks and is going away in 3.4 probably.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#27
Also i just found that redirects (through uploadify ajax request) are not handled.
[Image: Kijel_l_s_014.jpg]

Edit: I just see your reply well a good alternative would be blueimp jquery file upload. Seems to be a good one.
https://github.com/blueimp/jQuery-File-Upload
Reply
#28
Yeah already an issue for uploader replacement
https://github.com/GetSimpleCMS/GetSimpl...7?source=c

My install did that to me today, I thought, this is a kewl way to do inline logging in on expired sessions.
although I have no idea why that is being output like that. Do you ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#29
(2013-10-24, 06:59:38)shawn_a Wrote: What is the url filename ?
update.php or install.php ?

It's install.php
English isn't my native language. Sorry for any mistakes you may find.
Reply
#30
Ajax is not handling php headers so when you call login_cookie_check() there will be either a header or href redirect.
You could add an extra check if the file that contains the login_cookie_check() is called through ajax if so then add an extra data containing the redirect url to the response and handle the redirect from the ajax process else just do the normal header or location.href. Not sure if im clear so heres an example:
PHP Code:
<?php
//file called by ajax
if (isAjax()) {
    
login_cookie_check(true);
} else {
    
login_cookie_check();
}
?>
then
PHP Code:
<?php
//file with login_cookie_check()
function login_cookie_check($ajax=false) {
    global 
$cookie_login;
    if(
cookie_check()) {
        
create_cookie();
    } else {
        
$qstring filter_queryString(array('id'));
        
$redirect_url $cookie_login.'?redirect='.myself(FALSE).'?'.$qstring;
        
redirect($redirect_url,$ajax);
    }
}
?>
and
PHP Code:
<?php
function redirect($url,$ajax=false) {
    global 
$i18n;
    if (
$ajax) {
        echo 
'The extra response that will be handled by the ajax call (maybe a json formated result would be the best)';
    } else {
        if (!
headers_sent($filename$linenum)) {
            
header('Location: '.$url);
        } else {
            echo 
"<html><head><title>".i18n_r('REDIRECT')."</title></head><body>";
            if ( !
isDebug() ) {
                echo 
'<script type="text/javascript">';
                echo 
'window.location.href="'.$url.'";';
                echo 
'</script>';
                echo 
'<noscript>';
                echo 
'<meta http-equiv="refresh" content="0;url='.$url.'" />';
                echo 
'</noscript>';
            }
            echo 
i18n_r('ERROR').": Headers already sent in ".$filename." on line ".$linenum."\n";
            
printf(i18n_r('REDIRECT_MSG'), $url);
            echo 
"</body></html>";
        }
        exit;
    }
}
?>
after these handle ajax request in uploadify js (unfortunately im not that experienced with uploadify but from what i see http response body is not accessible on error so i just give another example):
PHP Code:
function(response){ 
            if (
response.redirect_url) {
                
window.location.href response.redirect_url;
            }
            else {
                
// Process the rest of the upload
            
}

Not usre if its clear so just let me know if not.
Reply
#31
No that's not what I mean. I was trying to figure why the response was being output.
Ill have to check the docs for jquery load() I used. It should only output fragments it finds
Code:
                $('#imageTable').load(location.href + ' #imageTable >*', function () {

Unless it dumps everything if the rule is unmatched or I maybe I have it wrong.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#32
Oh lol i see now ^^ sorry i didnt understand it first.
Well that makes sense. It outputs the response cause in sidebar-files.php is
PHP Code:
$('#maincontent').load(location.href+' #maincontent > *'); 
instead of what you wrote:
PHP Code:
$('#imageTable').load(location.href ' #imageTable >*',... 

#maincontent is the key then.
But still it wont redirect
Reply
#33
sigh, thank you kolyok!

damn javascript in the sidebar. arghhh, this all needs to be fixed, js scattered all over.

I imagine I am going to leave this as is. I mean you can login there and get right back where you were, works for me.
Its not really broken just inconsistent, and this code will all go away anyway.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#34
ok I went ahead and just fixed ajax timeouts anyway. heh

Also I found an issue that has probably always existed but is now an issue, and am curious how we should handle it without redesigning it entirely atm.

Update.php gets executed after an upgrade, then is deleted along with install.php and setup.php, if not a new install. What is now new is that is that it used to only run when upgrading from a pre 3.x version. Now it is always executed by design.

The problem with this is that if the file exists and a visitor visits the front end they are redirected to the update.php. So basically you have to visit your site after upgrading to avoid this, I think this has always been an issue, but now more so, and since we have no maintainence mode someone ( the first visitor )will get redirected to the login page.

I have added logic to send a 503 and a new lang string when visiting front end after upgrades.
I also added a new status and lang string for upgrades when visiting back end.

Should I do the same for installs or would that be confusing for people to have to actually goto /admin and not just site root.

This has been pushed to develop branch if anyone wants to test it before i move it over to the beta.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#35
Luigi, I was finally able to reproduce your bug report, thank you.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#36
Updated to beta 2, all reported issues should be fixed now.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#37
Just cloned and testing found a small glitch on backup edit
[Image: Kijel_l_s_015.jpg]
It just keep saying Redirecting

Edit: Found the root of this. It was that the json response was broken because of debug php errors.
Theres an undefined index 'sort' in basic.php 'subval_sort()' line 182 caused by template_functions.php list_pages_json() line 702
PHP Code:
$pagesSorted subval_sort($pagesArray,'sort'); 

That 'sort' is for menu ordering if i understand correctly so shouldnt be 'menuOrder' instead?

Note: Not only backup-edit.php but all files that call this check are broken if debug enabled o.O
Reply
#38
Did you click anything? I do not get that.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#39
It only happens if you have debug on your php i mean error reporting.
Because that 'sort' is not in the pagesArray index it throws undefined index notices check the image below i post the response value (using xdebug for debugging php).
[Image: K_perny_k_p_2013_10_25_00_05_34.jpg]
Reply
#40
Fixed both updated b2 tag

The sort is still broken I think, I gotta figure that one out, this worked and I must have broke it, i cherry picked a fix for the sort error so its silent now.

Thanks alot, sorry about the bugs, I swear I test stuff lol.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#41
^^ no problem.
As for the sort i have searched through the files abit more but i can't seem to find that any value that is added to $pagesArray with the 'sort' index key.
So i believe that should be sorted by the menuOrder instead.
(menu-manager.php uses 'menuOrder' too: $pagesSorted = subval_sort($pagesArray,'menuOrder'); )
So here's my $pagesArray
[Image: Kijel_l_s_019.jpg]
here's what my menu order should be:
[Image: Kijel_l_s_016.jpg]
here's how the menu order looks in (for example) cke link to local page before changing list_pages_json:
[Image: Kijel_l_s_018.jpg]
and here's the menu order after changing list_pages_json to 'menuOrder' instead of 'sort':
[Image: Kijel_l_s_017.jpg]
Reply
#42
Yeah this is all related to 2 page cache optimization that I cherry picked into develop from master, this is an issue in master branch also. IN some code pagesarray was being reordered as the sort and corrupting the global pagesarray, I tried to fix these by using temp vars but there is still something missing, like a global sorted array. Which was going to be completly redone in 3.4 so i do not want to waste much time fixing it.
I can probably come up with a quick dirty fix for this for now.

I should have just left this alone, but the speed improvements are well worth it. As these functions were not cached or using pagecache.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#43
Sorry I already fixed this, I am just trying to figure out why the hell ckeditor is encoding entities preventig me from putting indentation spaces in the dropdown.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#44
Fixed , also brought over some more fixes for pagesArray corruption.
Thanks kolyok

Carlos,
I cherry picked this in from master
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/483
I believe this fixes the cause of page cache to not be associative array sometimes.
Of course anyone accessing the global could be doing some in place sorting or mergeing or splicing that is not key safe. Something that will need to be protected in the future somehow, so we can reliably use it.

I bumped v.3.3.0b2 tag to latest commit on release.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#45
3.3.0b2 is loading file pages.xml
- in every backend page (including those that don't need $pagesArray)
- twice in frontend and in backend pages.php and menu-manager
Reply
#46
Yeah i was looking at that yesterday i think i can just stick a
if(pagesArray) return; right after the global in getPagesXmlValues

As far as always loading, yes the cache is always loaded now, 3.4.0 will have true lazy loading.
But I have eliminated so many file loads in 3.2 and this that this is still a net gain of several hundreds of milliseconds. I have tested cache loads of large size and they are still so negligible. I have discussed this elsewhere also. hmm

There are a bunch of core functions that call getPagesXmlValues values directly and imagine this was already an issues in some cases.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#47
Testing with a 2000 page site ( each with about 4k of metadata ).
My pages.xml is 1.4mb.

It takes an average of 130ms to load the cache file ( 100x sample size )

Most sites with <200 pages will have cache load times of about 5-20ms
And less than a mb in memory.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#48
Using GS v3.3.0b2, downloaded today from the Beta download link.

I can't start the install by going to http://webroot – ­I get a 503 Temp. Unavailable error. The same result from a local LAMP server and from my usual web host; different browsers (Firefox, Chromium, Firefox with a clean profile).

If I go to http://webroot/admin/install.php, the installation starts as expected and continues normally. After installing, the site works correctly.

I'm sure I must be missing something obvious ...
--
Nick.
Reply
#49
Ah yes, also happens to me (XAMPP). (I had only tested upgrading.)
It works if I go to SITE/admin (I get redirected to SITE/admin/install.php) but not SITE/
Reply
#50
It could be related to this(?)

Issue: https://github.com/GetSimpleCMS/GetSimpleCMS/issues/674
Quote:I have added logic to send a 503 and a new lang string when visiting front end after upgrades.
I also added a new status and lang string for upgrades when visiting back end.

Should I do the same for installs or would that be confusing for people to have to actually goto /admin and not just site root.
Reply




Users browsing this thread: 1 Guest(s)
Free HDTV Channels Residential Solar Panels