CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#5058] Global Content Blocks - User set as 'Editor' only getting 1 result on page 1

avatar
Created By: Nik (NikNak)
Date Submitted: Thu Jun 10 08:00:01 -0400 2010

Assigned To:
Version: 1.7.1
CMSMS Version: None
Severity: Minor
Resolution: Awaiting Response
State: Closed
Summary:
Global Content Blocks - User set as 'Editor' only getting 1 result on page 1
Detailed Description:
Hi

I have assigned access to a few GCBs for my site editors. However, when going to
the GCB area in the backend, only the first item is on page 1, and the
subsequent entries are on page 2.

Thanks

Nik


History

Comments
avatar
Date: 2010-06-10 09:43
Posted By: Rolf (rolf1)

HI Nik

I created three GCBs in a 1.7.1 site and added them to an additional editor.
When I login as this editor, all three GCB are shown on the first page...
Even as an edmin, they are all there

Can you give us some more info on this, how to reproduce it?

Regards, Rolf
      
avatar
Date: 2010-06-10 11:51
Posted By: Nik (NikNak)

Hmmm

I just tried on another site using 1.7.1 and no probs. I'll do more
investigating. I'll keep you posted if I source the problem.

Kind regards

Nik
      
avatar
Date: 2010-09-15 05:21
Posted By: atz (atz6975)

Problem is with listhtmlblobs.php in admin.
It doesn't count blobs(global contents) for which we have access rights but ALL
blobs.

Same bug in 1.8.2

Fix is simple where do I post it?
      
avatar
Date: 2010-09-15 05:49
Posted By: atz (atz6975)

see here : http://forum.cmsmadesimple.org/index.php/topic,47366.0.html
      
avatar
Date: 2010-09-15 12:43
Posted By: atz (atz6975)

Patch

Index: admin/listhtmlblobs.php
===================================================================
--- admin/listhtmlblobs.php	(revision 6615)
+++ admin/listhtmlblobs.php	(working copy)
@@ -45,14 +45,29 @@
 	$modifyall = check_permission($userid, 'Modify Global Content Blocks');
 	$htmlbloblist = $gcbops->LoadHtmlBlobs();
 	$myblobs = $gcbops->AuthorBlobs($userid);
+// FIX 5058 
+	if ($modifyall){
+		$count_blobs=count($htmlbloblist);
+	}
+	else {
+		$count_blobs = count($myblobs);
+	}
+// FIX END
 
 	$page = 1;
 	if (isset($_GET['page'])) $page = $_GET['page'];
         $limit = get_preference($userid,'listgcbs_pagelimit',20);
-	echo "<p class=\"pageshowrows\">".pagination($page, count($htmlbloblist),
$limit)."</p>";
+// FIX 5058
+// OLD:	echo "<p class=\"pageshowrows\">".pagination($page,
count($htmlbloblist), $limit)."</p>";
+	echo "<p class=\"pageshowrows\">".pagination($page, $count_blobs,
$limit)."</p>";
+// FIX END
 	echo $themeObject->ShowHeader('htmlblobs').'</div>';
 
-	if ($htmlbloblist && count($htmlbloblist) > 0) {
+// FIX 5058
+// OLD:		if ($htmlbloblist && count($htmlbloblist) > 0) {
+	if ($htmlbloblist && $count_blobs > 0) {
+// FIX END
+
 		echo "<table cellspacing=\"0\" class=\"pagetable\">\n";
 		echo '<thead>';
 		echo "<tr>\n";
@@ -72,7 +87,7 @@
 		$counter = 0;
 		foreach ($htmlbloblist as $onehtmlblob){
 			if ($counter < $page*$limit && $counter >= ($page*$limit)-$limit) {
-            if ($modifyall ||  quick_check_authorship($onehtmlblob->id,
$myblobs))
+			if ($modifyall ||  quick_check_authorship($onehtmlblob->id, $myblobs))
 				{
echo "<tr class=\"$currow\"
onmouseover=\"this.className='".$currow.'hover'."';\"
onmouseout=\"this.className='".$currow."';\">\n";
echo "<td><a
href=\"edithtmlblob.php".$urlext."&amp;htmlblob_id=".$onehtmlblob->id."\">".$onehtmlblob->name."</a></td>\n";
@@ -92,7 +107,10 @@
 				($currow=="row1"?$currow="row2":$currow="row1");
 				}
 			}
-			$counter++;
+		// FIX 5058
+		// OLD:		$counter++;
+		if (quick_check_authorship($onehtmlblob->id, $myblobs) || $modifyall)
{$counter++;}
+		// FIX END
 		}
 
 		echo '</tbody>';
@@ -123,4 +141,4 @@
 include_once("footer.php");
 
 # vim:ts=4 sw=4 noet
-?>
+?>
\ No newline at end of file

      
avatar
Date: 2010-12-11 15:30
Posted By: Ronny Krijt (ronnyk)

reason of closure: long period of inactivity at status 'Awaiting Response'
      
Updates

Updated: 2010-12-11 15:30
state: Open => Closed

Updated: 2010-06-10 09:43
resolution_id: => 10