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

Entry types preferences: Unable to remove multiline property from field #11897

Open
2 tasks done
Siedlerchr opened this issue Oct 7, 2024 · 8 comments · May be fixed by #12040
Open
2 tasks done

Entry types preferences: Unable to remove multiline property from field #11897

Siedlerchr opened this issue Oct 7, 2024 · 8 comments · May be fixed by #12040
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor FirstTimeCodeContribution Triggers GitHub Greeter Workflow

Comments

@Siedlerchr
Copy link
Member

Siedlerchr commented Oct 7, 2024

JabRef version

Latest development branch build (please note build date below)

Operating system

Other (please describe below)

Details on version and operating system

OS independent

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

Custom entry types
I changed the "Author" field to multiline for the "Article" entry type in preferences.

Image

After restarting JabRef, the "Author" field became multiline for all entry types, even though it should only apply to "Article".

Now, when I try to change the "Author" field back to a single line by unchecking the option and restarting, nothing happens. To remove the multiline setting, I have to update it for all entry types.

Does Reset to default work?

No, it doesn’t. It only resets the selected entry type, the "Article", but the "Author" field is still marked as multiline in other entry types. So, when saving, it remains multiline because of those other types.

Appendix

...

Log File
Paste an excerpt of your log file here
@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs entry-editor labels Oct 7, 2024
@PressJump
Copy link

Hey @Siedlerchr, I am able to recreate this issue on the latest development branch build and I would be interested in picking this issue up as my first contribution if the issue does not have anyone assigned/planned to be assigned on it. Thanks.

@Siedlerchr Siedlerchr added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

Welcome to the vibrant world of open-source development with JabRef!

Newcomers, we're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

@Siedlerchr
Copy link
Member Author

As a general hint, fields are global and shared among the entry types. That explains part of the issue and is by design.
However, at least the reset should work and the toggle between multiline and single line

@PressJump
Copy link

As a general hint, fields are global and shared among the entry types. That explains part of the issue and is by design. However, at least the reset should work and the toggle between multiline and single line

Thanks for this, it makes sense that the entry types are global among entry types but I do see that it does not reset/toggle between multi-line and single line.

@PressJump
Copy link

After looking into the issue, I see that the current implementation for multiline fields are saved and used globally shared among entry types like the implementation of required fields causing the original bug where one of the entry types having a field checked will toggle all other multiline options of its field in other entry types. This will require the modification of NonWrappableFields implementation in FieldPreferences with accommodation for per entry type field options making it possible to apply the multiline option per entry type rather than globally as per the issue description. This modification will require changes across multiple files as the NonWrappableFields getter is used 30 times in the codebase.

I will further look into this tomorrow and put together a draft pull request for testing.

@HoussemNasri
Copy link
Member

Refs #11951

@HoussemNasri HoussemNasri changed the title Unable to remove multiline property from field Entry types preferences: Unable to remove multiline property from field Oct 14, 2024
@PressJump
Copy link

PressJump commented Oct 20, 2024

As a general hint, fields are global and shared among the entry types. That explains part of the issue and is by design. However, at least the reset should work and the toggle between multiline and single line

Hey @Siedlerchr, it seems like I was quite confused on the issue as I was working on a solution reflected by my comment #11897 (comment) which was proposing a major change that would modify FieldPreferences but I believe I am on the right track now.

I believe the pull request #12040 is a potential solution to the original issue with a non invasive fix to the problem. I would appreciate your feedback to confirm that I am on the right path to move forward on fixing the reset to default functionality.

I've marked the pull request as a draft for now because it doesn't yet address the issue around the reset button. I’m a rather a bit confused on the expected behavior for the reset button and what was originally wrong with it could you clarify this part for me?

@koppor
Copy link
Member

koppor commented Oct 20, 2024

Related issue: #9840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor FirstTimeCodeContribution Triggers GitHub Greeter Workflow
Projects
Status: Normal priority
4 participants