Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php 7 issue
06-14-2019, 01:14 AM
Post: #1
php 7 issue
I have switched fro php version 5.5.38 to 7.1.27 on a IIS 7 and the only issue I can see is that when I go to the main menu I cannot see the Maintenance column on any of the tabs. I looked at the MainMenuLinksArray.php and cannot any issues there so I think it is to do with the index.php security any help would be appreciated.
Thanks
Dave
Find all posts by this user
Quote this message in a reply
06-14-2019, 01:25 AM
Post: #2
RE: php 7 issue
Hmmm, this seems strange. I have been running PHP 7 for a long time now.

Have you tried changing the theme, in case it is a css problem?

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
06-14-2019, 01:29 AM
Post: #3
RE: php 7 issue
(06-14-2019 01:25 AM)falkoner Wrote:  Hmmm, this seems strange. I have been running PHP 7 for a long time now.

Have you tried changing the theme, in case it is a css problem?

Tim

Yes I have tried different theme.
Find all posts by this user
Quote this message in a reply
06-14-2019, 02:37 AM
Post: #4
RE: php 7 issue
(06-14-2019 01:25 AM)falkoner Wrote:  Hmmm, this seems strange. I have been running PHP 7 for a long time now.

Have you tried changing the theme, in case it is a css problem?

Tim

Here is the error
Fatal error: Uncaught Error: [] operator not supported for strings in C:\inetpub\weberp\index.php:196 Stack trace: #0 C:\inetpub\weberp\index.php(141): GetRptLinks('gl') #1 {main} thrown in C:\inetpub\weberp\index.php on line 196
Here is that line
while ($Temp = DB_fetch_array($Result)) $ReportList[] = $Temp;

I am looking into the php.ini to see if there something there.
Find all posts by this user
Quote this message in a reply
06-14-2019, 03:01 AM
Post: #5
RE: php 7 issue
Ah yes, I do remember this now. Try changing that whole section to:

PHP Code:
    if (!isset($_SESSION['ReportList'])) {
        
$SQL "SELECT id,
                        reporttype,
                        defaultreport,
                        groupname,
                        reportname
                    FROM reports
                    ORDER BY groupname,
                            reportname"
;
        
$Result DB_query($SQL''''falsetrue);
        
$_SESSION['ReportList'] = array();
        while (
$Temp DB_fetch_array($Result)) {
            
$_SESSION['ReportList'][] = $Temp;
        }
    }
    
$RptLinks '';
    for (
$Def 1;$Def >= 0;$Def--) {
        
$RptLinks.= '<li class="menu_group_headers">';
        
$RptLinks.= '<b>' $Title[$Def] . '</b>';
        
$RptLinks.= '</li>';
        
$NoEntries true;
        if (isset(
$_SESSION['ReportList']['groupname']) and count($_SESSION['ReportList']['groupname']) > 0) { // then there are reports to show, show by grouping
            
foreach ($_SESSION['ReportList'] as $Report) {
                if (isset(
$Report['groupname']) and $Report['groupname'] == $GroupID and $Report['defaultreport'] == $Def) {
                    
$RptLinks.= '<li class="menu_group_item">';
                    
$RptLinks.= '<p><a href="' $RootPath '/reportwriter/ReportMaker.php?action=go&amp;reportid=' urlencode($Report['id']) . '">&bull; ' _($Report['reportname']) . '</a></p>';
                    
$RptLinks.= '</li>';
                    
$NoEntries false;
                }
            }
            
// now fetch the form groups that are a part of this group (List after reports)
            
$NoForms true;
            foreach (
$_SESSION['ReportList'] as $Report) {
                
$Group explode(':'$Report['groupname']); // break into main group and form group array
                
if ($NoForms and $Group[0] == $GroupID and $Report['reporttype'] == 'frm' and $Report['defaultreport'] == $Def) {
                    
$RptLinks.= '<li class="menu_group_item">';
                    
$RptLinks.= '<img src="' $RootPath '/css/' $_SESSION['Theme'] . '/images/folders.gif" width="16" height="13" alt="" />&nbsp;';
                    
$RptLinks.= '<a href="' $RootPath '/reportwriter/FormMaker.php?id=' urlencode($Report['groupname']) . '">&bull; ';
                    
$RptLinks.= $_SESSION['FormGroups'][$Report['groupname']] . '</a>';
                    
$RptLinks.= '</li>';
                    
$NoForms false;
                    
$NoEntries false;
                }
            }
        }
        if (
$NoEntries$RptLinks.= '<li class="menu_group_item">' _('There are no reports to show!') . '</li>';
    } 
Visit this user's website Find all posts by this user
Quote this message in a reply
06-14-2019, 04:09 AM
Post: #6
RE: php 7 issue
(06-14-2019 03:01 AM)falkoner Wrote:  Ah yes, I do remember this now. Try changing that whole section to:

PHP Code:
    if (!isset($_SESSION['ReportList'])) {
        
$SQL "SELECT id,
                        reporttype,
                        defaultreport,
                        groupname,
                        reportname
                    FROM reports
                    ORDER BY groupname,
                            reportname"
;
        
$Result DB_query($SQL''''falsetrue);
        
$_SESSION['ReportList'] = array();
        while (
$Temp DB_fetch_array($Result)) {
            
$_SESSION['ReportList'][] = $Temp;
        }
    }
    
$RptLinks '';
    for (
$Def 1;$Def >= 0;$Def--) {
        
$RptLinks.= '<li class="menu_group_headers">';
        
$RptLinks.= '<b>' $Title[$Def] . '</b>';
        
$RptLinks.= '</li>';
        
$NoEntries true;
        if (isset(
$_SESSION['ReportList']['groupname']) and count($_SESSION['ReportList']['groupname']) > 0) { // then there are reports to show, show by grouping
            
foreach ($_SESSION['ReportList'] as $Report) {
                if (isset(
$Report['groupname']) and $Report['groupname'] == $GroupID and $Report['defaultreport'] == $Def) {
                    
$RptLinks.= '<li class="menu_group_item">';
                    
$RptLinks.= '<p><a href="' $RootPath '/reportwriter/ReportMaker.php?action=go&amp;reportid=' urlencode($Report['id']) . '">&bull; ' _($Report['reportname']) . '</a></p>';
                    
$RptLinks.= '</li>';
                    
$NoEntries false;
                }
            }
            
// now fetch the form groups that are a part of this group (List after reports)
            
$NoForms true;
            foreach (
$_SESSION['ReportList'] as $Report) {
                
$Group explode(':'$Report['groupname']); // break into main group and form group array
                
if ($NoForms and $Group[0] == $GroupID and $Report['reporttype'] == 'frm' and $Report['defaultreport'] == $Def) {
                    
$RptLinks.= '<li class="menu_group_item">';
                    
$RptLinks.= '<img src="' $RootPath '/css/' $_SESSION['Theme'] . '/images/folders.gif" width="16" height="13" alt="" />&nbsp;';
                    
$RptLinks.= '<a href="' $RootPath '/reportwriter/FormMaker.php?id=' urlencode($Report['groupname']) . '">&bull; ';
                    
$RptLinks.= $_SESSION['FormGroups'][$Report['groupname']] . '</a>';
                    
$RptLinks.= '</li>';
                    
$NoForms false;
                    
$NoEntries false;
                }
            }
        }
        if (
$NoEntries$RptLinks.= '<li class="menu_group_item">' _('There are no reports to show!') . '</li>';
    } 
That did the trick
Thanks for all the help
Find all posts by this user
Quote this message in a reply
06-14-2019, 04:29 AM
Post: #7
RE: php 7 issue
Glad to help Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
06-14-2019, 04:41 AM
Post: #8
RE: php 7 issue
Hi Tim.
Is this an issue only with IIS 7?
I am running XAMPP with PHP 7.1.27 with no problems running the default index.php.
Find all posts by this user
Quote this message in a reply
06-14-2019, 07:04 AM
Post: #9
RE: php 7 issue
Paul: I have committed this fix and sent a pull request to the release branch.

Alan: I would need to check back on my notes tomorrow for the full details. It is a PHP setting that can cause this error to happen, when Dave gave the error message it reminded me that I had seen this before. Basically the lack of this setting is masking the fact that we were not properly checking the data returned from the database, so you (and I) were not seeing the same effect.

The fix should work in all circumstances.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
06-15-2019, 01:10 PM
Post: #10
RE: php 7 issue
Thanks, Tim. Merged!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)