set default value [Enhancement]

Bug #1886079 reported by Oliver König on 2020-07-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Charles Haley

Bug Description

Hello,
is there a posibility to set the default value to an own column/field?

For example: a yes/no field actually is empty, i prefer a "no"

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1886079

Changing the component for this bug.

 assignee cbhaley
 status triaged

Changed in calibre:
assignee: nobody → Charles Haley (cbhaley)
status: New → Triaged
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Triaged → Fix Released
Revision history for this message
Oliver König (soloking) wrote :

Thank you for the implementation, unfortunately it doesn't work.
I set the default value for existing own fields and added a book (whether via Paste & copy or Automatic folder), the values were still undefined.
A new column for the test also has the same result.

Revision history for this message
Charles Haley (cbhaley) wrote :

It works fine for me. Steps I tried:

1) Add a default value to several columns including Yes/No, Enumerated, Behaves like tags, Float, and Int.
2) Restart calibre.
3a) Drag a book onto calibre. All the defaults are filled in.
3b) Add a book using the Add Books button. All the defaults are filled in.
3c) Add a book via auto-add. All the defaults are filled in.

Note that this feature will not affect existing books even if you add a new format. It affects books adding books that are not in calibre's database.

What steps are you following when it fails? What operating system are you running?

Revision history for this message
Charles Haley (cbhaley) wrote :

I found what is probably the problem. For Yes/No columns the default "False" (or whatever it is in your language) wasn't correctly applied when adding a book.

Changed in calibre:
status: Fix Released → Fix Committed
Revision history for this message
Oliver König (soloking) wrote :

ok, thank you. I wanted to test it tonight (Germany), I had actually only tried it with "Nein" which is "No".

Kovid Goyal (kovid) on 2020-07-21
Changed in calibre:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers