Skip to content

truncate annotation page label instead of error#145

Open
abaevbog wants to merge 1 commit into
zotero:masterfrom
abaevbog:truncate_annotation_page
Open

truncate annotation page label instead of error#145
abaevbog wants to merge 1 commit into
zotero:masterfrom
abaevbog:truncate_annotation_page

Conversation

@abaevbog
Copy link
Copy Markdown
Contributor

Addresses #131
Truncates annotationPageLabel to be at most maxAnnotationPageLabelLength so the error is not thrown if annotation page label is too long.

@abaevbog abaevbog requested a review from dstillman June 13, 2023 16:11
@abaevbog abaevbog linked an issue Jun 13, 2023 that may be closed by this pull request
Comment thread model/Items.inc.php Outdated
case 'annotationPosition':
$item->$key = $val;
break;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep newline after break;

Comment thread model/Items.inc.php

case 'annotationPageLabel':
$item->$key = substr($val, 0, Zotero_Items::$maxAnnotationPageLabelLength);
break;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline after break;

Truncates annotationPageLabel to be at most maxAnnotationPageLabelLength so the error is not thrown if annotation page label is too long.
Fixes: zotero#131
@abaevbog abaevbog force-pushed the truncate_annotation_page branch from 1eff78a to f342705 Compare June 14, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Automatically truncate annotation page label

2 participants