Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Book listings feature (http://drupal.org/books), recently deployed on D.o needs to be upgraded to D7.
This includes:
- the feature itself (content type+view)
- relevant lines in drupalorg.module
- relevant lines in drupalorg_crosssite.module
D6 code: http://drupal.org/node/1487988#comment-6600986
Related issues:
#1836254: Theme Book listing pages and view
#1487988: Create new content type and Views for books
Comment | File | Size | Author |
---|---|---|---|
#21 | drupalorg_book_taxonomies-7.x-3.0.tgz | 751 bytes | jhodgdon |
#21 | drupalorg_book_listings-7.x-3.0.tgz | 9.49 KB | jhodgdon |
#20 | book_taxonomies-7.x-1.0.tgz | 701 bytes | jhodgdon |
#18 | 1836252-books-d7-drupalorg-18.patch | 5.51 KB | jhodgdon |
#17 | drupalorg_book_listings-7.x-1.0-17.tgz | 9.72 KB | jhodgdon |
Comments
Comment #1
jhodgdonI plan to do this, but I can't do it until next week at the earliest... provisionally assigning this to myself but if someone else wants to take it on, feel free.
Comment #2
Senpai CreditAttribution: Senpai commentedComment #3
twardnw CreditAttribution: twardnw commentedAssigning to me :) Soon as we have a database snapshot from 6->7 that catches feature (content type, et al)
Comment #4
jhodgdonIs that supposed to mean you expect this task to take 8 hours?!? I would guess 1 at the most. It's about 10 lines of code very similar to others that have already been ported, and a few lines of CSS to be added to Bluecheese, and a feature to recreate in 7.
Comment #5
Senpai CreditAttribution: Senpai commentedJen, it'd be 1hr if you were doing it, but since you're not, it's one calendar day, give or take.
Comment #6
jhodgdonI offered to do this particular upgrade, as part of the contrib project of getting this feature on d.o, after it was deployed. Still happy to do it, just let me know, but twardnw claimed it so I stepped aside.
Comment #7
Senpai CreditAttribution: Senpai commented@jhodgdon, I'd love it if you could tackle this issue! But, can you do it today? If so, great! Claim it for yourself and have at it. If not, I understand, and I'll have @twardnw do it today.
Comment #8
jhodgdonI can take care of it today if there is an updated dev server to work on. Let me know.
Comment #9
jhodgdonI'm working on this now.
Comment #10
jhodgdonSo... I went to the d7 test site for this, and it looks like:
- The crosssite patch from #1487988-176: Create new content type and Views for books was applied to D7 already, and it is working.
- Some of the drupalorg_handbook patch from the same place was applied; some wasn't. Some of what was applied was done in a D6 manner and needed a bit of adjusting.
- The content type is missing (it might be there in the DB but it is disabled).
- The View is missing.
- The feature is missing.
Anyway... Here's a preliminary patch for drupalorg_handbook which I'm attaching here so I can test this much of it. If this much works, it will still need a patch for the drupalorg_handbook_preprocess_content_field() function at the end of the drupalorg_handbook.module file.
I'm also going to try taking the d6 exported feature from the other issue and see if it will read OK in D7. It should be a start...
Comment #11
jhodgdonThat drupalorg patch had a typo, so here is a new one. It still needs a patch for the drupalorg_handbook_preprocess_content_field() function at the end of the drupalorg_handbook.module file, which is the part that turns the ISBN field into a purchase link on Amazon.
I also managed to get the feature updated, so here is a D7 export of the feature.
Some styling is also needed, but that is a separate issue (#1836254: Theme Book listing pages and view).
Comment #12
jhodgdonHere's a slight tweak to the feature: made the view hide empty fields, and made the content type accept GIF images.
Comment #13
jhodgdonAnd here's a new drupalorg patch to fix an undefined array element warning.
Comment #14
jhodgdonAnd one more update for the feature, to include the image. It probably needs a new image style for the books page.
I'm out of time... to dos:
- Styling on that other issue (needs CSS expert to overcome the clearfix nonsense)
- Image style for the book view page
- Fix the drupalorg_handbook_preprocess_content_field() function at the end of the drupalorg_handbook.module file
Comment #15
jhodgdonA note on the preprocess function... it probably needs to be
http://api.drupal.org/api/drupal/modules!field!field.module/function/tem...
in other words, rename it to drupalorg_handbook_preprocess_field() and tweak the code a little for d7 fields vs. d6 cck
Comment #16
jhodgdonOK, I have the preprocess function done and it works too.
So the only remaining ToDo on this issue is probably an image style, which I guess probably gets added to the feature?
Anyway, here's a new handbook patch.
Comment #17
jhodgdonI checked the old d6 test site and the image is formatted with style "grid-2" there. Applied that style and it looks good! So here is an export of the feature, and I think this issue is done! (once the patches are committed).
Sorry about all the comments... What needs to be committed is the patch in #16 for drupalorg, and then this feature export needs to be added to drupalorg/features too.
Comment #18
jhodgdonDang. One more patch for drupalorg to fix a PHP warning.
Comment #19
drummI committed #18 and followed up with a couple code style changes: http://drupalcode.org/project/drupalorg.git/blobdiff/e8f5c110d1903670f73...
I'm not committing the feature yet since it takes ownership of all 6 vocabularies associated with book listing content types. Audience, Keywords, and Level are also used by book pages; and Drupal version is also used by a few types. Either:
Comment #20
jhodgdonHere is a feature with just the taxonomies... still testing, but I need this somewhere so I can download it and test it out.
Comment #21
jhodgdonOK, ignore #20. Here are two features. One has the 6 taxonomies only, and the other has the other stuff for book listings, and depends on the taxonomy feature.
Comment #22
drummLooks okay, committed.
Comment #23.0
(not verified) CreditAttribution: commentedadding 1836254