Can't access Edit button for custom JIRA field, due to HTML tag in field description - html

In our JIRA instance, someone thought that because you could put html tags in description fields, that meant that you needed a full complement of tags to use them-- like, including <html> and, critically </html>
So, now we've got a custom field with a description containing a </html> tag, and as you might expect, the browser is not showing anything past that last tag, including any option to delete or edit the field.
Is there any way to use an API, etc to delete this field or change its description?
I'm on JIRA 4.1.2 (I know...)

Managed to solve the issue...
I used either the JIRA Advanced search, or right-click>>Inspect
element to get the ID of the field.
Then hovered over one of the "Configure" links that were showing to get the URL to the configure screen.
Then, I put the correct ID in the URL, and I was able to get back in and remove the offending tags.
That resolved the issue on the Custom Fields screen. Unfortunately, this technique had also been used on the "Field Configuration" screen, which is organized a bit differently.
The URLs to the "Edit" screens from the field configuration are formatted differently, with id= being the particular field configuration you're working with (don't change this one), and position= being the position in the list of the field you're working with (0 based index).
The easiest thing for me was to
Go to the field above the one that was messed up
Click on the Edit link, then
Increment the position parameter in the URL to give me the field I actually needed to change.
Deleted out the rogue HTML and everything was back to normal.

Related

How can I get our WYSIWYG editor to stop removing HTML comments, CSS classes and inline styles?

We currently use wysihtml5-rails to let our users edit emails before they are sent but this is not working out so well for a few reasons.
I need the comments to allow for Outlook specific comments like these . All comments are being removed, currently.
I also need the CSS classes to be untouched as the editor content will be a pre-generated email that includes CSS classes. Our editor will only keep classes that are whitelisted but this is annoying as we need to update that list with every change.
Same goes for inline styles. Some of the styles in the generated email are inline instead of in classes. Those need to be kept but they are being removed.
Is there any way I can get our editor to work this way?
I found a solution but it's hacky.
I realized that the raw HTML was being stored on the page in a hidden textarea tag. Interestingly, all the elements that I needed (CSS classes, comments) were still there. But when submitting the form, the value of this textarea was replaced with the parsed results from the editor which gets sent to the server. All the comments and classes are gone from this text.
The solution was then to create a second field that takes the unparsed value from the WYSIWYG editor and sends that along. Easy in rails but just making this new field part of a form. Then the controller can choose which value to take. In my case, I renamed the existing message field to parsed_message. Then added a new message field which will hold the unparsed message.
The WYSIWYG editor we are using allows this by having a method that can be called at any time: window.email_editor.getValue(). Here the email_editor is the editor instantiated by the javascript on the page.

Sublime text 2 Snippets - autocomplete

I've created a bunch of snippets in Sublime Text 2, but I cant remember them all off the top of my head. I've seen in a number of tutorials that as people start typing their snippets tab-triggers it will start to provide a list of the matching snippets. I don't see this.
Is there a setting somewhere for this? Or do I need to create a special file (completions file?). For most snippets I have the <scope> commented out as I may use in a PHP or HTML file for example depending what I am working on.
Most of my snippets tab triggers start the same elq- prefix, so it would be very helpful if it were to start showing me the options as I type.
The setting auto_complete_selector controls when Sublime automatically offers the popup for possible completions. The default value for this setting is:
// Controls what scopes auto complete will be triggered in
"auto_complete_selector": "source - comment",
This means that it will automatically pop up for any file that's considered a source code file, except within a comment.
The scopes for the file types that you mention in your question are text scopes and not source scopes, which stops the popup from appearing.
One way around that would be to manually invoke the auto complete panel by using the appropriate key binding, which by default is Alt+/ on Linux or Ctrl+Space on Windows/OSX. When you do that, the popup for possible completions at this point is manually displayed.
To allow this to work more automatically, you would need to modify the setting for auto_complete_selector to be more appropriate for your situation.
To do that you could select Preferences > Settings - User from the menu and add or modify the auto_complete_selector setting as follows:
"auto_complete_selector": "source - comment, text.html",
This says that the selector should always be displayed in source files except inside comments (like the default) and also within HTML files.
You could also use text instead of text.html if you want it to work in all text files of all types, although this would possibly get quite annoying while working with plain text files. Substitute an appropriate scope or set of scopes here as appropriate to dial in the places you want this to be automatically offered.

QListView custom display

I have a QListView with a Custom Display based on a simple contacts list. All the fields EXCEPT the email address field render just fine, and the items on the page otherwise look exactly as formatted. There is definitely data in the field, but this one simple text field isn't rendering as a mailto link in the QListView. The href code is correct, it works when tested in a simple html file, but not on the Sharepoint page.
Viewing source, all I see for the email code is literally mailto:<%EmailAddress%> where it should show mailto:myname#mydomain.com as it appears on the list. What's REALLY strange is that I tested the <%EmailAddress%> token on the custom display as just another field, no href code, but it doesn't show on screen that way either, which is even odder.
Here's the current code as an email link:
<%First_Name%> <%Last_Name%> Ext. <%Extension%><br>
<%Job_Title%><br><br>
Is there something funky about using an email field/code in Custom Displays? Using the generic show fields tab, it shows up uneventfully. Something else? Or can you not use "live" tags in the display at all? But then why didn't it show up as a text field? I was under the impression that you could use pretty much any simple html code in the custom displays. No?
I figgered it out. Turns out the field names are <%CaSe Sensitive%>. Who knew? Works like a champ now. Is that documented anywhere, btw? Just wondering.

Headings created inside of a template

I have a number of templates that create headings based on a formula. I am wondering if there is anyway to create an "edit" link that will take you directly to that section? The way that it currently works, the edit link takes you to editing the template itself. Could I possibly create a customized link that would keep you on the page and take you to right part?
Here is some sample code to help clear things up...
Template:Head:
==={{{1}}}===
This is a heading titled "{{{1}}}"
Test Page:
=Section 1=
{{head|1.1}}
{{head|1.2}}
{{head|1.3}}
=Section 2=
{{head|2.1}}
{{head|2.2}}
{{head|2.3}}
At the moment, if I want to edit the information for template "2.3", I have to edit all of section 2. (Note that for this example, that isn't a big deal. For the actual templates I am working with on my site, the templates have dozens of parameters and there are sometimes 10 or more in a section.)
Bottom line, is there way to create a custom edit link inside of the {{head}} template that would take you directly to editing the templates call on the page "Test Page"? Hope that makes sense.
Edit: Is there perhaps a way to make use of "anchor" tags? Can anchors be passed in to the URL?
To restate your problem, when you transclude a section heading the header isn't treated as being part of the destination page, so the edit link takes you back to the source. So you need a separate container for the template in order to edit it individually, and a complete section is the smallest editable container.
The only way I can think of doing this is using subpages (or virtual subpages if you don't have that ennabled in this namespace, doesn't change anything). So instead of placing {{head|1.1}} on MyPage, put it on MyPage/Subpage1 and then transclude that into MyPage in the usual way ({{:MyPage/Subpage1}}).
{{head}} can then include a custom edit link to the template input by using HTML heading tags (<h2> is equal to ==, etc.) to suppress the standard edit link and then use one of these templates (probably {{ed right}}) to create a custom edit link pointing to MyPage/Subpage1.
The way to create anchors in Mediawiki, by the way, is to use a <span id="name"/> tag, but that doesn't create a container that can be edited (or at least, not that I've been able to work out through URL tinkering).
I'm pretty sure there's no way to do that. As far as MediaWiki's section editing feature is concerned, the only thing that begins a new section is a line of the form:
=== Some text here ===
with the number of = signs determining the level of the heading. There's no way to get MediaWiki to let you edit any segment of the document that doesn't begin and end with such a line (or the beginning or end of the page).
Well, OK, I'm sure you technically could do it with an extension, in the sense that you can do anything with a MediaWiki extension. All you'd need to do is provide some way (e.g. a special parameter in an edit URL) for to user to indicate "I want to edit this template", then extract the template from the wikitext, present it to the user for editing, and write the result back into the page text over the original.
The tricky part will be extracting the template from the page source. (Finding and replacing templates on a page is a fairly common task for MediaWiki bot writers, so you might want to look for ideas there.) Whatever method you end up using for that, there will probably be edge cases where you need to give up and tell the user "Sorry, but I can't figure out how that template is transcluded here."

URL Masking in .Net / HTML

I have a website in which I have many categories, many sub-categories within each one and many products within each of those. Since the URLs are very user-unfriendly (they contain a GUID!!!), I would like to use a method which I think is called URL Masking. For example instead of going to catalogue.aspx?ItemID=12343435323434243534, they would go to notpads.htm. This would display the same as going to catalogue.aspx?ItemID=12343435323434243534 would display, somehow.
I know I could do this by creating a file for each category / sub-category (individual products cannot be accessed individually as it is a wholesale site - customers cannot purchase directly from the site). This would be a lot of work as the server would have to update each relevant file whenever a category / sub-category / product visibility changes, or a description changes, a name changes... you get the idea...
I have tried using server-side includes but that doesn't like it when a .aspx file is specified in an html file.
I have also tried using an iframe set to 100% width / height and absolutely positioned left 0 and top 0. This works quite well, but I know there are reasons you should not use this method such as some search engines not coping with it well. I also notice that the title of the "parent" page (notepads.htm) is not the title set in the iframe (logically this is correct - but another issue I need to solve if I go ahead and use this method).
Can anyone suggest another way I could do this, or tell me whether I am going along the right lines by using iframes? Thanks.
Regards,
Richard
PS If this is the wrong name for what I am trying to do then please let me know what it actually is so I can rename / retag it.
Look into URL Rewrites. You can create a regular expression and map it to your true url. For example
http://mysite.com?product=banana
could map to
http://mysite.com?guid=lakjdsflkajkfj3lj3l4923892&asfd=9234983920894893
I believe you mean URL Rewriting.
IIS 7+ has a rewrite module built in that you can use for this kind of thing.
URL Rewriters solve the problem you are describing - When someone requests page A, display page B - in a general way.
But yours is not a general requirement. You seem to have a finite uuid-to-shortname mapping requirement. This is the kind of thing you could or should set up in your app, yourself, rather than inserting a new piece of machinery into your system.
Within a default .aspx page, You'd simply do a lookup on the shortname from the url in a persistent table stored somewhere, and then call Server.Transfer() to the uuid-named page associated to that shortname.
It should be easy to prototype this.