Closed (outdated)
Project:
Moon Phases
Version:
7.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Apr 2021 at 15:23 UTC
Updated:
20 Oct 2025 at 08:01 UTC
Jump to comment: Most recent
Entire message was "PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP. moon_phases has a deprecated constructor in /var/www/htdocs/drupal7/sites/all/modules/moon_phases/moon_phases.module on line 9." (reconstructed from memory so might not be exactly that.)
Line 9 is require_once to load lib/moon_phase.class and it is in that file that the actual problem lies.
Here's a patch:
jross@luna:/var/www/htdocs/drupal7/sites/all/modules/moon_phases $ diff -u3 lib/moon_phase.class.php.orig lib/moon_phase.class.php
--- lib/moon_phase.class.php.orig Fri Apr 9 08:58:14 2021
+++ lib/moon_phase.class.php Fri Apr 9 08:59:14 2021
@@ -49,7 +49,7 @@
* CONSTRUCTOR
* $timestamp (int) date of which to calculate a moon phase and relative phases for
*/
- function moonPhase( $timeStamp = -1 ) {
+ function __construct( $timeStamp = -1 ) {
$this->allMoonPhases = array(
MP_NEW_MOON_NAME,
Comments
Comment #2
astonvictor commentedD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.