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

Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /usr/local/www/freshports/classes/port-display.php on line 941 #450

Closed
grahamperrin opened this issue Jul 30, 2023 · 3 comments
Assignees
Labels

Comments

@grahamperrin
Copy link
Contributor

Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /usr/local/www/freshports/classes/port-display.php on line 941

Appears:

@dlangille dlangille self-assigned this Jul 30, 2023
@dlangille dlangille added the bug label Jul 30, 2023
@dlangille
Copy link
Contributor

Confirmed present on dev. Then fixed with this patch. Tests fine on dev now.

[18:52 dev-nginx01 dan ~/www] % git diff classes/port-display.php
diff --git a/classes/port-display.php b/classes/port-display.php
index 13d18c6c..11d72143 100644
--- a/classes/port-display.php
+++ b/classes/port-display.php
@@ -938,7 +938,7 @@ class port_display {
                        $HTML .=  ' <span class="tooltip">';
                        if (empty($port->quarterly_revision)) {
                                $HTML .= 'Port not present on quarterly';
-                               if (date("Y-m-d", strtotime($port->date_added)) > FirstDateOfCurrentQuarter()) {
+                               if (IsSet($port->date_added) && date("Y-m-d", strtotime($port->date_added)) > FirstDateOfCurrentQuarter()) {
                                        $ToolTipText = 'This is expected as this port was created during this quarter.';
                                } else {
                                        $ToolTipText = 'This missing version is most likely a FreshPorts error.';

@grahamperrin
Copy link
Contributor Author

Thanks for the quick fix.

@dlangille
Copy link
Contributor

Now fixed on test, stage, and prod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants