Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I always get errors using PHP7:
mod_fcgid: stderr: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PARSEENTRIES has a deprecated constructor in /var/www/.../sites/all/modules/biblio/modules/bibtexParse/PARSEENTRIES.php on line 134
This is PHP4 code. You should rename that contstructor to ensure PHP7 compatibility.
The patch was created against to the current 7.x-1.0-dev.
Comment | File | Size | Author |
---|---|---|---|
#30 | biblio-fix-missing-variable-name-2806971-0.patch | 571 bytes | vtamas |
| |||
#20 | interdiff-2806971-16-19.diff.txt | 2.07 KB | emerham |
#19 | biblio-fix_php7_issues-2806971-19.patch | 6.9 KB | emerham |
Comments
Comment #2
nerdoc CreditAttribution: nerdoc as a volunteer commentedComment #3
AndyHeath CreditAttribution: AndyHeath commentedI've used Biblio on D7 as an essential part of my site which runs on ubuntu 14.04 for probably 5 or 6 years. The current Biblio PHP 7 incompatibilities are preventing upgrading to ubuntu 16.04 because that comes with PHP 7 baked in and running an earlier PHP would be very messy.
The results from Biblio are demonstrably wrong on PHP 7 but fine on PHP 5. On PHP 7 each listing of a paper is truncated. For example this is running on PHP 5 on Ubuntu 14.04
http://axelafa.com/content/access-all-elearning
whereas this is an image of the same part of the same site running on a local "mirror" of the site with PHP 7 on Ubuntu 16.04.1
https://s13.postimg.org/o45gxdfs7/Access_For_all_to_e_Learning_Axelrod_A...
The same truncation is the case for every paper.
This is the error I am getting in the log
Type php
Date Saturday, November 12, 2016 - 17:09
User andy
Location http://localhost/content/access-all-elearning
Referrer http://localhost/biblio
Message Notice: Array to string conversion in theme_biblio_tabular() (line 244 of /var/www/drupal/sites/all/modules/biblio/includes/biblio_theme.inc).
Severity notice
Hostname 127.0.0.1
I have admittedly installed the dev version of biblio in case it should solve these issues. I had the truncation of the biblio records before I did that but I don't know whether the error was the same.
Any thoughts about fixing PHP 7 compatibility soon and what kind of timescale that might be on ?
Tempted to try and fix it myself but would prefer to stick with the standard releases than hack the code too much.
Thanks
andy - my apologies if I posted this in the wrong place
Comment #4
OlafskiGot the same PHP 7 related "deprecated" message as in the issue summary on my site. Consequently the Biblio nodes on the site are truncated, as described in comment #3.
@AndyHeath: Are you considering to provide a patch? I guess, I'm not able to do so but would be happy to test a patch! Btw, in my opinion, the "Array to string conversion" message is another issue. I get it (actually a lot of them) on a site with PHP 5.5.14 as well, but on that site the Biblio nodes are not truncated.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedThis sure looks like a php 7 issue. I Checked after I read this: my sites running php7 are all truncated; my main site that's still on 5.5 is displaying just fine.
This really makes biblio useless. Any hopes for a fix before we look to another method for publications?
Comment #6
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedHere's a patch, that fixes the __construct() trouble with the parsing classes and fixes the Array to String conversion in
theme_biblio_tabular
that was resulted by the new variable evaluation in PHP7.Comment #7
Alan D. CreditAttribution: Alan D. commentedThanks, works a treat :)
Bumping to major since PHP 7 really is the default now on new systems, quickly clogs the logs and such a trivial patch to review.
Comment #8
OlafskiThanks for the patch! I applied it on a test site, and the Biblio nodes are not truncated anymore. Would be happy if the patch could be committed.
Comment #9
kpaxman CreditAttribution: kpaxman at University of Waterloo commentedComment #10
pbattino CreditAttribution: pbattino commentedI ran a php7 compatibility checker on the version I'm using ( 7.x-1.0-rc7+31-dev ) and I got the same result, PLUS one critical error in modules/rtf/rtf_export.inc :
oldClassConstructors
` function rtf() {`
(around line 28)
Comment #11
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedComment #12
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedI updated the patch to include also the PHP 7 issue in #10.
Comment #13
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedComment #14
Alan D. CreditAttribution: Alan D. commentedHit all? Seemed like the case upset the automated tools.
And probably better just to delete constructors altogether if the class doesn't extend anything?
Comment #15
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedOh you're right, there are even more classes. I also would vote for removing the constructors, that are not doing anything. I can extend my previous patch.
Comment #16
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedAnother shot based on Alan's suggestions.
Comment #17
Alan D. CreditAttribution: Alan D. commentedNice. :)
Comment #18
emerham CreditAttribution: emerham commentedThere are still split functions in the bibtexParse module
and
php7cc still fails testing as split is no longer there, need to update to preg_split.
Comment #19
emerham CreditAttribution: emerham commentedI've updated the patch with split->preg_split.
Comment #20
emerham CreditAttribution: emerham commentedok, made the interdiff wrong, updated with proper interdiff
Comment #21
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedThanks for the heads-up @emerham. I haven't seen them. The patch is working fine.
Comment #22
mboesi CreditAttribution: mboesi commentedHi, I have applied the patch and most of the errors are gone. However, when adding a new entry via bibtext I get following error message:
Notice: Undefined property: stdClass::$biblio_type_of_work in _biblio_bibtex_import() (line 263 of /var/www/XXXX/sites/all/modules/biblio/modules/bibtexParse/biblio_bibtex.module).
Did anyone of you experience the same problem? OR does anyone know how to fix this issue?
Thanks in advance!
Comment #23
Alan D. CreditAttribution: Alan D. commented@mboesi
This is likely to be completely unrelated to this issue and it is best not to ask about new issues in unrelated threads.
Best to search the open issues and #2114935: Undefined property: biblio_type_of_work in _biblio_bibtex_import() appears to be what you are reporting here, the exact same error!
Comment #24
dev-null CreditAttribution: dev-null commentedThank you for this tremendous patch that helps a lot !!
Just a remaining problem that may have been unnoticed :
The patch is perfectly working for raw references imported from given scientific reviews (check on my test website here http://espacepro.sfa.asso.fr/node/25). However, if I edit the reference to add a full text, the warning is appearing again. (check here http://espacepro.sfa.asso.fr/node/26).
Probably something still missing in biblio_theme.inc . Seems the issue has been fixed elsewhere. As I'm not at all a php wizard, I prefer to flag the issue for specialists. Any clue may help.
Thank you.
Comment #25
dev-null CreditAttribution: dev-null commentedHumm... further to my previous message, I confirm that patch 1760736 complete to fix the issue.
Thanks.
Comment #27
Liam MorlandComment #28
OlafskiIIRC the fix didn't make it in 7.x-1.0-rc8 but in the Dev version. Is there a special reason why not in the rc8 version?
Comment #29
Liam MorlandI wanted to make rc8 be exactly the state of development as it has been since April, 2016. I intend to fix the security issues then release rc9. You can run this fix by running the latest dev version.
Comment #30
vtamas CreditAttribution: vtamas commentedA variable wasn't renamed properly in theme_biblio_tabular(). Attaching a patch with a fix.
Comment #31
Liam Morland@#30 I appreciate the fix, but that is part of #2846926: Fix new window links using 'biblio_links_target_new_window'.
Comment #32
Liam Morland