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

[Jupiter]Item type field in deposit form has duplicate values #1117

Closed
pbinkley opened this issue May 2, 2019 · 4 comments
Closed

[Jupiter]Item type field in deposit form has duplicate values #1117

pbinkley opened this issue May 2, 2019 · 4 comments

Comments

@pbinkley
Copy link
Member

pbinkley commented May 2, 2019

Describe the bug
In the deposit form, the "Item type" drop-down contains the list of values twice, with one value represented by a "translation missing" message

To Reproduce

  1. log in
  2. Click "Deposit"
  3. View html source

The select element for item type contains:


<select class="form-control select required" required="required" aria-required="true" name="draft_item[type_id]" id="draft_item_type_id"><option value="">Select your item&#39;s type</option>
--
  | <option value="1">Book</option>
  | <option value="2">Book Chapter</option>
  | <option value="3">Conference/Workshop Poster</option>
  | <option value="5">Dataset</option>
  | <option value="6">Image</option>
  | <option value="7">Journal Article (Draft-Submitted)</option>
  | <option value="8">Journal Article (Published)</option>
  | <option value="9">Learning Object</option>
  | <option value="10">Report</option>
  | <option value="11">Research Material</option>
  | <option value="12">Review</option>
  | <option value="13">Book</option>
  | <option value="14">Book Chapter</option>
  | <option value="15">Conference/Workshop Poster</option>
  | <option value="16">translation missing: en.activerecord.attributes.type.names.conference_workshop_presenation</option>
  | <option value="17">Dataset</option>
  | <option value="18">Image</option>
  | <option value="19">Journal Article (Draft-Submitted)</option>
  | <option value="20">Journal Article (Published)</option>
  | <option value="21">Learning Object</option>
  | <option value="22">Report</option>
  | <option value="23">Research Material</option>
  | <option value="24">Review</option>
  | <option value="4">Conference/Workshop Presentation</option></select>

Note that 1-12 are duplicated by 13-24, with 4 displaced to the end, and 4's value represented by the "translation missing" message in 16 in the second set.

Expected behavior
A single list of the 12 values for Item type.

Desktop (please complete the following information):

  • OS: Linux
  • Browser Chrome, Firefox
@weiweishi
Copy link
Contributor

weiweishi commented May 3, 2019

  • clean up the data, and make sure the objects deposited are not impacted
  • investigate why the list is duplicated on the production instance.

@ConnorSheremeta ConnorSheremeta self-assigned this Jun 27, 2019
@ConnorSheremeta
Copy link
Contributor

Era prod and test currently do not have this issue (other than option 4 being at the end.) It is probably worth keeping this open and looking at the next deployment to see if this is still the case.

<div class="form-group select required draft_item_type"><label class="col-form-label select required" for="draft_item_type_id"><abbr title="required">*</abbr> Type of Item</label><select class="form-control select required" required="required" aria-required="true" name="draft_item[type_id]" id="draft_item_type_id"><option value="">Select your item&#39;s type</option>
--
  | <option value="1">Book</option>
  | <option value="2">Book Chapter</option>
  | <option value="3">Conference/Workshop Poster</option>
  | <option value="5">Dataset</option>
  | <option value="6">Image</option>
  | <option value="7">Journal Article (Draft-Submitted)</option>
  | <option value="8">Journal Article (Published)</option>
  | <option value="9">Learning Object</option>
  | <option value="10">Report</option>
  | <option value="11">Research Material</option>
  | <option value="12">Review</option>
  | <option value="4">Conference/Workshop Presentation</option></select><small class="form-text text-muted">If you do not see an appropriate item type, please contact <a href="mailto:[email protected]">[email protected]</a></small></div>

@ConnorSheremeta ConnorSheremeta removed their assignment Jun 27, 2019
@weiweishi
Copy link
Contributor

@henryzhang87 and I have investigated into this issue - it was caused by running rake db:seed to add st. stephen's as an additional institute. in our seeds.rb file, we don't check for values that are already existed in the db, including item types, languages, and institute, so when new data needs to be added, and db:seed needs to be rerun, it causes the duplication. We have confirmed this is the cause and have removed the duplicated values, and this issue didn't happen during the recent deployment.

The next step is to improve our seeds.rb file, to check for existing values before inserting new.

@weiweishi weiweishi changed the title Item type field in deposit form has duplicate values [Jupiter]Item type field in deposit form has duplicate values Jun 28, 2019
@ConnorSheremeta ConnorSheremeta self-assigned this Jun 28, 2019
@ConnorSheremeta
Copy link
Contributor

Determined that no data clean is needed as the objects deposited under a duplicated type/language/institute are not impacted

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

3 participants