CDR Tickets

Issue Number 4161
Summary Fix placeholder element from element list
Created 2016-10-05 11:44:08
Issue Type Bug
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Englisch, Volker (NIH/NCI) [C]
Status Closed
Resolved 2016-10-05 15:57:41
Resolution Won't Fix
Path /home/bkline/backups/jira/ocecdr/issue.195758
Description

In the GTC document, when adding a PlaceHolder element from the element list to a selected text, it seems to drop an empty set of square brackets [] thus omitting the "TERMNAME" attribute text that goes in the square bracket and the attribute inspector. It appears this used to work well until recently.

The placement of the element appears to work well only when the element is entered without selecting any text. I tested this on both PROD and DEV and the behavior is the same.

Here is a sample GTC from DEV. CDR0000619357. The first occurrence of the PlaceHolder element (wrapped around "root") in the definition text is the one demonstrating the problem and the second occurrence (after the word "sedative" is the one entered without selecting any text.

I will also add a screenshot from PROD.

Comment entered 2016-10-05 12:37:55 by Englisch, Volker (NIH/NCI) [C]

Your example in the attachment is different from your sample in the comment (CDR0000619357).
Was this intentional?

Comment entered 2016-10-05 12:52:32 by Englisch, Volker (NIH/NCI) [C]

I'm not exactly following the description of the problem but you'll see the empty square brackets if you're deleting the mandatory name attribute.
If you enter a Placeholder element, the following text-hint appears:

Replace attribute for PlaceHolder (if necessary) to link to ReplacementText and delete these instructions

Someone must have done the opposite from these instructions and entered PlaceHolder text but deleted the attribute.

Comment entered 2016-10-05 13:35:23 by Osei-Poku, William (NIH/NCI) [C]

Your example in the attachment is different from your sample in the comment (CDR0000619357).
Was this intentional?

Yes, that was intentional. As I stated above, the example is from DEV and the screenshot is from PROD.

Comment entered 2016-10-05 13:46:38 by Osei-Poku, William (NIH/NCI) [C]

I'm not exactly following the description of the problem but you'll see the empty square brackets if you're deleting the mandatory name attribute.

The problem is happening when you're adding the placeholder element to an existing text that you have highlighted. Here are the steps to reproduce the problem:
1. Highlight a text in the definition block.
2. Pick the placeholder element from the attribute inspector by double-clicking on it.
3. A placeholder element is wrapped around the highlighted text but it is missing the TERMNAME attribute and an empty bracket is also placed before the highlighted text. Also, missing is the attribute from the attribute inspector

To demonstrate how it is supposed to work as expected, just place an empty placeholder element without highlighting the text. The TERMNAME attribute is correctly added to the square brackets and it also appears in the attribute inspector.

Comment entered 2016-10-05 13:49:51 by Englisch, Volker (NIH/NCI) [C]

There is no PlaceHolder element in the sample document on DEV.

Comment entered 2016-10-05 13:52:48 by Osei-Poku, William (NIH/NCI) [C]

Please try again, I failed to save my work. Sorry about that.

Comment entered 2016-10-05 14:02:28 by Englisch, Volker (NIH/NCI) [C]

To demonstrate how it is supposed to work as expected, just place an empty placeholder element without highlighting the text. The TERMNAME attribute is correctly added to the square brackets and it also appears in the attribute inspector.

Yes, this is how it works. Are you saying it should also work by following your steps above (highlight text followed by picking the PlaceHolder element)? I don't think the PlaceHolder element or any other element ever worked that way. You cannot populate an attribute by entering/highlighting text for an element! When you're entering a GlossaryTermRef you're not expecting the glossary term to populate the cdr:href attribute, right?

Comment entered 2016-10-05 14:31:30 by Osei-Poku, William (NIH/NCI) [C]

In this case you're not creating a cdr:href. Just as the TERMNAME attribute is added when you enter the placeholder element in an empty space, when you enter it while text is selected, it should also add the TERMNAME attribute. I do not expect it to create a cdr:href. Rather, it should not be missing the TERMNAME attribute when you have the text selected. In other words, why are the element and attribute different when you add it to an empty space versus when you add it while text is selected?

Comment entered 2016-10-05 15:03:23 by Englisch, Volker (NIH/NCI) [C]

I don't understand why you are highlighting text. You highlight text when you want the highlighted text to be the content of an element. The PlaceHolder element does not allow any text content - only an attribute.

In other words, why are the element and attribute different when you add it to an empty space versus when you add it while text is selected?

I would have to double-check but I believe the following is the case:

  • When you're inserting an element you're inserting a template and the PlaceHolder template has been setup to populate the name attribute with the text TERMNAME

  • When you're highlighting text you're saying "Replace the highlighted text with the default text of the element". There is probably a macro that fires to remove all default text for the element and the attribute and then replacing the highlighted text.
    I'm sure has a better understanding about this but I'm guessing I'm not too far off.

Comment entered 2016-10-05 15:13:35 by Osei-Poku, William (NIH/NCI) [C]

I don't understand why you are highlighting text. You highlight text when you want the highlighted text to be the content of an element. The PlaceHolder element does not allow any text content - only an attribute.

Oh. I get what you mean. Let me investigate why we would highlight text before adding the element.

Comment entered 2016-10-05 15:53:22 by Osei-Poku, William (NIH/NCI) [C]

It looks like text is highlighted on to serve as a reminder to delete the text and for no other reason. This is what Amy had to say about it.

Highlighting the definition text is just a method I’ve always used to insert a Placeholder. I delete the text after Placeholder is inserted; it serves as a reminder for me to actually delete the text, rather than adding the Placeholder outside the text where the deletion may possibly be overlooked. Either way works, it’s just I’ve never had any problem doing it this way.

Comment entered 2016-10-05 15:57:22 by Osei-Poku, William (NIH/NCI) [C]

Since the sole purpose of highlighting the text is to serve as a reminder, I don't think you should try to fix this. We will find a better way of addressing the problem. Thanks!

Attachments
File Name Posted User
Placeholder.png 2016-10-05 11:46:57 Osei-Poku, William (NIH/NCI) [C]

Elapsed: 0:00:00.001448