Jump to content



Latest News: (loading..)

Issue Information

  • #000370

  • 0 - None Assigned

  • New

  • 2.3.1

  • -

Issue Confirmations

  • Yes (0)No (1)
Photo

box, header tags modules sort order bugfix need

Posted by Gergely on 27 September 2011 - 02:13 PM

Hi,

when use not displayed module (box or header tags) with the same sort order number as another displayed one, the module (box or header tags) displaying missing in sort orders. The reason found in admin/modules.php


		if (($module->sort_order > 0) && !isset($installed_modules[$module->sort_order])) {
		  $installed_modules[$module->sort_order] = $file;
		} else {
		  $installed_modules[] = $file; //bugfix need here to prevent duplicated place
		}


The sort order saved in configuration table MODULE_BOXES_INSTALLED or MODULE_HEADER_TAGS_INSTALLED field as key. The $installed_modules array contains the sort order when edit administrator modules boxes or header tags to save.


Array
(
	[0] => bm_adds.php
	[1000] => bm_banner.php
	[1010] => bm_product_sizes.php
	[1020] => bm_manufacturers.php
	[1030] => bm_search.php
	[1040] => bm_whats_new.php
	[1050] => bm_information.php
	[5000] => bm_shopping_cart.php
	[5001] => bm_suggested_accessories.php
	[5010] => bm_manufacturer_info.php
	[5020] => bm_order_history.php
	[5030] => bm_best_sellers.php
	[5031] => bm_categories.php
	[5040] => bm_product_notifications.php
	[5050] => bm_product_social_bookmarks.php
	[5060] => bm_specials.php
	[5070] => bm_reviews.php
	[5080] => bm_languages.php
	[5090] => bm_currencies.php
)


How can you do sort definitely?

Suggest to change $key and $value in $installed_modules array.


Regards,
Gergely

admin/modules.php


Change:

  $installed_modules = array();

To:
  $installed_modules = array();
  $installed_new_modules = array();


Change:
		if (($module->sort_order > 0) && !isset($installed_modules[$module->sort_order])) {
		  $installed_new_modules[$module->sort_order] = $file;
		} else {
		  $installed_new_modules[] = $file;
		}


To:
		if (($module->sort_order > 0) && !isset($installed_new_modules[$module->sort_order])) {
		  $installed_new_modules[$file] = $module->sort_order;
		} else {
		  $installed_new_modules[$file] = 0;
		}



Change:
	ksort($installed_modules);

To:
	asort($installed_new_modules);
	foreach ($installed_new_modules as $key => $value) {
	  $installed_modules[] = $key;
	}


Modules Sort Order would be appreciated in admin list too. [img]http://forums.oscommerce.com//public/style_emoticons/default/sick.gif[/img]  In future...


Regadrs,
Gergely

Sorry for bad code I cant edit my post

Change:
			if (($module->sort_order > 0) && !isset($installed_modules[$module->sort_order])) {
				  $installed_modules[$module->sort_order] = $file;
			} else {
				  $installed_modules[] = $file;
			}