Trying to solve a mystery here... Submitted an extension update and it was approved last night and I rolled it out shortly after. I discovered that a JS error was thrown in the newly rolled out release...
Invalid or unexpected token
This error was not thrown in the build submitted for review. After inspecting the compiled js in the rolled out version, I discovered a bunch of garbage characters that were not present in the uploaded extension...
I'm wondering if the extension was got corrupted in the review process? Has this happened to anyone else? I've submitted a new build for review with no changes and am hoping that this one will not have these garbage characters.
Someone don't want to admit it, but it happens more than you want to believe.
There are certain characters that are not always digested by the publication / review process.
The same character once passes and another time it gets busted.
It happened to me with the character ยง
In short, I suggest you to avoid these characters or use their escape sequence instead (i.e. space = = )
If this translation has had persistent implications, such as having incorrectly set items of some storage system (localStorage, chrome.storage indexedDB etc.), after replacing your character with the corresponding escape sequence, you will also have to try to put a patch on it to restore the expected value of such variables \ objects.
In my specific case I had to insert some code inside the onInstalled event handler checking if the user is updating from that "faulty" version.
Related
I have found a workaround for this, which I will be posting as an answer, but it still raises the question of why it happened in the first place.
When I try to add a new id through the Design GUI, I type the name into the box:
id_sample
As soon as I tab out of the box, it prepends #+id/:
#+id/id_sample
which sounds reasonable enough, because - hey, it's got to put in the instruction to add a new id per the documentation, right?
But when I go into the java code, autocomplete is giving me gibberish on the code side - because of the extra #+id/, autocomplete gives me #+id/id_sample for a grand total of
menu.findItem(R.id.#+id/id_sample);
which has invalid characters; while deleting them:
menu.findItem(R.id.id_sample);
gives the error Cannot resolve symbol 'id_sample' because the xml is insisting that the correct name includes the invalid characters. Catch 22.
So how do I properly reference an id?
Looking in the xml, the #+id/ actually gets added to the #+id/id_sample:
android:id=#+id/#+id/id_sample
which obviously gives the compiler a heart attack. Having figured out what was going on, it is easy (though tedious) enough to jump into the xml and delete the extra #+id/ but I can't see any way to get the designer to put it in right in the first place.
Once this is corrected in the xml, it gets automatically corrected in the GUI, autocomplete will give you the correct name when you go into the java code, and the compiler will recognize it.
All that's left is to wonder if there is something I'm doing wrong that is causing this. Is this a known (or unknown) bug? Knowing what is wrong, it can be fixed in the xml, but it seems the GUI should have gotten it right in the first place. Right?
I am using SaveBinaryDirect method to upload file to SharePoint library. I am getting error like below
the remote server returned an error 414 request uri too long
Can anybody help me please
I wouldn't call this a SharePoint problem necessarily, more like a problem that happens a lot in SharePoint... Essentially, you have around a 2,000 character limit for the URL. In most scenarios this is fine, however in SharePoint it occasionally becomes an issue.
Users tend to create a lot of nested libraries and the name of each library becomes part of the URL - separated by '/'. Then the file name is added at the end of the URL. And to make matters worse, if there are any spaces or un-URL friendly characters, they are encoded and become three characters each - space becomes %20. This all adds up.
In my experience the solution is a combination of user education and proper architecture. Instead of creating nested libraries, store the documents in a single library and differentiate the items by assigning meta-data attributes, then create views to display items of a particular type.
This error can also be cause by having "invalid" characters in the filename or path. See this answer for what makes a character invalid in a URI:
Which characters make a URL invalid?
I'm in the process of updating a client's site to the latest version of EE, and while the update went pretty smoothly, {exp:channel:entries} tags no longer render anything inside of them, yet I see that the date on the entry is current or a previous date, the status is set to open, and yes, dynamic="no" was already set. I can't imagine what would cause this, and a database export reveals that all the channel entries are there. The pages aren't completely blank; the templates themselves render without a problem, it's just the {exp:channel:entries} tags so far.
Is there anything I can do to test against this? Running the query module with:
{exp:query sql="SELECT * FROM exp_channel_data "}
{title}
{/exp:query}
returns with a hashed value of M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr.
I've only ever seen that error when Structure was involved.
after doing some digging, it turned out that when I turned off my extensions, the content showed up. As a result, I tried disabling extensions, one by one until the culprit revealed itself to be Solspace's Supersearch. It was a previous version of the addon, and updating it to the most current version brought everything back!
I posted this once, but I was a bit too vague in my information, so I am trying again.
nHibernate/Fluent nHibernate seems to be truncating, or 'stripping' certain characters from strings that I submit to my database. For example, if I submit the string This\nis\na\nblock\nof\ntext\n\with\nreturns, the \n symbol represents the carriage returns. I want these to stay intact, because later, when the data is read back out, that is when it will be parsed by MarkdownDeep
However, I have noticed that the \n symbol specifically gets 'stripped' when the database does its commit. I have performed debugging all the way up to ISession.SaveOrUpdate(object) and I can confirm that the data is unaltered up to the point I can visibly follow the debugging. But then I go and look at the record in the database, and it has been stripped of this symbol.
If I use String.Replace("\n","\\n")) on the text, it will actually work right. But this does not seem like an intelligent way to go about storing everything. This means I have to continuously remember what fields may have this problem and do in-between logic.
Is there a setting I am missing in nHibernate/Fluent nHibernate that is forcing it to strip this data?
Debugged Code Path
Following the path of my code, it goes like this.
ASP.NET MVC View (textarea) -> This\nis\na\nblock\nof\ntext\n\with\nreturns
ASP.NET MVC Model (Json) -> This\nis\na\nblock\nof\ntext\n\with\nreturns
ASP.NET MVC Controller Parameter -> This\nis\na\nblock\nof\ntext\n\with\nreturns
ISession.SaveOrUpdate -> This\nis\na\nblock\nof\ntext\n\with\nreturns
Database Record -> This is a block of text with returns
So the problem is obviously happening at the ISession level.
How are you actually verifying that the \n's aren't in the database record? You will not see a \n visually when you look at the record in sql management studio. It will look like a space if you just query the data. Copy and paste that data into notepad++ and show all the characters that exist in that string (I'm betting you will see the new lines).
Whenever you manually insert \n in the table view like you describe above this is not a special character. It is the actual text '\n'. Please note that '\n' != char(10). One is a special character and the other is just text.
Use this add-on to log produced sql's. then you can find where is the problem.
+ If you are displaying the data on a web page, don't forget to use replace("\n","<br/>").
An obscure puzzle, but it's driving me absolutely nuts:
I'm creating a custom Information Management Policy in MOSS. I've implemented IPolicyFeature, and my policy feature happily registers itself by configuring a new SPItemEventReceiver. All new items in my library fire the events as they should, and it all works fine.
IPolicyFeature also has a method ProcessListItem, which is supposed to retroactively apply the policy to items that were already in the library (at least, it's supposed to do that for as long as it keeps returning true). Except it doesn't. It only applies the policy to the first item in the library, and I have absolutely no idea why.
It doesn't seem to be throwing an exception, and it really does return true from processing that first item, and I can't think what else to look at. Anyone?
Edit: Cory's answer, below, set me on the right track. Something else was indeed failing -- I didn't find out what, since my windbg-fu isn't what it should be, but I suspect it was something like "modifying a collection while it's being iterated over". My code was modifying the SPListItem that's passed into ProcessListItem, and then calling SystemUpdate on it; as soon as I changed the code so that it created its own variable (pointing at the exact same SPListItem) and used that, the problem went away...
There's only a couple of things I can think of to try. First, are you developing on the box where you might be able to use Visual Studio to debug? So just stepping through it.
Assuming that's not the case - what I'd do is fire up WinDBG and attach it to the process just before I registered the policy. Turn on first chance exceptions so that it breaks whenever they occur. you can do that by issuing the command "sxe clr" once it is broken in. Here's a little more info about WinDBG:
http://blogs.msdn.com/tess/archive/2008/06/05/setting-net-breakpoints-in-windbg-for-applications-that-crash-on-startup.aspx
What I'd do is then watch for First Chance exceptions to be thrown, and do a !PrintException to see what is going on. My guess is that there is an exception being thrown somewhere that is causing the app to stop processing the other items.
What does the logic look like for your ProcessListItem? Have you tried just doing a return true to make sure it works?
Some nice ideas there, thanks. The Visual Studio debugger wasn't showing an exception (and I've wrapped everything in try/catch blocks just in case), but I hadn't thought of trying Windbg...