Moodle
  1. Moodle
  2. MDL-34318

Blog associations are never removed from the database

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.3.1
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Blog
    • Labels:
    • Testing Instructions:
      Hide

      Before testing
      It would be ideal to have access to the database tables so that you can confirm that the entries have been deleted.

      Testing Steps

      1. Go to [Settings ► Site administration ► Appearance ► Blog] and 'Enable blog associations'
      2. Go to a course or create on if you don't have one.
      3. Add the Blog Menu block.
      4. 'Add an entry about this course' (Fill out the form details). Save changes.
      5. Check the database (mdl_blog_association). You should have an entry in this table.
      6. Delete the blog entry.
      7. Re-check the database table. The entry should be deleted.
      Show
      Before testing It would be ideal to have access to the database tables so that you can confirm that the entries have been deleted. Testing Steps Go to [Settings ► Site administration ► Appearance ► Blog] and 'Enable blog associations' Go to a course or create on if you don't have one. Add the Blog Menu block. 'Add an entry about this course' (Fill out the form details). Save changes. Check the database (mdl_blog_association). You should have an entry in this table. Delete the blog entry. Re-check the database table. The entry should be deleted.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-34318-master
    • Rank:
      42686

      Description

      When a blog entry that is associated with a module or a course is removed, the blog association is not removed from the database.

      Replication steps:

      1. Create a new blog entry that is associated with a course or a module. (See http://docs.moodle.org/19/en/Blogs_2.0#Blog_associations on how to create associated blog entries.)
      2. The entry will be saved in the database table [db prefix]_post, the association will be saved in the table [db prefix]_blog_association, note the last entry in the post table and the blog_association table, this is where your entry and it's association are saved.
      3. Remove your newly created entry.
      4. Take a new look at [db prefix]_post and [db prefix]_blog_association, the last entry in blog_association will remain, although the entry in the post table is removed.

        Activity

        Erik Lundberg created issue -
        Erik Lundberg made changes -
        Field Original Value New Value
        Testing Instructions 1) Create a new blog entry that is associated with a course or a module. (See http://docs.moodle.org/19/en/Blogs_2.0#Blog_associations on how to create associated blog entries.)
        2) The entry will be saved in the database table [db prefix]_post, the association will be saved in the table [db prefix]_blog_association, note the last entry in the post table and the blog_association table, this is where your entry and it's association are saved.
        3) Remove your newly created entry.
        4) Take a new look at [db prefix]_post and [db prefix]_blog_association, the last entry in blog_association will remain, although the entry in the post table is removed.
        Erik Lundberg made changes -
        Pull Master Diff URL https://github.com/eriklundberg/moodle/compare/master...MDL-34318_blog_associations_not_removed
        Pull Master Branch MDL-34318_blog_associations_not_removed
        Pull from Repository https://github.com/eriklundberg/moodle.git
        Labels patch
        Hide
        Michael de Raadt added a comment -

        Thanks for spotting that and providing a solution.

        Show
        Michael de Raadt added a comment - Thanks for spotting that and providing a solution.
        Michael de Raadt made changes -
        Fix Version/s STABLE backlog [ 10463 ]
        Testing Instructions 1) Create a new blog entry that is associated with a course or a module. (See http://docs.moodle.org/19/en/Blogs_2.0#Blog_associations on how to create associated blog entries.)
        2) The entry will be saved in the database table [db prefix]_post, the association will be saved in the table [db prefix]_blog_association, note the last entry in the post table and the blog_association table, this is where your entry and it's association are saved.
        3) Remove your newly created entry.
        4) Take a new look at [db prefix]_post and [db prefix]_blog_association, the last entry in blog_association will remain, although the entry in the post table is removed.
        Priority Minor [ 4 ] Major [ 3 ]
        Description When a blog entry that is associated with a module or a course is removed, the blog association is not removed from the database. When a blog entry that is associated with a module or a course is removed, the blog association is not removed from the database.

        *Replication steps:*
        # Create a new blog entry that is associated with a course or a module. (See http://docs.moodle.org/19/en/Blogs_2.0#Blog_associations on how to create associated blog entries.)
        # The entry will be saved in the database table [db prefix]_post, the association will be saved in the table [db prefix]_blog_association, note the last entry in the post table and the blog_association table, this is where your entry and it's association are saved.
        # Remove your newly created entry.
        # Take a new look at [db prefix]_post and [db prefix]_blog_association, the last entry in blog_association will remain, although the entry in the post table is removed.
        Labels patch patch triaged
        Assignee moodle.com [ moodle.com ] Jason Fowler [ phalacee ]
        Jason Fowler made changes -
        Fix Version/s STABLE Sprint 23 [ 12358 ]
        Fix Version/s STABLE backlog [ 10463 ]
        Adrian Greeve made changes -
        Assignee Jason Fowler [ phalacee ] Adrian Greeve [ abgreeve ]
        Adrian Greeve made changes -
        Status Open [ 1 ] Development in progress [ 3 ]
        Adrian Greeve made changes -
        Pull Master Diff URL https://github.com/eriklundberg/moodle/compare/master...MDL-34318_blog_associations_not_removed https://github.com/abgreeve/moodle/compare/wip-MDL-34318-master
        Pull Master Branch MDL-34318_blog_associations_not_removed wip-MDL-34318-master
        Pull 2.3 Diff URL https://github.com/abgreeve/moodle/compare/moodle:MOODLE_23_STABLE...abgreeve:wip-MDL-34318-MOODLE_23_STABLE
        Testing Instructions *Before testing*
        It would be ideal to have access to the database tables so that you can confirm that the entries have been deleted.

        *Testing Steps*
        # Go to [Settings ► Site administration ► Appearance ► Blog] and 'Enable blog associations'
        # Go to a course or create on if you don't have one.
        # Add the Blog Menu block.
        # 'Add an entry about this course' (Fill out the form details). Save changes.
        # Check the database (mdl_blog_association). You should have an entry in this table.
        # Delete the blog entry.
        # Re-check the database table. The entry should be deleted.
         
        Pull 2.2 Diff URL https://github.com/abgreeve/moodle/compare/moodle:MOODLE_22_STABLE...abgreeve:wip-MDL-34318-MOODLE_22_STABLE
        Pull 2.2 Branch wip-MDL-34318-MOODLE_22_STABLE
        Pull from Repository https://github.com/eriklundberg/moodle.git git://github.com/abgreeve/moodle.git
        Pull 2.3 Branch wip-MDL-34318-MOODLE_23_STABLE
        Adrian Greeve made changes -
        Status Development in progress [ 3 ] Waiting for peer review [ 10012 ]
        Ankit Agarwal made changes -
        Original Estimate 0 minutes [ 0 ]
        Remaining Estimate 0 minutes [ 0 ]
        Status Waiting for peer review [ 10012 ] Peer review in progress [ 10013 ]
        Peer reviewer ankit_frenz
        Hide
        Ankit Agarwal added a comment -

        Looks good Adrian!
        +1 for integration

        Thanks

        Show
        Ankit Agarwal added a comment - Looks good Adrian! +1 for integration Thanks
        Ankit Agarwal made changes -
        Status Peer review in progress [ 10013 ] Development in progress [ 3 ]
        Hide
        Adrian Greeve added a comment - - edited

        Thanks for the review Ankit.

        Submitting for integration.

        Dear Integrator,

        Please pull out of integration if I haven't included some code to clean up any orphaned blog associations.

        Show
        Adrian Greeve added a comment - - edited Thanks for the review Ankit. Submitting for integration. Dear Integrator, Please pull out of integration if I haven't included some code to clean up any orphaned blog associations.
        Adrian Greeve made changes -
        Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
        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
        Sam Hemelryk made changes -
        Currently in integration Yes [ 10041 ]
        Sam Hemelryk made changes -
        Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
        Integrator samhemelryk
        Hide
        Sam Hemelryk added a comment -

        Thanks Adrian, this has been integrated now.

        Show
        Sam Hemelryk added a comment - Thanks Adrian, this has been integrated now.
        Sam Hemelryk made changes -
        Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
        Fix Version/s 2.2.5 [ 12352 ]
        Fix Version/s 2.3.2 [ 12353 ]
        Michael de Raadt made changes -
        Tester fred
        Frédéric Massart made changes -
        Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
        Hide
        Frédéric Massart added a comment -

        Test passed. \o/

        Show
        Frédéric Massart added a comment - Test passed. \o/
        Frédéric Massart made changes -
        Status Testing in progress [ 10011 ] Tested [ 10006 ]
        Adrian Greeve made changes -
        Link This issue has a non-specific relationship to MDL-35265 [ MDL-35265 ]
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Many thanks for the hard work.

        These changes have been spread upstream and are already available in the git and cvs repositories.

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Many thanks for the hard work. These changes have been spread upstream and are already available in the git and cvs repositories. Ciao
        Eloy Lafuente (stronk7) made changes -
        Status Tested [ 10006 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Currently in integration Yes [ 10041 ]
        Integration date 07/Sep/12
        Michael de Raadt made changes -
        Link This issue has a non-specific relationship to MDL-35265 [ MDL-35265 ]
        Eloy Lafuente (stronk7) made changes -
        Fix Version/s STABLE Sprint 23 Alpha [ 12358 ]

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: