New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When attaching files it won't save on sites with Minimal Download Strategy (MDS) enabled #61

Closed
mcsheaj opened this Issue Apr 1, 2017 · 8 comments

Comments

4 participants
@mcsheaj
Owner

mcsheaj commented Apr 1, 2017

This issue was imported from CodePlex

jyanez73 wrote 2017-03-13 at 09:42
Hi,

SPEasyForms is very nice and well thought.

I have been testing some configurations and detected that when I have a list customized and I attach files the form won't save. When I click the Save button it will be grayed out but nothing happens.

I'm using Sharepoint Foundation 2013 on premise SP1 and CU October 2016 applied.

Maybe I'm missing something?

Thank you very much.

mcsheaj wrote 2017-03-13 at 09:52
I haven't seen this before. What browser/version are you using?

jyanez73 wrote 2017-03-13 at 10:28
Hi, I tried with Chrome, Firefox and IE 11.

All three present the same behavior.

I found that the problem only occurs when displaying the site in a non English language (I tried with Spanish that's our case).

mcsheaj wrote 2017-03-15 at 10:48
Ewww! Ok, it makes sense that I haven't seen this. SPEasyForms does have a few known issues with non-English sites, all pretty minor until now. I don't speak any other languages (ok, I took a year of Spanish more years ago than I care to admit), so this
may be difficult to track down without the help of a Spanish speaking JavaScript developer.

I'll try spinning up a Spanish site when I get a chance and see what I can see, but the combination of a non-English site and a form where attachments have been added suggests it may not be that simple.

Joe

jyanez73 wrote 2017-03-15 at 11:26
Hi Joe,

Thank you very much for your answer.

What I saw that the FieldName is called Datos adjuntos instead of Attachments.

The tr id is the same, idAttachmentsRow.

I'm copying the markup to give you an example.

<script type="text/javascript">// </script>

Datos adjuntos

duplicado.pdf     Eliminar

mcsheaj wrote 2017-03-15 at 12:28
In general, SPEasyForms is only dependent on field internal names, which are the same regardless of language. I just took a quick look at the code, and I am identifying the attachments row via idAttachmentsRow, so that should be fine.

Quick question: on the form where you are having difficulty, have you moved the attachments field from the default form onto one of my containers? If so, can you try and move it back to the default form and see if you still have the issue?

Also, if you remove the SPEasyForms configuration for that list, does it function correctly? The cleanest way to do this would be to temporarily rename the configuration file in the Site Assets library.

All of this is intended just to give me clues as to where the problem lies.

Joe

jyanez73 wrote 2017-03-15 at 13:40
Hi Joe,

I've tried both options, using containers and not using them leaving every field in the default form and the behavior is the same, it won't save if I attach files.

If I rename the configuration file in the Site Assets library it works correctly and also looses any rules that were attached, meaning that SPEasyForms is not customizing the form. In this case after renaming the configuration file it saves the item with the
attachment correctly.

Hope this helps.

Thanks.

Juan.

mcsheaj wrote 2017-03-16 at 09:26
Those are the answers I expected, but knowing it for sure eliminates numerous possibilities.

Joe

jyanez73 wrote 2017-03-16 at 10:00
Hi Joe,

Do you thing you can solve this?

Thank you very much.

Regards,

Juan

mcsheaj wrote 2017-03-16 at 11:50
Hi Juan,

I don't know yet. First I need to reproduce it, which means I need to install a language pack and create a Spanish site, and then I need to try to work in a SharePoint site that uses a language I don't speak, which isn't ideal. And of course, I have a pesky
job which gets in the way sometimes ;)

I should be able to work on this sometime tomorrow, but there are a few ways this can go.

  1. I could be able to reproduce the problem and see an exception in the debugger or a message in the console that makes it obvious what the problem is.
  2. I could be able to reproduce the problem but see no indication of where the problem lies.
  3. I could not be able to reproduce the problem.
How much time it will take to fix it depends on which way the testing goes. I'll let you know as soon as I know more.

Joe

jyanez73 wrote 2017-03-16 at 13:19
Hi Joe,

Hope you can fix it.

I think you won't have a problem to reproduce it.

It came out in the first test with a regular list with just one rule.

Please let me know if I can help you in any way.

Thanks!

mcsheaj wrote 2017-03-17 at 15:01
Unfortunately, I cannot reproduce this. I have SharePoint Foundation 2013, which I spent the morning patching up to SP1 and the October 2016 CU, and of course added the Spanish Language Pack. I created a Spanish site collection, in which I created a contacts
list. I configured the list with just a columns container with a couple of fields on it, after which I had no problem uploading attachments in saving on both the new and edit forms.

None of this is to suggest your problem isn't real, but it is not as simple as Spanish + SPEasyForms + attachments = save doesn't work. I'm pretty stuck.

Joe

jyanez73 wrote 2017-03-17 at 16:22
Hi Joe,

I only tested with custom lists (Lista Personalizada in Spanish). I tried to follow the same instructions as you with a contact list and in Firefox and Chrome I could reproduce the same issue. In Internet Explorer 11 it doesn't customize the list at all, it
gives an exception spefjQuery(window).bind('load', function() { spefjQuery.spEasyForms.init(); });

Unable to get property 'get_childDialog' of undefined or null reference.

It only happens in IE, but that's another story!

Returning to the original problem, can you try with a custom list with just a Title and only one rule for highlight green (without extra conditions)?

Thank you very much for your time.

jyanez73 wrote 2017-03-17 at 16:24
Just in case, I'm using the default recommended download SPEasyForms.2015.01.06

Thanks!

mcsheaj wrote 2017-03-17 at 17:12
So the get_childDialog is something I have seen before and only on Foundation. I have fixed it too, but I haven't put it into a release yet (partially because nobody reported it, I found it myself):

Issue 58: Error cannot call get_childDialog on undefined

I've very quickly put up a new download page at:

jquery.SPEasyForms.js

Download that javascript file and upload it to Style Library/SPEasyFormsAssets/2015.01.06/JavaScript, overwriting the javascript file that is there.

You need to make sure you clear your browser cache (google it, it can be tricky).

This should get rid of that get_childDialog error. I don't have a lot of reason to believe it will fix the other issue too, but it's possible.

Joe

jyanez73 wrote 2017-03-17 at 18:33
Hi Joe,

I replaced the file but it didn't help a lot. It resolved the IE exception but still doesn't configure the form when using a Contact list type. The attachment problem still is the same.

I double checked that it is downloading the new jquery.SPEasyForms.js so no luck with it.

If it's ok with you I will setup the test Sharepoint site to allow you to access remotely as site collection administrator and test directly.

Thanks!

mcsheaj wrote 2017-03-17 at 19:21
I forgot to tell you one thing. SPEasyForms does not work on lists that have the old rich text fields, which the contacts list does by default (the Notes field). It's supposed to tell you that on the settings page, but there's a bug where it doesn't work
on 2013 and earlier right now. So to get it to work on a Contacts form, you need to reconfigure the Notes field to be either enhanced rich text or plain text.

Joe

jyanez73 wrote 2017-03-20 at 13:47
Hi Joe,

With your indication the contact list worked in Internet Explorer.

Still has the same issue about attachments that won't allow to save.

Thanks!

mcsheaj wrote 2017-03-30 at 17:53
This turns out to be a minimal download strategy issue not in any way related with language. I am still investigating, but I don't have much to go on. All I can do is recommend turning off MDS on sites where you want to use SPEasyForms for now.

jyanez73 wrote 2017-03-31 at 10:32
Hi Joe,

Thank you very much for your answer.

Hope you can fix it in the future.

mcsheaj wrote 2017-03-31 at 13:45
No problem, but I didn't close the issue because I am planning to work on a better solution. I just wanted to change the title to more accurately reflect the problem, and put in a comment with the only known work-around at the moment.

I'm not a fan of MDS. I think it's a messy invasive customization with very dubious merit. Very small customizations to your site can make it actually perform significantly slower with MDS enabled than with it off. Even Microsoft has said that MDS and the publishing
features are incompatible and doesn't let you turn on MDS on sites with publishing enabled, which I think says it all. Just the same, I always strive to make my customizations work with or without it, including SPEasyForms.

This is actually the first time since 2014.00.xx beta that I've had a reported issue specific to MDS. On the other hand I don't know how many people are using SPEasyForms and attachments, and many people just stop using it if they find an issue and don't report
it, so I may have had this issue for quite some time and just not known it. I appreciate your help in isolating it, and I'll certainly let you know if I have any luck overcoming it.

Thanks,

Joe

@mcsheaj mcsheaj added the CodePlex label Apr 1, 2017

@jyanez73

This comment has been minimized.

Show comment
Hide comment
@jyanez73

jyanez73 Apr 3, 2017

Hi Joe,
Thanks for your explanation.
Just to let you know, before the fix that you sent it didn't work in Spanish even without MDS.
After the fix it only had problems with MDS and I'm agree that it's not so important but being it enabled in the default site template many users will face the error.
Thanks!

jyanez73 commented Apr 3, 2017

Hi Joe,
Thanks for your explanation.
Just to let you know, before the fix that you sent it didn't work in Spanish even without MDS.
After the fix it only had problems with MDS and I'm agree that it's not so important but being it enabled in the default site template many users will face the error.
Thanks!

@mcsheaj

This comment has been minimized.

Show comment
Hide comment
@mcsheaj

mcsheaj Apr 3, 2017

Owner

That makes sense about it not working with or without MDS before that fix, because that's what I thought I was seeing at the time.

MDS being enabled by default on team sites is why I strive to make it work with MDS. I may not like the feature much, but if it's on most of the time I've got to deal with it. I'm still going to be looking for a proper fix, but if I don't find one in a timely fashion, I'll do something like:

  1. Hide the attachment column if MDS is enabled and SPEasyForms is configured for a list.
  2. Detect MDS enabled on the editor page and display a warning about hiding the attachment column if MDS is detected, and also explaining that disabling MDS will remove this restriction.
  3. Add the limitation to the documentation.

in the next release. This is more of a hack than a fix, but it's easy enough to do and still better than not being able to submit.

Joe

Owner

mcsheaj commented Apr 3, 2017

That makes sense about it not working with or without MDS before that fix, because that's what I thought I was seeing at the time.

MDS being enabled by default on team sites is why I strive to make it work with MDS. I may not like the feature much, but if it's on most of the time I've got to deal with it. I'm still going to be looking for a proper fix, but if I don't find one in a timely fashion, I'll do something like:

  1. Hide the attachment column if MDS is enabled and SPEasyForms is configured for a list.
  2. Detect MDS enabled on the editor page and display a warning about hiding the attachment column if MDS is detected, and also explaining that disabling MDS will remove this restriction.
  3. Add the limitation to the documentation.

in the next release. This is more of a hack than a fix, but it's easy enough to do and still better than not being able to submit.

Joe

@JelleFerret

This comment has been minimized.

Show comment
Hide comment
@JelleFerret

JelleFerret May 9, 2017

Dear Joe

I'm experiencing the same problem. When creating a dutch SharePoint site the form does'nt save when an attachment is added.

On an English everything works like a charm.

Other scenario's:
English SharePoint site where:
-Alternate language = Dutch
-Browser language = Dutch
-The form does not save if attachments are added

Dutch SharePoint site where:
-Alternate language = English
-Browser language = English
-The form does save with or without attachments

Thanks.

Kr
Jelle Ferret

JelleFerret commented May 9, 2017

Dear Joe

I'm experiencing the same problem. When creating a dutch SharePoint site the form does'nt save when an attachment is added.

On an English everything works like a charm.

Other scenario's:
English SharePoint site where:
-Alternate language = Dutch
-Browser language = Dutch
-The form does not save if attachments are added

Dutch SharePoint site where:
-Alternate language = English
-Browser language = English
-The form does save with or without attachments

Thanks.

Kr
Jelle Ferret

@mcsheaj

This comment has been minimized.

Show comment
Hide comment
@mcsheaj

mcsheaj May 9, 2017

Owner

Is the SharePoint site feature minimal download strategy turned on in any of the sites where you are experiencing this issue (I don't know what the name is in Dutch, but hopefully you do ;)? If so, try turning it off and let me know if it works. If not, let me know that too. So far this hasn't proven to be a language specific issue, although it was first reported as such.

Joe

Owner

mcsheaj commented May 9, 2017

Is the SharePoint site feature minimal download strategy turned on in any of the sites where you are experiencing this issue (I don't know what the name is in Dutch, but hopefully you do ;)? If so, try turning it off and let me know if it works. If not, let me know that too. So far this hasn't proven to be a language specific issue, although it was first reported as such.

Joe

@JelleFerret

This comment has been minimized.

Show comment
Hide comment
@JelleFerret

JelleFerret May 9, 2017

Hi Joe

Thanks for your quick response, the site feature is deactivated on all sites. I activated and deactivated the feature on one of the sites but still no luck.

Kr
Jelle

JelleFerret commented May 9, 2017

Hi Joe

Thanks for your quick response, the site feature is deactivated on all sites. I activated and deactivated the feature on one of the sites but still no luck.

Kr
Jelle

@koenti

This comment has been minimized.

Show comment
Hide comment
@koenti

koenti Jul 31, 2017

Joe,
After three hours debugging of @JelleFerret problem we found the 'bug'. Bug = He was not able to save attachments in NON-English SP sites,

In line 419 & 466 of file "jquery.SPEasyForms.js" you used $("input[value='Save']")to find the SAVE-button. Non-English SP sites will nog have a save button with 'SAVE'-text. Code should be:
[id$='_diidIOSaveItem']

I see now that you solved this 'bug' already in GITHUB source code around end of March.
Problem is that people are still downloading the WSP.file from CodePlex as this is the only place to find the WSP. CodePlex contains an old version.
@jyanez73 probably also used an old version of your code at time of issue reporting.

Suggestion: Can you re-create a new WSP and make it available for us somewhere? Your tool a very good, certainly for SP powerusers, but building a new WSP is somehow to advanced for them :).

Thanks,
Koen

koenti commented Jul 31, 2017

Joe,
After three hours debugging of @JelleFerret problem we found the 'bug'. Bug = He was not able to save attachments in NON-English SP sites,

In line 419 & 466 of file "jquery.SPEasyForms.js" you used $("input[value='Save']")to find the SAVE-button. Non-English SP sites will nog have a save button with 'SAVE'-text. Code should be:
[id$='_diidIOSaveItem']

I see now that you solved this 'bug' already in GITHUB source code around end of March.
Problem is that people are still downloading the WSP.file from CodePlex as this is the only place to find the WSP. CodePlex contains an old version.
@jyanez73 probably also used an old version of your code at time of issue reporting.

Suggestion: Can you re-create a new WSP and make it available for us somewhere? Your tool a very good, certainly for SP powerusers, but building a new WSP is somehow to advanced for them :).

Thanks,
Koen

@mcsheaj

This comment has been minimized.

Show comment
Hide comment
@mcsheaj

mcsheaj Jul 31, 2017

Owner

Hi Koen,

I will try to get a 2016.01.07 released by the end of the week. Problem is, I try to do a full round of regression testing each time I release so it is time consuming, and I've just been too busy lately. I was also hoping to resolve this issue completely, before releasing (i.e. fix it even with MDS enabled).

I have one idea for how to fix it with MDS enabled, and if it actually works it won't take that much time at all. I'll take a stab at it on Friday. Whether I fix it or not, I'll go ahead and do a release sometime over the weekend. Sorry for the delay, I realize there is no work around for your issue; for the MDS related issue at least there is a work around.

Joe

Owner

mcsheaj commented Jul 31, 2017

Hi Koen,

I will try to get a 2016.01.07 released by the end of the week. Problem is, I try to do a full round of regression testing each time I release so it is time consuming, and I've just been too busy lately. I was also hoping to resolve this issue completely, before releasing (i.e. fix it even with MDS enabled).

I have one idea for how to fix it with MDS enabled, and if it actually works it won't take that much time at all. I'll take a stab at it on Friday. Whether I fix it or not, I'll go ahead and do a release sometime over the weekend. Sorry for the delay, I realize there is no work around for your issue; for the MDS related issue at least there is a work around.

Joe

@mcsheaj

This comment has been minimized.

Show comment
Hide comment
@mcsheaj

mcsheaj Aug 7, 2017

Owner

I have fixed the problem due to the hard-coded Save (i.e. English language).

I also believe I've fixed the more general problem with MDS and some non-English sites. By luck, I happened to test a SharePoint 2013 foundation server with just service pack 1 and it did not have this issue. I patched it to Oct 2016 CU and it did, and it continued to have the problem up to Jul 2017 CU. Curiously, I could not reproduce it on SharePoint 2016 at all. In either case I've simplified my preSaveItem handler and the problem has disappeared.

The fix can be found on my blog at http://speasyforms.intellipointsol.com/sdm_downloads/speasyforms-2015-01-07/. I'm going to continue to use GitHub for source code, but I've moved releases over to my blog because I want more control over how they look and download statistics. I've updated the release page on this site to point to the blog. I'll update codeplex soon.

I'm closing this issue. If you find there is still a problem, by all means open another one.

Joe

Owner

mcsheaj commented Aug 7, 2017

I have fixed the problem due to the hard-coded Save (i.e. English language).

I also believe I've fixed the more general problem with MDS and some non-English sites. By luck, I happened to test a SharePoint 2013 foundation server with just service pack 1 and it did not have this issue. I patched it to Oct 2016 CU and it did, and it continued to have the problem up to Jul 2017 CU. Curiously, I could not reproduce it on SharePoint 2016 at all. In either case I've simplified my preSaveItem handler and the problem has disappeared.

The fix can be found on my blog at http://speasyforms.intellipointsol.com/sdm_downloads/speasyforms-2015-01-07/. I'm going to continue to use GitHub for source code, but I've moved releases over to my blog because I want more control over how they look and download statistics. I've updated the release page on this site to point to the blog. I'll update codeplex soon.

I'm closing this issue. If you find there is still a problem, by all means open another one.

Joe

@mcsheaj mcsheaj closed this Aug 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment