Moodle
  1. Moodle
  2. MDL-29254

Cannot add new blog entries after update

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Blog
    • Labels:
    • Database:
      Any, MySQL
    • Testing Instructions:
      Hide
      1. Log in as admin
      2. Add new blog entry (Home -> My profile -> Blogs -> Add a new entry)
      3. make sure you don't get any error
      4. Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs)
      5. Run Cron
      6. make sure you don't get any error
        NOTE: check php error log as well.
      Show
      Log in as admin Add new blog entry (Home -> My profile -> Blogs -> Add a new entry) make sure you don't get any error Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs) Run Cron make sure you don't get any error NOTE: check php error log as well.
    • Workaround:
      Hide

      Everything gets solved by issuing:

      mysql> alter table mdl_post MODIFY COLUMN summary longtext;
      mysql> alter table mdl_post MODIFY COLUMN content longtext;
      
      Show
      Everything gets solved by issuing: mysql> alter table mdl_post MODIFY COLUMN summary longtext; mysql> alter table mdl_post MODIFY COLUMN content longtext;
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-mdl-29254
    • Rank:
      18796

      Description

      I've done an update from moodle 1.9.12 to moodle 2.1.1

      When I try to add a new entry blog I get an 'Error writing to database'.

      What error log says is something like this:

      [Tue Sep 06 13:48:56 2011] [error] Default exception handler: Error writing to database Debug: Column 'summary' cannot be null
      
      bla,bla,bla... :)
      
       line 186 of /blog/edit.php: call to blog_entry->add()
      , referer: http://moodle2.cleome.uji.es:81/blog/edit.php?action=add
      

      Problem is that after the update column summary and content stays defined as NOT NULL (as defined un my 1.9.x installation).

      I've seen xmldb definition and this two fields are not defined as NOT NULL (in 1.9.x too)... so maybe this problem comes from an earlier update.

      Maybe someone has the same problem...

      Regards

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that and providing a workaround.

          I couldn't find a report with similar circumstances.

          Show
          Michael de Raadt added a comment - Thanks for reporting that and providing a workaround. I couldn't find a report with similar circumstances.
          Hide
          Juan Segarra Montesinos added a comment - - edited

          I've compared my schema with a clean installation and there are many diferences... Our upgrading path was 1.6.x -> 1.8.x -> 1.9.x over the years. I thinks some steps were missed during this time

          Show
          Juan Segarra Montesinos added a comment - - edited I've compared my schema with a clean installation and there are many diferences... Our upgrading path was 1.6.x -> 1.8.x -> 1.9.x over the years. I thinks some steps were missed during this time
          Hide
          Jim Peterson added a comment -

          I am wondering if there are any downsides to the fix stated above. I have the same issue, and it fixes the problems on my test server but before I run the fix on the production server I am wondering what the unintended consequences might be.

          Show
          Jim Peterson added a comment - I am wondering if there are any downsides to the fix stated above. I have the same issue, and it fixes the problems on my test server but before I run the fix on the production server I am wondering what the unintended consequences might be.
          Hide
          Jason Fowler added a comment -

          Will be fixed by MDL-30521 - Handled by Raj

          Show
          Jason Fowler added a comment - Will be fixed by MDL-30521 - Handled by Raj
          Hide
          Rajesh Taneja added a comment -

          As mentioned in description, this happened because summary and content were set "not null".
          Also, (as mentioned) it is not an issue in 1.9+. I agree this might have propagated from 1.8.x or back.
          I will add this check in upgrade script and it should be fine

          Show
          Rajesh Taneja added a comment - As mentioned in description, this happened because summary and content were set "not null". Also, (as mentioned) it is not an issue in 1.9+. I agree this might have propagated from 1.8.x or back. I will add this check in upgrade script and it should be fine
          Hide
          Rajesh Taneja added a comment -

          Reopening this issue. After talking with Sam, it seems like we need two separate patches for MDL-30521 and this.

          Show
          Rajesh Taneja added a comment - Reopening this issue. After talking with Sam, it seems like we need two separate patches for MDL-30521 and this.
          Hide
          Rajesh Taneja added a comment -

          Changing priority to blocker, as it's caused by inconsistency in database.

          Show
          Rajesh Taneja added a comment - Changing priority to blocker, as it's caused by inconsistency in database.
          Hide
          Rajesh Taneja added a comment -

          Please advice, if 20 and 19 branches are required for this bug.
          Also, I have bumped 1 extra version considering a version bump by MDL-30521, to avoid conflicts.

          Show
          Rajesh Taneja added a comment - Please advice, if 20 and 19 branches are required for this bug. Also, I have bumped 1 extra version considering a version bump by MDL-30521 , to avoid conflicts.
          Hide
          Jason Fowler added a comment -

          Code looks good Raj

          Show
          Jason Fowler added a comment - Code looks good Raj
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Rajesh Taneja added a comment -

          Branches re-based.

          Show
          Rajesh Taneja added a comment - Branches re-based.
          Hide
          Sam Hemelryk added a comment -

          Thanks Raj, this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Raj, this has been integrated now
          Hide
          Gerard Caulfield added a comment -

          No errors at any stage on master, 22 or 21. Test passed.

          Show
          Gerard Caulfield added a comment - No errors at any stage on master, 22 or 21. Test passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Some changes to Moodle should be milestones in the project by themselves.

          This is not the case and your fix is not so important, but your collaboration is highly appreciated, thanks!

          Closing as fixed, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Some changes to Moodle should be milestones in the project by themselves. This is not the case and your fix is not so important, but your collaboration is highly appreciated, thanks! Closing as fixed, ciao

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: