Views broken when username contains special characters - drupal

I've created a couple views showing e.g. the latest news and events. However, when the username contains "special characters" (but still common in Finland), for example 'ä' or 'ö', the view shows the empty text instead of the real data.
For example my events view has two fields (node title and time of the event) and three filters (published = yes, node type = event and event time >= now). Nothing closely related filtering with the username added by myself.
Is there a workaround to get the view working?

Sounds like a problem with character encoding. I would recommend UTF8, works with almost every language.
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets
Whatever you do, make sure you use always the same encoding and use it everywhere.

Related

Formula within a textbox in a form showing as "#Name?" when opened

I have a Microsoft Access 2010 database program that let's users update certain information within based on permissions. There are 2 versions, one for each facility. I recently added a new form to the 2nd facility by copy/pasting the form from the 1st file and then adding the necessary queries.
Everything worked great except for one column that contains a RowNumber formula for displaying the, you guessed it, row number. This was working in the 1st file and I have made sure that every property matches exactly, but the image below is what I get when I try to open the form. As if to add more chaos to the mix, the 1st file started showing the same results as well, despite working perfectly fine before and me not even touching that specific text box.
I have Googled this issue but have not seen anything with this specific result. Can anyone explain what this means?
Column in question (where formula is located):
Name: Text57
Control Source: =RowNum([Form])
Visible: No
Datasheet Capt: Seq
Column in question:
Name: Label58
Caption: Text57
Visible: Yes
Row numbering on the fly normally is completely academic in Access as it has no meaning. The row number on a form has no relationship to anything in the data, and can change if the underlying data changes in any way.
The RowNum() function is not inbuilt in access as far as I can tell, so I'm not sure how it could work.

How does one do a dynamic table in IBM Notes 8.5.3 or 9.0.1?

I'm writing a Notes Client application. Web compatibility is a secondary concern. The language is LotusScript.
The specification: a form to enter lines from receipts. The lines are all saved as part of the same document so that they can be signed as an atomic unit.
When a line is added, it is to be formatted into a table for presentation. Ultimately, this architecture is like an input/datastore/presentation split.
I've managed to get the data stored and signed, and I think I've managed to get it deserializing properly (the LotusScript debugger makes it difficult to see, but it looks right). The problem now is the UI.
Looking at the Programmable Table, it is always a tabbed table with only one row shown per tab. I need a programmable table which can dynamically have rows added to it for display, without forcing new tabs to be created.
This suggests that I would need to use a Rich Text field to contain a table, but thus far my attempts to get anything to display when I try to update a Rich Text field in edit mode have failed. I am forced to conclude that it is impossible.
I cannot figure out how I'm supposed to do a dynamically-displayed list of tabular data like this. Any advice?
Most people just create a table with one row and N columns, with a multi-valued field in each column, and use code to append values to each of the fields in parallel. You don't get borders between rows this way or the ability to do variable formatting of cells, and you have to be careful to avoid letting data length exceed column widths in order to keep everything aligned properly.
If you truly want a dynamic table for presentation with all the bells and whistles that you can get in terms of cell formatting, then the Midas Rich Text API from Genii Software is a commercial solution that can do the job.
I blogged about this a couple of years ago: http://blog.texasswede.com/dynamic-tables-in-classic-notes/
This is a non-XPages solution, but of course you can also use XPages to achieve the same/similar result. It does not use tabs, as each row is a separate table.
Alternatively, you can build your Rich Text Table in another NotesDocument, which you then save. Then use NotesUIDocument.ImportItem (which is undocumented, but present in the R8.5 mail template) to update your NotesUIDocument.
Don't forget to delete the other NotesDocument when you're done.
Another option is to build the table in HTML in computed text, and re-open the document every time you modify it. I have inherited a system that does that, and I hate it...so be warned :)

ASP.Net: Is the order of Request.Form elements defined?

I have a table which uses a large number of form fields (the HTML variety - i.e. without runat=server). When a postback occurs, these populate the Requests.Form object, and they appear to be inserted in the same order as they're defined in the page HTML.
Is this behaviour documented and consistent across browsers? I'd like to be able to access the elements by index, which would provide a simple way to find the fields, given that they may be inserted or deleted on the client side.
Edit:
Each row in the table has a hidden field which contains the row ID. This field is named according to the order it was displayed at render time. e.g. the first row has a field like <input type="hidden" name="row0" value="RowID_555252" />, and so on.
Of course the row numbers will be wrong as soon as a row is inserted or deleted in the middle of the table, so the only solution I can think of is to use Javascript to update the row numbers of the entire table whenever the rows move about. The backend would then retreive rows in order by scanning Request.Form for row0, row1, etc until the element is NULL.
Is this behaviour documented ...
Yes it is.
The overall algorithm is here: http://dev.w3.org/html5/spec/constraints.html#concept-form-submit and this defines that it uses a form data set built using the algorithm at http://dev.w3.org/html5/spec/constraints.html#constructing-the-form-data-set.
While that algorithm is quite complicated, in essence it says that the form elements will be put into the form data set in node order. That's not quite the same thing as what they were in the page HTML, for instance, the elements can be moved by JavaScript.
There are further algorithms to turn the form data set into query strings or HTTP content but these too preserve the node order.
There are known to be web pages that depend on this order. (The HTML5 parser has a strange quirk where input elements of most types, placed inside tables but not inside table cells are ejected from the table through a process known as foster parenting, but input elements of type "hidden" are not ejected in this way. This happens because that's the only way to preserve the legacy submit ordering behaviour of browsers.)
...and consistent across browsers?
The whole algorithm of what gets submitted is definitely not consistent - for example, the submissions resulting from clicking on an input element of type "image" are known to vary significantly.
I believe that the order of the submitted elements may well be consistent across browser implementations. However, I would not rely on it being so, and encourage you to find a more robust solution.
Is this behaviour documented and consistent across browsers?
No, it is not documented and it is not guaranteed to be consistent across browsers. That this is how it occurs happens to be an implementation detail of the browser/s you have used.
You could of course use the index, but you cannot assume that this will correspond to the order of the form elements. Furthermore, it is brittle - what happens if you add a new field at the start of the form? Your logic completely breaks.

Auto-generated Form Value

Looking for guidance on how to achieve something in ASP.NET Web Form - the behaviour is a bit like that seen in ASP.NET AutocompleteExtender, but I can't find anything that gives the flexibility I need. Here is what I am trying to do:
2 TextBox fields on the form,
CompanyName and CompanyRef
(CompanyRef an abbreviated unique
Company identifier)
User types in the CompanyName
As soon as there are 3 characters in the
CompanyName an internal webservice is
called (AJAX?)
Webservice checks what has been entered so far and
evaluates a 3 character representation of it - for instance
"Stack" would be returned as STA0001.
If there is already an STA0001 in the db it would return STA0002 and so on
The value returned would be targetted at the
CompanyRef TextBox
User needs to be able to edit the CompanyRef if they so wish
I'm not looking for code per se, more high level guidance on how this can be done, or if there are any components available that I am missing that you may be able to point me in the direction of. Googling and searching on SO has returned nothing - not sure if I'm looking for the right thing though.
Generating the CompanyRef is easy enough. There are lots of articles etc which cover combining say an autonumber or counter with a string. The difficulty I have with your approach is that you intend to let users fiddle with the ref, and make their own up. What for?
[EDIT - Follow up to comment]
The comment box didn't allow for enough characters to answer your comment fully (and I'm still getting used to the conventions in place here....)
You could use AJAX to call the web service and return currently available values, and then use javascript to update the field. The problem with this is that once a user has decided he or she likes one, it may no longer be available when it is passed back to the database. That means you will have to do one final check, which may result in a message to the user that they can't now have the value they were told was available when they started the process. Only you know the likelihood of this happening. It will depend on the number of concurrent users you have.
I've done an article on calling web services etc using jQuery which should give you a starting point for the AJAX part: http://www.mikesdotnetting.com/Article/104/Many-ways-to-communicate-with-your-database-using-jQuery-AJAX-and-ASP.NET

PubDate/Guid is essential to RSS? How I create a good RSS in Yahoo! Pipes if the source doesn't provide different dates for the items?

I am creating a Yahoo! Pipe to a news site but the feedless source doesn't have a date/time for each item. My RSS doesn't works very well: each update makes the RSS Reader, Google Reader for instance, to mark all readed items as unreaded again. Perhaps that's because of the lack of pubDate tag or incorrect guid tag.
How to create a "pubDate" on Yahoo! Pipes when your source doesn't provide you the data?
How to avoid the "guid" tag overwritting? (you can set the guid in YPipes but then YPipes ignores your guid)
Solution: pudDate isn't necessary. guid is essential. Even if Yahoo! Pipes rewrites the guid, it will work, because Yahoo! Pipes converts your guid text into a hash value, that do not is modified until the text is modified.
I think the GUID is generated from the link parameter. So it is important to have a unique url for each feed item. If all the feed urls have same link, they will have same GUID.
I hope that helps.
I am struggling myself to create unique url. Have you found anyway to achieve it?
Have you looked at Feedity - http://feedity.com - for creating custom RSS feeds. It's like Pipes, but much easier to use, and in fact works well within Pipes as well. I've been using it for a while to create RSS feeds for those "feedless" webpages.
Well, for future reference, the solution can be found in this link. It also serves well for putting a date. Basically what it does is to create a node copying as its subnodes all the needed fields, and then at the end it replaces the parent with this "cloned" child.
I don't have a definitive answer for you, but anecdotely I have been maintaining a private feed reader for the last 4 years or so. I've been exposed to a lot of vagaries of RSS/ATOM and I can tell you that a lot of feeds don't have dates associated with the items. It might be an RSS version issue.
Last time I rebuilt my site, I had a bunch of trouble with the feed. In the way you describe- read things becoming unread on next update, duplicate entries. Turns out the problem was more to do with the guid element than the pubdate. As far as I recall, it didn't matter too much what I did with the date (I had the format wrong for a while) as long as the guid was unique.
With Yahoo Pipes, using the 'Create RSS' module, it appears to use (a hashed version of) each entry's link to generate a GUID, which as you point out, is necessary for most feed readers to detect new entries.
I've attempted to set the 'Create RSS' module's GUID field to a value that's unique for each entry, however the GUID in the resultant feed remains identical for each entry. When I then set the link to this value the GUIDs generate were unique for each entry.
I have verified this by making a copy of your pipe and removing (well, renaming) the link attribute and no GUID is generated (although you have specified one). This has been confirmed by others as a bug, see tinyurl.com/mxard2.
the problem could be with the source of your feed. If you are using mutliple feeds then after the union operation in pipes, do a sort operation on pubdate and then redirect it to the output.
Just been doing this myself, and have resorted to appending a random number to the url that I'm using to get the data from (I'm scraping using YQL). I'm generating that random number by using a Date Builder and populating it with "today" to get the current date/time. I'm then using a URL Builder to build up my url that I'm requesting, passing in an extra parameter of "randomnumber" which I'm assigning to my the DateTime.utime value.
Having looked at the generated RSS feed via view source, the articleId now does appear to be unique, but I haven't left it long enough to know if google reader etc sees it as different.

Resources