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

[BUG] "Required" FieldFlag prints as "ReadOnly" #494

Closed
zacharysyoung opened this issue May 23, 2022 · 2 comments
Closed

[BUG] "Required" FieldFlag prints as "ReadOnly" #494

zacharysyoung opened this issue May 23, 2022 · 2 comments

Comments

@zacharysyoung
Copy link

zacharysyoung commented May 23, 2022

Description

The String() method on FieldFlag has the word "ReadOnly" duplicated in its output, and it's missing the text "Required".

Consider running the following code in the UniDoc playground:

package main

import (
	"fmt"

	"github.com/unidoc/unipdf/v3/model"
)

func main() {
	var fflags model.FieldFlag
	fflags = fflags.Set(model.FieldFlagReadOnly)
	fflags = fflags.Set(model.FieldFlagRequired)
	fmt.Printf(" Flags: %s (%d)\n", fflags, fflags)
}

Expected Behavior

Flags: ReadOnly|Required (3)

Actual Behavior

Flags: ReadOnly|ReadOnly (3)

In the obfuscated code, I can see that the unicode-literal "ReadOnly" ("\u007cR\u0065\u0061\u0064\u004f\u006e\u006cy") is appended twice:

if _cafgf &FieldFlagReadOnly > 0{_edda +="\u007cR\u0065\u0061\u0064\u004f\u006e\u006cy";};if _cafgf &FieldFlagRequired > 0{_edda +="\u007cR\u0065\u0061\u0064\u004f\u006e\u006cy";
@github-actions
Copy link

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

@sampila
Copy link
Collaborator

sampila commented Jun 7, 2022

Hi @zacharysyoung,

Thank you for reporting this issue, we made a release to fix this issue.
v3.35.0 https://github.com/unidoc/unipdf-src/releases/tag/v3.35.0

@sampila sampila closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants