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

"SourceForge.net" <[email protected]> Thu, 28 Apr 2011 14:20:12 +0000
Newsgroups gmane.comp.ldap.davedap
Message-ID <[email protected]>
Bugs item #3003777, was opened at 2010-05-19 12:01
Message generated for change (Comment added) made by wurley
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: Closed
>Resolution: Fixed
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.

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

>Comment By: Deon George (wurley)
Date: 2011-04-29 00:20

Message:
Thanks for the report - I've commit to git a patch that hopefully improves
this considerably.

See git commit #2ea1fc6

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

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

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/