Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1167856

Summary: candlepin msgids with unescaped single quotes will not print the single quotes
Product: [Community] Candlepin (Migrated to Jira) Reporter: John Sefler <jsefler>
Component: candlepinAssignee: Chris "Ceiu" Rog <crog>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: crog
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-24 17:06:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Sefler 2014-11-25 14:16:01 UTC
Description of problem:
The following candlepin message strings that have been extracted to the keys.pot contain unescaped single quotes.  As a result, they are not being displayed to the user....

[root@jsefler-os-candlepin po]# egrep -B2 "(^|[^'])'([^']|$)" keys.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
--
#: server/src/main/java/org/candlepin/policy/js/activationkey/ActivationKeyRules.java:82
msgid ""
"Cannot add pools that are restricted to unit type 'person' to activation "
--

#: server/src/main/java/org/candlepin/resource/ConsumerResource.java:440
msgid "A unit type of 'person' cannot be used with activation keys"
--

#: server/src/main/java/org/candlepin/resource/ConsumerTypeResource.java:95
msgid "Unit type with id '"
--
msgid ""
"The activation key name ''{0}'' must be alphanumeric or include the "
"characters '-' or '_'"
--

#: server/src/main/java/org/candlepin/resource/RulesResource.java:117
msgid "couldn't read rules file"
--

#: server/src/main/java/org/candlepin/resource/StatisticResource.java:65
msgid "couldn't generate statistics"
--

#: server/src/main/java/org/candlepin/resteasy/interceptor/PageRequestInterceptor.java:120
msgid "the order parameter must be either 'ascending' or 'descending'"




Each of the msgids above contain unescaped single quotes, as a result, the single quote is not printed.  Here's an example...

[root@jsefler-os-candlepin po]# curl --stderr /dev/null --insecure --user testuser1:password --request POST --data '{"name":".period."}' --header 'accept: application/json' --header 'content-type: application/json' https://jsefler-os-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys | python -mjson/tool
{
    "displayMessage": "The activation key name '.period.' must be alphanumeric or include the characters - or _",
    "requestUuid": "af64a164-fd93-4c1c-bd04-3072e1ad471c"
}


NOTICE: At the end if the displayMessage, - or _ is printed instead of '-' or '_'.

The fix for all of these strings is to escape the single quote with a proceeding single quote.



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

Comment 1 Chris "Ceiu" Rog 2014-12-09 19:57:15 UTC
commit f51d8f98869f5ab6f519b665f97653f8608a6ca6
Author: Chris Rog <crog>
Date:   Fri Dec 5 16:17:19 2014 -0500

    1167856: Fixed msgids with unescaped single quotes.

Comment 2 John Sefler 2014-12-12 23:52:31 UTC
The new msgids must now be...
1. extracted from the candlepin source code
2. pushed up to Zanata https://translate.zanata.org/zanata/iteration/view/candlepin/master,
3. translated by the translators by opening a ticket with localization-services
4. once translated, the msgstr need to be pulled back into the candlepin po files.