DDC Column Links to Table Broken

CharlasBug Collectors

Únete a LibraryThing para publicar.

DDC Column Links to Table Broken

1kristilabrie
Editado: Mar 27, 2015, 1:13 pm

All of my DDC links to the DDC table are broken in Your Books, I get an error message from the database.

I can fix this by clicking the DDC field for each book to edit and automatically saving (no true changes necessary, just click/save):



The field saves as black (no hyperlink), then I can refresh the page and it will pop up as blue again (hyperlinked to the DDC table):





ETA: confirmed this is happening for a couple other test accounts of mine.

2lorax
Mar 27, 2015, 1:12 pm

I cannot replicate this in my catalog, though I can in yours for green numbers (obviously not with the save-to-confirm step). Can you confirm that it is occurring for blue numbers (actually in your catalog) and not just green ones? If it's just green then it's the same situation as in the other DDC thread you just closed.

3kristilabrie
Editado: Mar 27, 2015, 1:15 pm

ugh, really? This is strange, because I never made edits to my DDC columns and the links that were previously working in my first bug report are no longer working... do DDCs refresh/update on occasion, which might cause things to stop working?

testing now..

4lorax
Mar 27, 2015, 1:15 pm

Ah, one of those bugs that goes away as soon as someone looks at it!

5kristilabrie
Mar 27, 2015, 1:18 pm

welp, and now they're working again. I don't *think* I'm crazy...?

6kristilabrie
Mar 27, 2015, 1:23 pm

FWIW, when I go to the "Edit my book" page, editing/re-entering the DDC for my book doesn't seem to save. The code seems to revert back to the work-level code (it remains green).

Only if I edit in Your Books, this seems to change my book-level DDC and fix the problem.

(I feel like I've seen this posted somewhere else, but maybe for a different bug..)

7jjmcgaffey
Abr 2, 2015, 10:19 pm

There are quite a few bugs where editing in one place works and in another(s) doesn't. I don't recall one offhand for DDC, but it could be.

8kristilabrie
Abr 3, 2015, 12:40 pm

Checked my DDC numbers again, and the ones I had edited in Your Books that were working....are now broken again.

So, edits are not sticking. Or, rather, those fields keep getting repopulated somehow, replacing my edits? Any ideas? Going to test this out by changing "919" to "919.4" for https://www.librarything.com/work/4028936/book/112736970. Will check later to see if it sticks.

9lorax
Abr 3, 2015, 1:02 pm

Oh, are your "edits" that weren't sticking actually blanking the field? Yeah, that doesn't stick, the database doesn't appear to distinguish the empty string from null. If you really want a blank field, use a space.

10kristilabrie
Abr 8, 2015, 12:31 pm

No, my edits were simply replacing the green, auto-generated DDC number with my own number (I wasn't changing the number at all just making it go from green to blue).

Does this whole system regenerate when developments/changes are made to it (such as adding the custom Call Numbers)? This would explain why my previous edits were replaced, though it's a bit of a pain to have to redo them.

The book I tested in >8 kristilabrie: is still working as we speak...hopefully it stays that way!

11kristilabrie
Abr 9, 2015, 12:13 pm

Deferring..

12dbell154
Editado: mayo 19, 2015, 1:38 pm

I sent this to Kristi earlier and thought I would share it here while I expand a little on it.

There is a problem with the Melvil Decimal System (MDS) links in the Your Books pages. I have MDS as a column in one of my view styles and it used to be that when a book was added with a MDS, it would generate a link to the MDS page.
Now, when new books are added, the information is missing in the link to get to the appropriate MDS page, even though the appropriate number is added to the record. Many existing books still have a working URL.

I'm also a web programmer so maybe this additional information will help.

The links that do not work have the following URL. It has the variable ddc, but no number assigned even though the field has a number.
http://www.librarything.com/catalog_bottom.php?ddc=&view=dbell154

The source for this particular link looks like this.
<td class="ipe" id="dewey118137757" onDblClick="LT_editData(event,'lt-dewey');"><a onclick="return wontwork();" class="workdata" href="/catalog_bottom.php?ddc=&view=dbell154">745</a></td>
and generates this link.
745

If I manually edit the url and add the appropriate number after "ddc=", I can get to the MDS.
http://www.librarything.com/catalog_bottom.php?ddc=745&view=dbell154

If I double-click and edit the field on the webpage and reload the page then the link is also fixed for that entry.

The problem appears to be that the URL for the MDS entry is stored separately from the actual MDS/ddc number data being displayed.

FIX
This could be easily fixed by creating the URL dynamically when loading the data from the database and formatting the page in php. I can't see why you would want to store the URL separately.

CAVEAT
Of course, this doesn't fix the loss of the link (unless reloading) when editing the field, which you would probably have to do in the javascript code. Oddly, the javascript (mds(num)) that looks like it would do this is not being called on the page. Anyway, that's a different issue.

13lorax
mayo 19, 2015, 2:28 pm

Are the DDC numbers when the link is broken green (meaning the data is not actually in your catalog, but inferred from the work-level data) or black (meaning the data is actually present in your catalog)? Your observation that editing fixes the situation strongly suggests that what's happening to you is the same as the initial bug (which has been deferred).

14knerd.knitter
Mar 10, 2021, 3:45 pm

The green links were not working properly. This has been fixed.