Layout, Menu Display

Dear Indico Team,

We set the status of Participant List to Disabled in indico 1.2.1rc10. Then we migrated these events to indico 2.0, but the status of this menu item changed back to Activated.

Maybe is this a bug in migration script?

Thank you

Best regards,
Attila

That’s strange… we do migrate it:

I have created a fresh migration. I attached the screenshot about this issue.

Dear IndicoTeam,

Any update?

Attila

Hm, that is a bit strange. Did you get any warnings/errors in the log during the migration? Or any log entry referring to the Participan List MenuEntry. Also, what version of the indico-migrate package are you using?

I checked the log:

# grep -A3 -B3 '774  layout' migration.log
✓    774  logs        <EventLogEntry(None, None, 2018-08-25 10:56:45.759868+00:00, event, Timetable): Created new session block:>
✓    774  logs        <EventLogEntry(None, None, 2018-08-25 10:56:55.124119+00:00, event, Timetable): Created new session block:>
✓    774  payment     Payment enabled=False, currency=
✓    774  layout      - Layout settings
✓    774  menus       Custom menu
✓    774  regform     2018-08-17 - Registration Form
i    774  regform     Section/Personal - Personal Data

I didn’t find any error in.

These are cloned event. We had other problem with similar cloned event during the migration (eg After migration, lost registration form and data )

I wonder if some data isn’t set in ZODB when cloning… Unfortunately it’s quite hard to track down this kind of issue without having access to the ZODB or installing legacy indico locally…

Are there many events affected by this issue? We could provide you a small Python snippet that disables this particular menu item for all events where no registration form is configured to expose the list of participants.

OK, found the problem. We weren’t renaming the menu item during the migration so the correct one was missing and automatically recreated when accessing the event for the first time - but that newly created one was then marked as enabled.

I just published indico-migrate 1.0.9 on pypi which contains the fix for it.


For those who have already migrated, you can run this script to fix the data - simply open indico shell and paste the following snippet:

for me_part in MenuEntry.query.filter_by(name='participants').all():
    event = me_part.event
    me_reg = event.menu_entries.filter_by(name='registrants').first()
    if not me_reg:
        continue
    db.session.delete(me_part)
    db.session.flush()
    me_reg.name = 'participants'
    if not me_reg.is_enabled:
        for regform in event.registration_forms:
            if not regform.is_participation:
                regform.publish_registrations_enabled = False
    db.session.flush()

for me_reg in MenuEntry.query.filter_by(name='registrants'):
    me_reg.name = 'participants'
    if not me_reg.is_enabled:
        for regform in me_reg.event.registration_forms:
            if not regform.is_participation:
                regform.publish_registrations_enabled = False
    db.session.flush()

db.session.commit()

This will remove the wrong menu entry (in case it was customized since the migration such customizations to this particular entry would be lost) and fix the name of the migrated one.
It will also disable the public participant list for all registration forms if the menu item was disabled to keep in line with the logic used during the migration.

1 Like

It works! Thank you! :slight_smile:

Have a nice day!

1 Like