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

Add a 'weight' field to the Repository Item content type #1261

Closed
dannylamb opened this issue Sep 3, 2019 · 8 comments
Closed

Add a 'weight' field to the Repository Item content type #1261

dannylamb opened this issue Sep 3, 2019 · 8 comments

Comments

@dannylamb
Copy link
Contributor

dannylamb commented Sep 3, 2019

We'll be using the weight module to add page ordering for paged content. We should go ahead and add that to the Repository Item content type provided by islandora_defaults.

  1. Add the weight module to the islandora_defaults info file:
  2. Add a weight field to the Repository Item content type
  3. Remove the weight field from display
  4. Add the weight field to the form under the System section.
  5. Add an RDF mapping for the weight field.
  6. Re-export the islandora_defaults feature
@dannylamb dannylamb changed the title Add the 'weight' field to the Repository Item content type Add a 'weight' field to the Repository Item content type Sep 3, 2019
@dannylamb
Copy link
Contributor Author

Linking to #932

@manez
Copy link
Member

manez commented Sep 5, 2019

Playing with this a bit to test for the sprint.

I'm wondering what we should set for a default range, and can we set a default to auto-increment by assigning the heaviest weight? In other words, make it so that each new page gets added to the end of the book by default, if using the GUI. I tried a range of 1000, and nothing choked, but I assume that anyone building books page-by-page from the front end would rather not select the exact page number every time.

@dannylamb
Copy link
Contributor Author

dannylamb commented Sep 5, 2019

@manez We use the prepopulate module to give the member of field a default based on the parent. No reason why we couldn't use the same trick and query for the highest weight of the parent and bump that by one for a default value.

@seth-shaw-unlv
Copy link
Contributor

I've used 1000 as a range with no issues.

dbernstein added a commit to dbernstein/islandora_defaults that referenced this issue Sep 5, 2019
dannylamb pushed a commit to Islandora/islandora_defaults that referenced this issue Sep 10, 2019
@seth-shaw-unlv
Copy link
Contributor

I don't know if this is just me, but the field_weight settings aren't sticking. I updated my test site to the current master and did the feature import, but it is still showing the active config settings as only the default range: 20 with the min settings as only in the module config:
Screen Shot 2019-09-10 at 12 22 51 PM
I tried to update them using the field edit form (http://localhost:8000/admin/structure/types/manage/islandora_object/fields/node.islandora_object.field_weight) but those didn't stick either.

I have the latest weight version (8.x-3.1).

Hmmm... opening the field edit page throws a number of notices... something is going on with the module.

@seth-shaw-unlv
Copy link
Contributor

Alright, I checked my other test site that was already using the weight module and it isn't throwing any errors on the edit form, but it also doesn't have all the same form fields (despite the modules both reporting the same version).

@seth-shaw-unlv
Copy link
Contributor

Okay, I see what's going on here... the new field_weight is using the integer field type, not the weight field type. My dev box got confused because it already had a field_weight using the weight field type and so the settings didn't apply.

dannylamb pushed a commit to Islandora/islandora_defaults that referenced this issue Sep 19, 2019
@dannylamb
Copy link
Contributor Author

Resolved via Islandora/islandora_defaults@09355d9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants