Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sympa::Scenario::new() was unable to load scenario filename including dots #589

Merged

Conversation

salaun-urennes1
Copy link
Collaborator

We are upgrading from Sympa 6.2.36 to 6.2.42.
After upgrading our test staging instance of Sympa we encountered an error while editing the liste config through the web interface:

DIED: Can't call method "get_current_title" on unblessed reference at /usr/local/sympa/bin/wwsympa.fcgi line 10847.
 at /usr/local/sympa/bin/wwsympa.fcgi line 10847.
	main::_do_edit_list_request(Sympa::List::Config <test-sympa-2-2-42@listes.univ-rennes1.fr>, HASH(0x59b0758), ARRAY(0x5bbf7e0)) called at /usr/local/sympa/bin/wwsympa.fcgi line 10771
	main::do_edit_list_request() called at /usr/local/sympa/bin/wwsympa.fcgi line 1558

The log says:

Apr  8 10:35:40 vmperl-tsympa1 wwsympa[10736]: info main::do_edit_list_request(description) [robot listes.univ-rennes1.fr] [session 50683453466904] [client 129.20.126.26] [user odile.germes@univ-rennes1.fr] [list test-sympa-2-2-42]
Apr  8 10:35:40 vmperl-tsympa1 wwsympa[10736]: err main::#1558 > main::do_edit_list_request#10771 > main::_do_edit_list_request#10842 > Sympa::Scenario::get_scenarios#1617 > Sympa::Scenario::new#156 Unknown or undefined scenario function "visibility"
Apr  8 10:35:40 vmperl-tsympa1 wwsympa[10736]: err main::#1558 > main::do_edit_list_request#10771 > main::_do_edit_list_request#10842 > Sympa::Scenario::get_scenarios#1617 > Sympa::Scenario::new#156 Unknown or undefined scenario function "visibility"
Apr  8 10:35:40 vmperl-tsympa1 wwsympa[10736]: err main::#1558 > main::do_edit_list_request#10771 > main::_do_edit_list_request#10847 DIED: Can't call method "get_current_title" on unblessed reference at /usr/local/sympa/bin/wwsympa.fcgi line 10847.

Here is what happens:

  1. Sympa::Scenario->new() fails to load a scenario named visibility.igr.univ-rennes1.fr because only /\A[-\w]+\z/ if allowed for the scenario name,
  2. Sympa::Scenario::get_scenarios() returns an array with some undefined values,
  3. wwsympa::_do_edit_list_request() fails to interpret $_->get_current_title because $_ is undefined.

The bug was introduced in c8aca83

The pull request fixes (1):

  1. allowing dots in scenario names,
  2. providing more details in the error log,
  3. preventing undefined entries to be returned by Sympa::Scenario->new().

It would also make sense to:

  1. consolidate wwsympa::_do_edit_list_request() in case Sympa::Scenario::get_scenarios() returns undefined values.
  2. add parenthesis to this condition https://github.com/sympa-community/sympa/blob/sympa-6.2/src/lib/Sympa/Scenario.pm#L153

… dots. Example: visibility.igr.univ-rennes1.fr
@ikedas
Copy link
Member

ikedas commented Apr 9, 2019

Hi @salaun-urennes1,

You are right. We should use Sympa::Regexps::scenario consistently. [EDIT] See a pr below.

@ikedas ikedas added the bug label Apr 9, 2019
@ikedas ikedas added this to the 6.2.44 milestone Apr 9, 2019
@ikedas ikedas merged commit 592ed2e into sympa-community:sympa-6.2 Apr 14, 2019
ikedas added a commit that referenced this pull request Apr 14, 2019
…-with-dots by ikedas

Additional changes to: Salaun urennes1/fix scenario name with dots (#589)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants