#64 Bugfix for block update in module update

Patches
closed
Jan Pedersen
4
2012-09-25
2004-10-22
D.J.
No

If the blocks of a module are changed, they wont be
updated when running module update.
The bug exists in the current
system/admin/modulesadmin/main.php
around line #360-380

the fixed file is attached.

Discussion

1 2 3 > >> (Page 1 of 3)
  • Jan Pedersen
    Jan Pedersen
    2004-10-22

    Logged In: YES
    user_id=841117

    Global variable $newbid is used before it is defined (line 381)

    Also, what's wrong with
    if ($fcount ==0) {

    since you changed it to
    if ($fcount <=1) {

    (minor things, though)

     
  • Jan Pedersen
    Jan Pedersen
    2004-10-23

    Logged In: YES
    user_id=841117

    The problem, we've found here is this:

    If a module is installed with a block that does not use a
    template and then the module is updated and now the block
    DOES use a template - then the template is not inserted into
    the database.

    Therefore I have uploaded a new modulesadmin/main.php that
    checks if there is an existing template for the block.
    If there is, it is updated.
    If there is not, it will be created.

     
  • Jon
    Jon
    2004-11-06

    Logged In: YES
    user_id=784392

    Just a note to anyone, the fixed main.php file is not based on
    2.0.9's main.php, so only use the uploaded main.php if you
    are running an installation prior to 2.0.9

    i noticed this difference when i found modulesadmin/main.php
    being distributed with newbb2 RC3, so the new onUpdate
    feature of 2.0.9 (dunno if anything else) will be broken if this
    modified main.php is used.

     
  • D.J.
    D.J.
    2004-11-10

    Logged In: YES
    user_id=1001493

    OK, I'll take care of this one personally.

     
  • D.J.
    D.J.
    2004-11-10

    Logged In: YES
    user_id=1001493

    Mith, the doubled-block problem is caused by the modified
    main.php file, both my first draft and your version.

    Do you have any temporary workaround for the doubled blocks?
    Or have to removed by using phpmyadmin?

     
  • Jan Pedersen
    Jan Pedersen
    2004-11-10

    Logged In: YES
    user_id=841117

    I have changed the line

    if ($fcount <= 1) {

    to

    if ($fcount == 0) {

    See if that changes anything.

     
  • Jan Pedersen
    Jan Pedersen
    2004-11-10

     
    Attachments
  • Jan Pedersen
    Jan Pedersen
    2004-11-10

    Logged In: YES
    user_id=841117

    I've attached a new main.php with this change in it (as well
    as onUpdate function) so please test with this.

     
  • Jan Pedersen
    Jan Pedersen
    2004-11-18

    Logged In: YES
    user_id=841117

    This working without duplicating the blocks?

     
1 2 3 > >> (Page 1 of 3)