Several of my posts got lost. I am recreating them, as @stpaultim suggested.

Is there a module that can pull book data from Open Library to include in a node for (e.g.) book reviews? I didn't find anything by searching in the modules page.

Any suggestions?

Thank you.

Most helpful answers

Hi leeksoup. You may have better luck if you run Coder Upgrade on a site running PHP 7.4 as it doesn't do a great job running under PHP 8+.  This is known but the challenges to fix are quite tough.

@leeksoup

You could go either way.  I normally, convert as is, then apply patches, converting as I go.

However, if you have a D7 test site, you could apply each patch in turn, check it hasn't broken, then attempt to convert the finished patched module.

I will say that my mileage with Coder Upgrade hasn't been great but I do seem to have an uncanny knack for picking modules that look easy to port but then end up being more complex.

I tend to go more by the feedback on the patches than the status

Comments

Posted by Olafski on Thu, 25 May 2023 08:11:53 -0000 (UTC):
I don't know what kind of book data Open library provides. That said, there is a Backdrop module to store and display bibliographical data: Biblio.

Link: https://backdropcms.org/project/biblio
 

Posted by leeksoup:

There is a D7 module called ISBN2Node that does much of what I am looking for, but it hasn't been touched since 2014. Not sure if that would be a problem. There is not an equivalent Backdrop module.

Posted by yorkshirepudding on Thu, 25 May 2023 11:33:33 -0700 (PDT):

@leeksoup

*ISBN2node*

Not being touched since 2014 does not have to be a bad thing.  There are quite a few open issues which could be a problem if they are not easily fixed. Sometimes D7 issues sit with valid patches for ages, whereas I think we are mostly better at merging in fixes.  Do you have, or can you setup  a test D7 site to test the module on first? That might help to know whether it is worth the effort of porting. With lots of bugs, you won't know on porting it whether the issue is existing or introduced. If it works reasonably well in D7, then add to the list of requests for porting.

I had a quick look through the code and it didn't look too hard so you may want to give it a go.  Coder Upgrade might even do it.

@yorkshirepudding - Should the patches (at least RTBC) be applied before running it through Coder Upgrade?

@leeksoup

You could go either way.  I normally, convert as is, then apply patches, converting as I go.

However, if you have a D7 test site, you could apply each patch in turn, check it hasn't broken, then attempt to convert the finished patched module.

I will say that my mileage with Coder Upgrade hasn't been great but I do seem to have an uncanny knack for picking modules that look easy to port but then end up being more complex.

I tend to go more by the feedback on the patches than the status

Coming back to this after being off on another project for the past months. I have an old copy of a D7 site and was able to update a number of things (e.g. the API for Open Library has changed significantly) and get it mostly working.

I did end up adding the patches because they fixed several issues.

Going to try Coder Upgrade now.

Hi leeksoup. You may have better luck if you run Coder Upgrade on a site running PHP 7.4 as it doesn't do a great job running under PHP 8+.  This is known but the challenges to fix are quite tough.

Thanks for the tip. I can try with PHP 7.4 ... I didn't get any errors with it though. It seemed to go through just fine.

Ran it through Coder Upgrade and the module partly works (the fetching the data part works) but mostly it doesn't work. Also getting some strange errors. 

I suspect that the data isn't getting passed on to the next step in this code:

  // This ought to be session based to avoid clashes with other user's node submissions
    
  config_set('isbn2node.settings', 'isbn2node_data', serialize($isbn2book_data));     
  backdrop_goto('node/add/isbn2node-book');

ETA: Did some more debugging and this is not the problem. The module takes the fetched values from Open Library and inserts them as "default values" into the form entity ... but they don't actually show up in it. Help?