Project

General

Profile

Actions

Bug #6710

closed

Cannot edit host group if its name only contains UTF-8 characters

Added by Dominic Cleal over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Web Interface
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1121755
Description of problem:

Created a new hostgroup with the name '쥄㣆ꢕ䗀ᖑᆰ뒘礋捖䱣쒀䴮쏩騬橌矄ⱅರ㪷澘쨼' then tried to edit it via the web ui. As soon as I click the link for the hostgroup I get a page stating:

Host Group Not Found

I noticed that the URL being accessed is missing the name for the hostgroup:

/hostgroups/2-/edit

The URL should have the name of the hostgroup after its index:

/hostgroups/2-<NAME GOES HERE>/edit

Version-Release number of selected component (if applicable):

  • apr-util-ldap-1.3.9-3.el6_0.1.x86_64
  • candlepin-0.9.19-1.el6_5.noarch
  • candlepin-scl-1-5.el6_4.noarch
  • candlepin-scl-quartz-2.1.5-5.el6_4.noarch
  • candlepin-scl-rhino-1.7R3-1.el6_4.noarch
  • candlepin-scl-runtime-1-5.el6_4.noarch
  • candlepin-selinux-0.9.19-1.el6_5.noarch
  • candlepin-tomcat6-0.9.19-1.el6_5.noarch
  • elasticsearch-0.90.10-4.el6sat.noarch
  • foreman-1.6.0.29-1.el6sat.noarch
  • foreman-compute-1.6.0.29-1.el6sat.noarch
  • foreman-gce-1.6.0.29-1.el6sat.noarch
  • foreman-libvirt-1.6.0.29-1.el6sat.noarch
  • foreman-ovirt-1.6.0.29-1.el6sat.noarch
  • foreman-postgresql-1.6.0.29-1.el6sat.noarch
  • foreman-proxy-1.6.0.21-1.el6sat.noarch
  • foreman-selinux-1.6.0-8.el6sat.noarch
  • foreman-vmware-1.6.0.29-1.el6sat.noarch
  • katello-1.5.0-27.el6sat.noarch
  • katello-ca-1.0-1.noarch
  • katello-certs-tools-1.5.6-1.el6sat.noarch
  • katello-installer-0.0.56-1.el6sat.noarch
  • openldap-2.4.23-32.el6_4.1.x86_64
  • pulp-katello-0.3-3.el6sat.noarch
  • pulp-nodes-common-2.4.0-0.23.beta.el6sat.noarch
  • pulp-nodes-parent-2.4.0-0.23.beta.el6sat.noarch
  • pulp-puppet-plugins-2.4.0-0.23.beta.el6sat.noarch
  • pulp-puppet-tools-2.4.0-0.23.beta.el6sat.noarch
  • pulp-rpm-plugins-2.4.0-0.23.beta.el6sat.noarch
  • pulp-selinux-2.4.0-0.23.beta.el6sat.noarch
  • pulp-server-2.4.0-0.23.beta.el6sat.noarch
  • python-ldap-2.3.10-1.el6.x86_64
  • ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
  • ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch
  • rubygem-hammer_cli-0.1.1-10.el6sat.noarch
  • rubygem-hammer_cli_foreman-0.1.1-12.el6sat.noarch
  • rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch
  • rubygem-hammer_cli_katello-0.0.4-8.el6sat.noarch

How reproducible:

Steps to Reproduce:
1. Create a new hostgroup using the following name and save it: 쥄㣆ꢕ䗀ᖑᆰ뒘礋捖䱣쒀䴮쏩騬橌矄ⱅರ㪷澘쨼
2. Try to edit it via UI
3.

Actual results:

You'll get a Host Group Not Found page (see screenshot)

Expected results:

Additional info:


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #8056: "The page you were looking for doesn't exist." for smart proxy 'Refresh Features' and EditingClosed10/23/2014Actions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Category set to Web Interface

The host group name causes #to_param to return "22-" (the ID and a hyphen) as the name parameterises to an empty string (due to the UTF-8). The bug appears to be in find_by_name in application_controller, which isn't parsing "22-" correctly and looking it up by ID only.

Actions #2

Updated by Dominic Cleal over 9 years ago

Same issue if you create a template with the name " " (https://bugzilla.redhat.com/show_bug.cgi?id=1121516).

Actions #3

Updated by Dominic Cleal over 9 years ago

And naturally, every other resource type.

Actions #4

Updated by Ohad Levy over 9 years ago

Dominic Cleal wrote:

And naturally, every other resource type.

I'm wondering if we should allow non UTF8 chars in general, for sure it doesnt make sense for archs.

@Dominic, do you happen to know if puppet handles UTF8 correctly? e.g. if the ENC output will contain a hostgroup / compute resource etc in utf8?

Actions #5

Updated by Dominic Cleal over 9 years ago

I'm not sure, we've had some Unicode ENC issues in the past as Ruby encodes the YAML in a bizarre manner, however not supporting Unicode will probably cause more problems unless it's unavoidable.

Actions #6

Updated by Dominic Cleal over 9 years ago

  • Target version set to 1.7.5
Actions #7

Updated by Tomáš Strachota over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota
Actions #8

Updated by The Foreman Bot over 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1685 added
  • Pull request deleted ()
Actions #9

Updated by Anonymous over 9 years ago

  • Target version changed from 1.7.5 to 1.7.4
Actions #10

Updated by Anonymous over 9 years ago

  • Target version changed from 1.7.4 to 1.7.3
Actions #11

Updated by Dominic Cleal over 9 years ago

  • Target version changed from 1.7.3 to 1.7.2
Actions #12

Updated by Tomáš Strachota over 9 years ago

The problem with not being able to edit unicode-named resources was fixed by

commit 8b737c9c7648b3726dadb3b2e4708fcb43af02a8
Author: Joseph Magen <jmagen@redhat.com>
Date:   Tue Sep 23 12:02:52 2014 +0300

    fixes #4386 - gem friendly_id to simplify find by id, name, label, etc

which conflicted with my solution but was merged faser.

I updated my PR and keep it open as it still makes the url look nicer (keeps unicode characters there) and fixes links in various ui templates.

Actions #13

Updated by Dominic Cleal over 9 years ago

  • Bugzilla link changed from 1121755 to 1154187
Actions #14

Updated by Anonymous over 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #15

Updated by Dominic Cleal over 9 years ago

  • Related to Bug #8056: "The page you were looking for doesn't exist." for smart proxy 'Refresh Features' and Editing added
Actions #16

Updated by Dominic Cleal over 9 years ago

  • translation missing: en.field_release set to 21
Actions

Also available in: Atom PDF