Skip to content
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

Import screen should not be auto-selecting Key Fields that can't be de-selected #13071

Closed
DeanGonzalez opened this issue Nov 15, 2017 · 8 comments

Comments

@DeanGonzalez
Copy link

Tested on 4.2.1 and 4.2.2

The import screen is automatically selecting key fields - which should not happen for ANY fields.

Secondly, the fields are not de-selectable, forcing the import file to always match and update where the auto-selected keyfields match

keyfields

This bug breaks the ability to import content correctly in the majority of cases

@DeanGonzalez DeanGonzalez added this to the Rex Current milestone Nov 15, 2017
@oarrietadotcms oarrietadotcms self-assigned this Dec 4, 2017
@oarrietadotcms
Copy link
Contributor

Seems like that has been the behavior since the beginning. This is from demo3:
screen shot 2017-12-04 at 3 44 42 pm

This is the source code that disables the items:

function fieldCheckbox (field) {
var fieldName = field["fieldName"];
var fieldInode = field["inode"];
var fieldIndexed = field["fieldIndexed"];
var disableField = "";
if(!fieldIndexed){
disableField = "disabled"
}
<%
String[] fields = form.getFields();
for (int i = 0; i < fields.length; i++)
{
%>
if ((fieldInode == "<%=fields[i]%>") && fieldIndexed) {
if (dijit.byId(fieldInode + 'Field'))
dijit.byId(fieldInode + 'Field').destroy();
return "<div class='checkbox'><input checked type=\"checkbox\" dojoType=\"dijit.form.CheckBox\" id=\"" + fieldInode + "Field\" name=\"fields\" value=\"" + fieldInode + "\" "+disableField+" /> " + fieldName + "</div>";
}
<%
}
%>
if (dijit.byId(fieldInode + 'Field'))
dijit.byId(fieldInode + 'Field').destroy()
return "<div class='checkbox'><input type=\"checkbox\" dojoType=\"dijit.form.CheckBox\" id=\"" + fieldInode + "Field\" name=\"fields\" value=\"" + fieldInode + "\" "+disableField+" /> <label>" + fieldName + "</label></div>";
}

Are we really sure that this is a bug?

@DeanGonzalez
Copy link
Author

Definitely a bug, when we remove that the fields are required... the import keyfields are still there. I just removed all required fields from the employee content type on demo:

zerorequired

Then try to import content, and you still get this:

keyfield bug

Not sure when we busted this, but definitely wrong.

@wezell
Copy link
Contributor

wezell commented Dec 4, 2017 via email

@oarrietadotcms
Copy link
Contributor

@wezell @DeanGonzalez for what I see in the source code, they are only disabled (visually). Nothing related to its value.

And also this happens only for NOT INDEXED fields.

@oarrietadotcms
Copy link
Contributor

My guess is that UI prevents selecting a NOT-INDEXED field as a key field. Makes sense, right?

@wezell
Copy link
Contributor

wezell commented Dec 4, 2017 via email

@DeanGonzalez
Copy link
Author

Yep, it is just visual bug, it actually allows it, even though it looks like it won't... not as bad as I thought, even though still a bug.

@dsilvam dsilvam modified the milestones: Rex Current, Rex Next Dec 5, 2017
@dsilvam dsilvam modified the milestones: Rex Current , Rex Next Jan 16, 2018
@dsilvam dsilvam modified the milestones: Rex Current, Rex Next Feb 13, 2018
@dsilvam dsilvam modified the milestones: Rex Current, Rex Next Mar 1, 2018
@dsilvam dsilvam modified the milestones: Rex Current, Rex Next Mar 20, 2018
@erickgonzalez erickgonzalez modified the milestones: Rex Current, Rex Next Apr 11, 2018
@dsilvam dsilvam modified the milestones: Rex Current, Rex Next May 1, 2018
@stale
Copy link

stale bot commented Sep 28, 2019

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

@stale stale bot added the wontfix label Sep 28, 2019
@stale stale bot closed this as completed Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants