Inline Editing stopped working once gone live - SOLVED (...ISH)

edited July 2011 in Modules
As it says on the box. Since I've put my site up live, the inline editing seems to have stopped working, on both 'body' content rendered with fuel_var, and modules using with fuel_edit.

I can edit both the modules and pages fine using admin, but inline editing yields nothing. The pencil icon appears ok, and the page content appears ok in the inline edit box. After making the changes and pressing 'save', however, the page is not changed.

Examples:

Home page, uses 'home.php' layout. Expecting 'body' in the content div to be editable:

<?php $this->load->view('_blocks/header')?>
<?php $this->load->view('_blocks/right')?>
<?php $this->load->view('home')?>

div id="content"
<?php echo fuel_var('body', ''); ?>
/div

<?php echo fuel_block('footer')?>
<?php endif; ?>

Pertinent code from my 'wordbox' module Expecting this to update the record identified by 'id' in the wordbox table :

<?php echo fuel_edit($row->id, 'Edit:'.$row->title, 'wordbox');?><?php echo $row->content;?>


This all worked fine on my development box, so bit confused and having difficulty finding the difference as to why it's not working on my live set-up, especially since I can update via admin, and the inline editing function has no trouble retrieving the data. This suggests it's not a database connection problem.

Cheers for any help!

Comments

  • edited 10:34AM
    Have you checked the javascript console in your browser for ajax errors?
    If you're on Chrome use the View->Developer->Javascript Console - if you're on Firefox and you still don't have it, it's time to get the Developer's toolbar.

    What you would be looking for are 404 requests when you click the inline edit icon. Possibly this has to do with clean_urls configuration?
  • edited 10:34AM
    Hi Pierlo,

    Thanks for the reply. Ok,will have a look into clean_urls config. In the meantime, here is some more info:

    Using firebug, when I load any page whilst logged in to admin, I get the following two errors in my console:

    -missing ; before statement
    [Break On This Error] .currentTop;var V-U)ag=aa.height-Z.hei...r Z=C.getChild(0).getFrameDocument(); ckedit...3948800 (line 98)

    -syntax error
    [Break On This Error] } else { // opera jquery...3948800 (line 336)

    Then, when I click on the inline edit icon, the following GET request shows up in the console:

    http://www.mydomain.com/fuel/pages/inline_edit/body/13

    Response header for this is:

    Date Wed, 27 Jul 2011 09:20:06 GMT
    Server Apache
    Keep-Alive timeout=5, max=88
    Connection Keep-Alive
    Content-Type text/html
    Cache-Expires Mon, 26 Jul 1997 05:00:00 GMT
    Expires Mon, 26 Jul 1997 05:00:00 GMT
    Content-Length 2809


    but then I get a new javascript error in the console:

    $(elem).markItUp is not a function
    [Break On This Error] $(elem).markItUp(myMarkItUpSettings); edit_m...3948800 (line 311)

    Also - Notcied another symptom. I tried to load in my existing header into blocks, but the page froze when asking to confirm whether I wanted to autoload the updated header block...


    Hoping someone has some advice on this , as at the moment seems well beyond my ken!

    Cheers!
  • edited 10:34AM
    well, those seem legit javascript errors that might prevent the rest of the scripts to function normally... especially cause they seem to be related with ckeditor/markitup

    have you looked inside the 'Response' (not header) tab in firebug on the ajax request for the inline editor?do you get the expected html for the editor in there?
  • edited July 2011
    In the console, under the Net section, there are two HTML requests. One for the actual page (www.mydomain.com), and this gets a 200 ok. The page loads with this request then about half a second later, as the fuel admin bar and editing icons load, I get a second request for www.mydomain.com/undefined - This gets a 404. The response tab for this request is empty.

    EDIT - additional info. I nthe net console, each click on the inline editing icon creates a request in the XHR (XMLHttpRequest) panel. I assume this is the ajax request. This brings back a 200 ok, and in the response, we have the html for the edit section.

    Each of the these calls, however, produces another javascript error in the console -

    myMarkItUpSettings is not defined
    [Break On This Error] myMarkItUpSettings.previewPar...Settings.previewParserPath + '?' + q;

    Suggests url problems somewhere?
  • edited July 2011
    EDIT: (it was a typo)

    Can u tell more about that 'undefined' 404 request? That sounds like the culprit imho
  • edited 10:34AM
    Just been for a run to clear my head :-)

    Ran through the diagnostics you suggested on my development box - seems the undefined issue is there as well. It seems connected to a jquery carousel I am running. There is no noticable errors, but when I remove that script the 'undefined' error dissapears, so seems like as good a place to start as any.

    So, will start pulling that apart, see what it's doing to cause this error. Thanks for the help so far!

    Cheers
  • edited 10:34AM
    Well, think I'd best give up for the day!

    I've stripped out all the javascript from my page, left in only:

    php echo js('jquery,main')

    and I'm still getting three errors when viewing my page logged into fuel:

    - missing ] after element list
    [Break On This Error] toLowerCase()!=="object"){var m=e,n=e....d='"+o+"'] "+b),f)}catch(s){}finally{n
    jquery...3948800 (line 16)
    - $ is not defined
    [Break On This Error] $(document).ready(function(){
    home (line 136)
    - missing ; before statement
    [Break On This Error] l{\tmargin-left: 0px;\tpadding-left: 4...);}}return E;},arrayToList:function(C,
    ckedit...3948800 (line 61)

    I DONT get the thrid error when I am viewing the page logged out of fuel

    And, whilst back in admin, but away from my page just on the dashboard, I get the following error:


    -missing ; before statement
    [Break On This Error] l{\tmargin-left: 0px;\tpadding-left: 4...);}}return E;},arrayToList:function(C,
    home (line 299)

    The frustrating thing is that it's working fine on my development box now. If anyone has any ideas or pointers, would be greatly appreciated. I'm hoping that it's soemthing daft as I'm compeltely stumped!

    Cheers,
    Tallowman
  • edited 10:34AM
    '$ is not defined' means jquery is not loaded in my experience...
  • edited 10:34AM
    Yeah, I've loaded in the jquery library from ajax.googleapis.com/ instead of the one supplied with Fuel, and that has got rid of all the errors when just viewing the page. However, when I log in, I still get the following whether viewing my pages or in the dashboard:

    - missing ; before statement
    [Break On This Error] l{\tmargin-left: 0px;\tpadding-left: 4...);}}return E;},arrayToList:function(C,
    ckedit...3948800 (line 61)

    Still can't use inline editing, I get:
    edit_m...3948800 (line 173)
    CKEDITOR is not defined
    [Break On This Error] if (CKEDITOR && CKEDITOR.instances != undefined){

    I feel like I'm going a bit mad. Going to have a break for a while. Thanks for the help :-)
  • edited 10:34AM
    Is there anything in the main.js file that may be causing issues?
  • edited July 2011
    I've stripped out every piece of javascript in my site and it seems to working now. So will start adding everything in again slowly and see what trips it. Already done this once, but guess I missed something!

    EDIT - cleaned out my cache and everything seemd to working. Updated the home page body a few times, and then first I got an 'illegal character' error, and then the 'missing ; before statement' error came back. Without me adding back in any of my javascript.

    The inline editing seems to work regardless of these errors - but still don't like them being there. Completley lost as to where to go now with this!

    Cheers.
  • edited 10:34AM
    Do you have a link I can view this at?
  • edited 10:34AM
    Sure, I've sent the link to info@getfuelcms.com, title 'javascript issue'
  • edited 10:34AM
    For those of you interested, or who may suffer the same or similar in the future, I think I've got to the bottom of the issue, with some help from people on the forum of course :-)

    The inline-editing issue only occurs in Firefox, and doing a ctrl+F5 refresh clears the error. I discovered that sometimes the javascript files being served by the firefox cache had parts of other files appended to the end of them. This of course caused errors, and in particular when the ckedit js was affected, it stopped inline editing working.

    I managed to find this on bugzilla, which seems to relate to my problem:

    https://bugzilla.mozilla.org/show_bug.cgi?id=355567

    Not sure why it's affecting my site, and not 100% convinced this is the complete story, but it seems to be best fit at the moment.

    So guess I'll start using chrome!
Sign In or Register to comment.