[phpldapadmin] [ phpldapadmin-Bugs-3003777 ] Multivalue attributes with hundred of values hangs on modify

"SourceForge.net" <[email protected]> Wed, 19 May 2010 02:01:07 +0000
Newsgroups gmane.comp.ldap.davedap
Message-ID <[email protected]>
Bugs item #3003777, was opened at 2010-05-18 21:31
Message generated for change (Tracker Item Submitted) made by olafrv
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=3003777&group_id=61828

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 1.2.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Olaf Reitmaier Veracierta (olafrv)
Assigned to: Nobody/Anonymous (nobody)
Summary: Multivalue attributes with hundred of values hangs on modify

Initial Comment:
Good afternoon,

I have migrated to phpldapadmin 1.2.0.5 the lastest release and I have to say:

"When adding a new value (memberUid) to a posixGroup with the Default template the page to confirm the modification (htdocs/update_confirm.php) hangs up taking up to 30 minutes to draw the page.

Working on code I discover there are many IFs comparison on Old and New values printing FORs in that file, those IFs are used to highlight the new or modified values with red color.

After comments those IFs the page draw all the values (about 1000) in only 5 seconds.

HERE IS THE NEW CODE ON htdocs/update_confirm.php:

(CHANGES COMMENTED WITH SLOOOW):

                # Show OLD Values
                echo '<td><span style="white-space: nowrap;">';

                if (! $attribute->getOldValues())
                        printf('<span style="color: green">[%s]</span>',_('attribute doesnt exist'));

                foreach ($attribute->getOldValues() as $key => $value) {
                        # For multiple values, we'll highlight the changed ones
                        # SLOOOW: if ((count($attribute->getOldValues()) > 5) && in_array($value,$attribute->getRemovedValues()) && count($attribute-$
                        # SLOOOW:      echo '<span style="color:#880000; background:#FFFFA0">';

                        $request['page']->draw('OldValue',$attribute,$key);

                        # For multiple values, close the highlighting
                        # SLOOOW:if ((count($attribute->getOldValues()) > 5) && in_array($value,$attribute->getRemovedValues()) && count($attribute-$
                        # SLOOOW:      echo '</span>';

                        echo '<br />';
                }

                # Show NEW Values
                echo '<td><span style="white-space: nowrap;">';

                if (! $attribute->getValueCount() || $attribute->isForceDelete())
                        printf('<span style="color: red">[%s]</span>',_('attribute deleted'));

                foreach ($attribute->getValues() as $key => $value) {
                        # For multiple values, we'll highlight the changed ones
                        # SLOOOW: if ((count($attribute->getValues()) > 5) && in_array($value,$attribute->getAddedValues()))
                        # SLOOOW:      echo '<span style="color:#004400; background:#FFFFA0">';

                        $request['page']->draw('CurrentValue',$attribute,$key);

                        # For multiple values, close the highlighting
                        # SLOOOW: if ((count($attribute->getValues()) > 5) && in_array($value,$attribute->getAddedValues()))
                        # SLOOOW:      echo '</span>';

                        echo '<br />';
                }

                echo '</span></td>';

Let me know if you resolve this with a path on newer versions.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=3003777&group_id=61828

------------------------------------------------------------------------------

______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/