Can't preview file datatype before...

Author Message

Issam MOUZOUN

Monday 21 December 2009 8:07:40 am

Hello,

 

I develop a subscription module, any people can subscribe and must attach file (ezbinaryfile) and wait my approbation,.

 

My problem is i can't preview the attached document during before approving

I developp with ez 4.1.3

Thanks

Jérôme Vieilledent

Tuesday 22 December 2009 12:30:30 am

Hi Issam

Maybe you should give a try to eZ Approve 2. It's much more advanced thant standard eZ Approve workflow.

Anyway, I'm surprised that you can't preview the binary file. I just tested on my 4.2 instance and it smells like a bug in content/download module...

Jérôme Vieilledent

Tuesday 22 December 2009 1:15:03 am

OK, I found out where the problem is, and this is a registered bug.
When running content/download, eZ Publish will check the node assignments of the attribute parent object. But in that case, the object has no node assignment because it's not published yet !
Problem occurs in kernel/content/download.php, lines 52 to 79

// Get locations.
$nodeAssignments = $contentObject->attribute( 'assigned_nodes' );
if ( count( $nodeAssignments ) === 0 )
{
    // oops, no locations. probably it's related object. Let's check his owners
    $ownerList = eZContentObject::fetch( $contentObjectID )->reverseRelatedObjectList( false, false, false, false );
    foreach ( $ownerList as $owner )
    {
        if ( is_object( $owner ) )
        {
            $ownerNodeAssignments = $owner->attribute( 'assigned_nodes' );
            $nodeAssignments = array_merge( $nodeAssignments, $ownerNodeAssignments );
        }
    }
}

// If exists location that current user has access to and location is visible.
$canAccess = false;
foreach ( $nodeAssignments as $nodeAssignment )
{
    if ( ( eZContentObjectTreeNode::showInvisibleNodes() || !$nodeAssignment->attribute( 'is_invisible' ) ) and $nodeAssignment->canRead() )
    {
        $canAccess = true;
        break;
    }
}
if ( !$canAccess )
    return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:18:30
Script start
Timing: Jan 18 2025 10:18:30
Module start 'layout'
Timing: Jan 18 2025 10:18:30
Module start 'content'
Timing: Jan 18 2025 10:18:31
Module end 'content'
Timing: Jan 18 2025 10:18:31
Script end

Main resources:

Total runtime1.3642 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.3516152.6250
Module start 'layout' 0.00570.0034 741.976639.4609
Module start 'content' 0.00921.3536 781.4375515.6094
Module end 'content' 1.36280.0013 1,297.046912.4688
Script end 1.3642  1,309.5156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2447160.0002
Check MTime0.00120.0911160.0001
Mysql Total
Database connection0.00090.068810.0009
Mysqli_queries1.316196.4716590.0223
Looping result0.00050.0359570.0000
Template Total1.332697.720.6663
Template load0.00250.181220.0012
Template processing1.330197.502320.6651
Template load and register function0.00020.012110.0002
states
state_id_array0.00140.104110.0014
state_identifier_array0.00110.078920.0005
Override
Cache load0.00210.1545240.0001
Sytem overhead
Fetch class attribute can translate value0.00080.056120.0004
Fetch class attribute name0.00090.067940.0002
XML
Image XML parsing0.00080.060820.0004
class_abstraction
Instantiating content class attribute0.00000.000850.0000
General
dbfile0.00130.0955170.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs