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

Any hope for php 8? #74

Open
cptX opened this issue Dec 1, 2022 · 29 comments
Open

Any hope for php 8? #74

cptX opened this issue Dec 1, 2022 · 29 comments

Comments

@cptX
Copy link

cptX commented Dec 1, 2022

Is there any hope/plan for supporting php 8.*?

@mazzarito
Copy link

mazzarito commented Feb 9, 2023

I have it running on 8 I'll see if i can put a patch together. Much less work than the PHP 7 conversion was.

@cptX
Copy link
Author

cptX commented Feb 10, 2023

I'm using Pressflow and I'm stack some versions behind. I now checked the changelog and it seems that the initial attempt for php 8 has began. That's good news!

@dranii
Copy link

dranii commented Feb 11, 2023

Hello @mazzarito is it possible to make a zip of the version running in php 8 available for testing? It will be great help not just to me or hundreds but thousand of users. Many thanks.

@dranii
Copy link

dranii commented Feb 11, 2023

@cptX if possible can you kindly share the link of Pressflow/drupal that seems to work or may work with php8? Best regards.

@cptX
Copy link
Author

cptX commented Feb 16, 2023

@dranii I'm running it on php 7.4. Never tested it with php 8 although my server now is php 8 and I don't want to have dual versions of php running.
I tried to check the code with phan but I got 100.000 lines of errors so it's impossible to detect any php 8 incompatibilities with this tool. If anybode knows how to suppress messages like Undeclared functions, methods, etc... let me know, please!

@dranii
Copy link

dranii commented Feb 18, 2023

@cptX 2 separate instances of Drupal 6x can run from two separate "folders" mydomain/abc/drupal6x and mydomain/xyz/drupal6x - now by "defining" via htaccess we can run one in php7x and another in php8x, as you know well. I am not sure which version of php8 we should first try with a minimum of modules. I was looking at this page - please have a look too if it can give a pointer or any help - https://programmingflow.com/2021/09/19/upgrading-old-drupal-6.html https://docs.lando.dev/drupal/
Thanks and regards.

@cptX
Copy link
Author

cptX commented Feb 18, 2023

@dranii my server is ubuntu 22.04 and the long term stable version of php is 8.1.x
I suggest to focus compatibility with this version.

@dranii
Copy link

dranii commented Feb 18, 2023

@cptX That sounds good. I think I will be able to test with php 8.1x also. However I am not sure what should be a good starting point. I hope someone comes forward with a reasonable starting point. Thanks.

@neilt1700
Copy link

I have it running on 8 I'll see if i can put a patch together. Much less work than the PHP 7 conversion was.

Drupal 6 core seems to be running fine on my site without needing to change anything. However some contributed modules caused fatal errors. These were:

  • Using curly brackets for array elements (removed in PHP 8)
  • Passing a variable of the wrong type to internal functions - which used to assume a reasonable value, but now throws an exception

I will need to do more testing (with my 70+ contrib modules) before putting into production

@dranii
Copy link

dranii commented Apr 23, 2023

@neilt1700 Thanks a lot. Basically we are getting error messages only with d6lts and php8.
It may be that some additional extensions for php 8 or some settings to be adjusted ?? If possible, can the php info file and what hosting you are using for d6lts+php8x be shared here? What changes need to be done for Views and CCK ?

@neilt1700
Copy link

@dranii for CCK here on d6lts, I don't know - perhaps nothing? I am using CCK 6.x-3.0-alpha4 as this has a multi-group feature that never made it beyond alpha. I needed to do this fix (note it's already been fixed in the CCK repo here):

diff --git a/httpdocs/sites/all/modules/contrib/cck/content.module b/httpdocs/sites/all/modules/contrib/cck/content.module
index b682d48..8d3f801 100644
--- a/httpdocs/sites/all/modules/contrib/cck/content.module
+++ b/httpdocs/sites/all/modules/contrib/cck/content.module
@@ -1227,7 +1227,7 @@ function content_write_record($table, &$object, $update = array()) {
     }

     // Build arrays for the fields, placeholders, and values in our query.
-    if (isset($object->$field) || array_key_exists($field, $object)) {
+    if (isset($object->$field) || (is_array($object) && array_key_exists($field, $object))) {
       $fields[] = $field;
       if (isset($object->$field)) {
         $placeholders[] = db_type_placeholder($info['type']);

The one fix I've needed to do for views had already been done here - see: d6lts/views@e2f15e5 (So note to self - make sure I have indeed got the latest d6lts modules!)

@neilt1700
Copy link

Other modules that I use that needed fixing:

  • Better Formats (usage of curly braces for array elements) - not a d6lts repo
  • Faceted Search (usage of curly braces for array elements) - that is a d6lts repository - but hadn't been fixed
  • Image API (usage of curly braces for array elements) - is a d6lts repo - and fix had already been made

@neilt1700
Copy link

neilt1700 commented May 5, 2023

I have updated D6 core to make it function with PHP 8.1 (as on further checking there was a small amount of code in core which were causing fatal errors in PHP 8). I have made a pull request to bring the changes over to here: #78. You can get the code from here to try it out.

I've updated a number of other modules which I will submit shortly:

  • better_formats
  • faceted_search
  • imageapi
  • linkchecker
  • multistep
  • nodeformsettings
  • revision_moderation
  • rules
  • simplenews
  • smtp
  • taxonomy_super_select
  • user_delete
  • uuid
  • view_revisions_by_content_type
  • views
  • views_bulk_operations

@cptX
Copy link
Author

cptX commented May 6, 2023

Great job, thanks for your effort!

What tool are you using to detect the incompatibilities in the code?

@amorsent
Copy link
Contributor

amorsent commented May 6, 2023

FYI I have several open PHP 8 pull requests for contrib modules:

d6lts/elysia_cron#3
d6lts/features#2
d6lts/ubercart#6
d6lts/ubercart#7
d6lts/filefield#1
d6lts/filefield_paths#1
d6lts/filefield_paths#2
d6lts/ctools#4
d6lts/views_bulk_operations#2
d6lts/emfield#1

I have other changes for some contrib modules not listed on D6LTS.
Does anyone know if there is a process for including additional contrib modules here?

@dranii
Copy link

dranii commented May 6, 2023

@neilt1700 Millions of thanks. Now on the move, so yet to try!
Looking forward to php 8.2 (in future) and some modules like CCK (if not, already)
Many many thanks and gratitude goes to you from the entire community of drupal 6 users. Best regards.

@neilt1700
Copy link

Great job, thanks for your effort!

What tool are you using to detect the incompatibilities in the code?

  • I am using PHPStorm
  • Logging all errors to screen for testing
  • Reading Apache logs when fatal errors occur
  • It's all manual - only a small number of modules have SimpleTest tests, I don't have any tests for core, and in any case the SimpleTest module itself has errors

@neilt1700
Copy link

Just wondering if there are any current active members of the d6lts organisation?

@amorsent
Copy link
Contributor

Unfortunately I think D6LTS is finally EOL as of Feb 24, 2023 after many extensions.

https://drupalsun.com/elliot-christenson/2021/02/04/drupal-6-long-term-support-extended-2023-and-what-about-drupal-7

I have several pull requests since then and there has been no movement - I think it's dead. :(

@EugenMayer
Copy link

it rather 1 year prior year, there is no change since Feb 2022 - and this is clear for some time. This project seems to have been frozen since the initial contributors have no interest and no other is allowed to take over. Such a classic.

So if you really want to continue, there might be a need for a fork to consolidate the patches. Or maybe the contributors read this and allow some hand picked contributors which are still active to manage the repo / prs / issues

@TTT7275
Copy link

TTT7275 commented May 17, 2023

Actually, mydropwizard company owned by dsnopek who took care this d6lts project closed since Feb 25, 2022. You can read some more information here -> https://www.drupal.org/project/d6lts/issues/3259488 Actually, there was an announcement in mydropwizard too but since the company was closed, the website was gone too.

@neilt1700
Copy link

Or maybe the contributors read this and allow some hand picked contributors which are still active to manage the repo / prs / issues

@EugenMayer that would be ideal rather than forking it somewhere else. I have sent a message to @dsnopek via his website.

@mazzarito
Copy link

mazzarito commented May 18, 2023

I guess we'll give him a little bit to respond otherwise might have to just fork it if that's the only option. Can always just be consolidated back if he ever reappears.

@mazzarito
Copy link

mazzarito commented Nov 8, 2023

I went ahead and forked this ... I have a repo with a ton of contrib modules working on PHP 8 such as DBTNG which required a few PDO related changes. I'll try and release some of them as I can get to them.

@neilt1700
Copy link

@mazzarito - have you thought about creating a GitHub organization to contain all the repos for D6 core and modules. It's free for public code, and you can invite people to help administer it.

@mazzarito
Copy link

@neilt1700 I've created an org D6LTS-contrib I'll try and post as many of the modules I've implemented PHP 8 compatibility for as I can... I listed the ones I have currently but I've started w/ core and DBTNG. I'll try and add ubercart as well as some of the more important contrib modules later. Not all of them require changes however and I'll try to fork from this org where possible so I have to sort through that.

@neilt1700
Copy link

@mazzarito this is fantastic - thank you! I'm happy to help too - though have a lot on at the moment.

@mazzarito
Copy link

@neilt1700 FYI haven't had a ton of time to devote to this but I submitted another patch to the repo... I have it running under 8.2 and MariaDB 10.11 seems to work fine,

@cptX
Copy link
Author

cptX commented Nov 4, 2024

Thanks @mazzarito, your work will be very useful to me. I switched my server to php 8.3 and the only site remaining to 7.4 is my drupal 6.

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

7 participants