[Solved] Admin can't see scheduled Item in Frontend

More
11 years 11 months ago - 11 years 11 months ago #31620 by gcprnet
I have (again :oops: ) a problem with previewing articles.
Articles that are approved and scheduled to be published in the future are not visible to administrators in the frontend (Admin logged in at frontend). This scheduled article is visible to its owner (again, when logged in at frondend) though.
So, in short, a scheduled article is visible only to its owner in frontend and not to other users, that have edit rights to this article.
Is there a setting that I missed to configure?
Currently running FLEXIcontent version 1.5.6 RC9b (r1576)
Last edit: 11 years 11 months ago by gcprnet.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #31629 by ggppdk
Code:
if (FLEXI_J16GE) { // Super user privelege, can edit all for sure $ignoreState = $user->authorise('core.admin', 'com_flexicontent'); } else if (FLEXI_ACCESS) { // Super admin, can edit all for sure $ignoreState = (int)$user->gid >= 25; } else { // author has 19 and editor has 20 $ignoreState = (int)$user->get('gid') > 19; }

Look carefully above
it is from file:
components/com_flexicontent/models/category.php
as you can see for FLEXI_ACCESS
you use:
gid >= 25;

which means super admin
if you change it to

gid >= 24;

it will include administrator too

The other alternative is to change code to check edit state for all items of current category, this could be a little slow for categories with many items

what do you think to do?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #31636 by gcprnet
I would take the first option but I was (again :oops: ) too imprecise. Superadmins can't see these articles too. In fact, the only users who actually can see these articles are their owners.
Sorry for the confusion...

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #31638 by ggppdk
aa yes, ignoreState is currently not used for publish_up/publish_down:

-- 1 --
putting these
Code:
$where .= ' AND ( ( i.publish_up = '.$this->_db->Quote($nullDate).' OR i.publish_up <= '.$this->_db->Quote($now).' ) OR i.created_by = '.$user->id.' )'; //.' OR ( i.modified_by = '.$user->id.' AND i.modified_by != 0 ) )'; $where .= ' AND ( ( i.publish_down = '.$this->_db->Quote($nullDate).' OR i.publish_down >= '.$this->_db->Quote($now).' ) OR i.created_by = '.$user->id.' )'; //.' OR ( i.modified_by = '.$user->id.' AND i.modified_by != 0 ) )';

inside a :
Code:
if (!$ignoreState) { ... }

-- 2 --
and changing:
Code:
} else if (FLEXI_ACCESS) { // Super admin, can edit all for sure $ignoreState = (int)$user->gid >= 25;
to
Code:
} else if (FLEXI_ACCESS) { // Super admin, can edit all for sure $ignoreState = (int)$user->gid >= 24;

the above will work,

maybe we could do something like this:
add a parameter where site administrators can select user groups for which the publication state and scheduled times will be ignored in frontend content Lists ????


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #31717 by gcprnet
A parameter with an option to show these articles to specific groups regardless of their (articles) state would be a good Idea.
Nevertheless I seem to have some trouble to apply the changes you described as the don't seem to have any effect on my site:
I changed $ignoreState to 24 for Flexiaccess:
Code:
} else if (FLEXI_ACCESS) { $ignoreState = (int)$user->gid >= 24; // Admin+, can edit all for sure
(on both occurances in /components/com_flexicontent/models/category.php (Around line 564 and 832
and then a bit further down I added your code:
Code:
// Limit by publication date. Exception: when displaying personal user items or items modified by the user $where .= ' AND ( ( i.publish_up = '.$this->_db->Quote($nullDate).' OR i.publish_up <= '.$this->_db->Quote($now).' ) OR i.created_by = '.$user->id.' )'; //.' OR ( i.modified_by = '.$user->id.' AND i.modified_by != 0 ) )'; $where .= ' AND ( ( i.publish_down = '.$this->_db->Quote($nullDate).' OR i.publish_down >= '.$this->_db->Quote($now).' ) OR i.created_by = '.$user->id.' )'; //.' OR ( i.modified_by = '.$user->id.' AND i.modified_by != 0 ) )'; // show scheduled articles to admin+ if (!$ignoreState) { $where .= ' AND ( ( i.publish_up = '.$this->_db->Quote($nullDate).' OR i.publish_up <= '.$this->_db->Quote($now).' ) OR i.created_by = '.$user->id.' )'; //.' OR ( i.modified_by = '.$user->id.' AND i.modified_by != 0 ) )'; $where .= ' AND ( ( i.publish_down = '.$this->_db->Quote($nullDate).' OR i.publish_down >= '.$this->_db->Quote($now).' ) OR i.created_by = '.$user->id.' )'; //.' OR ( i.modified_by = '.$user->id.' AND i.modified_by != 0 ) )'; } // /show scheduled articles to admin+ // Filter the category view with the active language if ((FLEXI_FISH || FLEXI_J16GE) && $filtercat) { $where .= ' AND ( ie.language LIKE ' . $this->_db->Quote( $lang .'%' ) . (FLEXI_J16GE ? ' OR ie.language="*" ' : '') . ' ) '; }
did I insert the code at the wrong spot?

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #31724 by ggppdk
Did you put the where section of the code inside the
Code:
if (!$ignoreState) { ... }

??


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.358 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline