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

Error when viewing a PDF issue galley #5762

Closed
asmecher opened this issue Apr 20, 2020 · 12 comments
Closed

Error when viewing a PDF issue galley #5762

asmecher opened this issue Apr 20, 2020 · 12 comments
Assignees
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.

Comments

@asmecher
Copy link
Member

From https://forum.pkp.sfu.ca/t/3-2-0-2-php-fatal-errors-citations-style-language-and-getlocalizedfulltitle-on-null/59946:

PHP Fatal error: Uncaught Error: Call to a member function getLocalizedFullTitle() on null in /home/seisense/journal.seisense.com/cache/t_compile/011e5a5c6ec6ee79d574ba236ee5fce1afabbea9^504348cc7222e1110a6019067f9a002726c02324_0.plugins-plugins-generic-pdfJsViewer-generic-pdfJsViewer.display.tpl.php:94
Stack trace:
#0 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5e9b3c0dda73d0_86846590(Object(Smarty_Internal_Template))
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smar in /home/seisense/journal.seisense.com/cache/t_compile/011e5a5c6ec6ee79d574ba236ee5fce1afabbea9^504348cc7222e1110a6019067f9a002726c02324_0.plugins-plugins-generic-pdfJsViewer-generic-pdfJsViewer.display.tpl.php on line 94

@asmecher
Copy link
Member Author

(This issue is caused by the assumption that the PDF view has a $publication object, which isn't the case for issue galleys. See #5190.)

@asmecher
Copy link
Member Author

asmecher commented Apr 21, 2020

Users who are encountering this and are waiting for a fix can work around it in the meantime by reversing this change: pkp/ojs@3f04c60 [Edit: That's the wrong commit link; see the next comment for the right one.]

@NateWr
Copy link
Member

NateWr commented Apr 21, 2020

That commit deals with HTML galleys and I don't think issues support HTML galleys. I think the commit you want to reverse is in pdfJsViewer: pkp/pdfJsViewer@96f3ead.

@thinkbulecount2 I think there are two places in the pdfJsViewer display.tpl template: where it uses $galleyPublication->getData('datePublished') and where it uses $publication->getLocalizedFullTitle().

I think you'll need to look at the issueGalley.tpl and submissionGalley.tpl files to see how they pass in variables to display.tpl. Then pass in those required variables (parent published date and parent title).

@NateWr NateWr added the Bug:1:Low A bug that does not have a severe consequence or affects a small number of users. label Apr 21, 2020
@thinkbulecount2
Copy link
Contributor

PR here, let me know if this is what you meant, @NateWr!

pkp/pdfJsViewer#53

@NateWr
Copy link
Member

NateWr commented Apr 23, 2020

Yeah, you've got it. Except that in issueGalley.tpl there is no $publication, so you need to use $issue->getIssueIdentification() for the title instead.

Also, look for where $galleyPublication->getData('datePublished') is used. That also needs to be passed in from the submission/issue template.

@thinkbulecount2
Copy link
Contributor

@NateWr: Do you mind taking a second look? Made the changes based on your comments. Thanks!!!

NateWr added a commit to pkp/pdfJsViewer that referenced this issue Apr 27, 2020
@NateWr
Copy link
Member

NateWr commented Apr 27, 2020

👍 Merged! @asmecher what should we do about stable/master for pdfJsViewer. Right now this fix has been merged into master. There is no stable-3_1_2 for this plugin. Do I need to do something to make sure that 3.2.0-3 goes out with this master branch, or port the commit to a stable branch?

@asmecher
Copy link
Member Author

Thanks, @NateWr! There is a stable-3_1_2 branch -- I take it you meant stable-3_2_0? I haven't created stable-3_2_0 branches yet for many of the repos because the master branch is still compatible (and likely to remain so through the 3.2.1 release, I expect). I'm OK to update the submodule (where necessary) and stick with the master branch in cases like this.

@NateWr
Copy link
Member

NateWr commented Apr 28, 2020

Great! In that case I think this can be closed.

@NateWr NateWr closed this as completed Apr 28, 2020
@yoruyenturk
Copy link

Hi @NateWr

I still getting error when Full issue PDF view. You can see the error log below in image.

image

NateWr added a commit to pkp/pdfJsViewer that referenced this issue Apr 29, 2020
@NateWr
Copy link
Member

NateWr commented Apr 29, 2020

@yoruyenturk woops! thanks the heads up. Fixed in pkp/pdfJsViewer@c805be2

@yoruyenturk
Copy link

@NateWr thanks. Worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.
Projects
None yet
Development

No branches or pull requests

4 participants