Posts: 6
Threads: 2
Joined: Feb 2010
Hi,
have a strange problem with the error-messages on pages.php
If I try to delete the index-page, it shouldn't be deleted but an error-message should be displayed that the index-page can't be deleted. I am very sure I saw it on its first appearance, but now it won't display any more. The same is, if a page is deleted - after asking whether I'm sure, the page is being deleted, but no message appears at all.
The messages are displayed, if I disable javascript, so I guess it has something to do with that. Does anybody have a clue what could be wrong there?
To be sure that it don't affect on changes I made on the code, I installed a fresh 2.0 version and tried it also on opensourcecms-demo, all with the same effect .
Thanks for any advice
- Daniel
Posts: 972
Threads: 27
Joined: Aug 2009
Interesting, this will need looking into. I thought to bump into this problem when I was developing a plugin as well. Thanks for bringing this up!
Posts: 1,848
Threads: 86
Joined: Aug 2009
This is because i tried to remove the page-refresh after page deletion. The page is still moved into "Backups", so an undo is still possible... I just couldn't find a way to display the confirmation message via javascript. When you turn off JS, PHP takes over and the error message is displayed (and the page refreshes)
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 6
Threads: 2
Joined: Feb 2010
Is this behaviour different to them of upload.php? I compared both php-files, but I didn't see the difference. At upload.php the messages are shown as expected...
Posts: 6
Threads: 2
Joined: Feb 2010
puhhh, today I had some time to step into the jquery API and this javascript to get a solution for this. Somehow I figured out to get the error or update message from the response and place it onto the current page:
Code:
$(".delconfirm").live("click", function() {
var message = $(this).attr("title");
var dlink = $(this).attr("href");
var answer = confirm(message);
var id=$(this).parents("tr").attr("id");
if (answer){
$('#loader').show();
$("#"+id).addClass('deletedrow');
$("#"+id).fadeOut(500, function(){
$.ajax({
type: "GET",
url: dlink,
success: function(response){
$("#"+id).remove();
$("#page_counter").html("");
if($("#pg_counter").length) {
counter=$("#pg_counter").html();
$("#pg_counter").html(counter-1);
}
$('table.paginate tr').quickpaginate( { perpage: 15, showcounter: true, pager : $("#page_counter") } );
//return false;
//******* added by dniesel:
if($(response).find('div.error').html()) {
$('div.bodycontent').before('<div class="error">'+ $(response).find('div.error').html() + '</div>'); }
if($(response).find('div.updated').html()) {
$('div.bodycontent').before('<div class="updated">'+ $(response).find('div.updated').html() + '</div>'); }
//******
}
});
$('#loader').fadeOut(500);
});
} else {
return false;
}
return false;
});
Posts: 1,848
Threads: 86
Joined: Aug 2009
That worked perfectly... thank you very much!!
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!