Forums / Developer / attributeedit policy

attributeedit policy

Author Message

J-A Eberhard

Saturday 25 August 2007 12:56:10 pm

Hi Kristof,

I did the same operation again, with your new svn files, and it worked.
Did I missed something the first time, is there a tiny difference between both set of files? I may never know...
Thanks for the contrib anyway, pretty usefull and I hope to see it committed to the 3.10!!

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

J-A Eberhard

Sunday 07 October 2007 12:37:25 pm

3.10.0 compatibility.

Hi Kristof,

I migrated to 3.10.0 and found that the ezcontentobject.php file must be modified to take into account the allLanguages and createWithNodeAssignment new functions.

line 221

'all_languages' => 'allLanguages',

Line 3278

/* ADDED FOR 3.10.0 compatibility 
    /*
     * Creates object with nodeAssignment from given parent Node, class ID and language code.
     */
    function createWithNodeAssignment( $parentNode, $contentClassID, $languageCode, $remoteID = false )
    {

        $class = eZContentClass::fetch( $contentClassID );
        $parentObject = $parentNode->attribute( 'object' );

        // Check if the user has access to create a folder here
        if ( strtolower( get_class( $class ) ) == "ezcontentclass" and
             $parentObject->checkAccess( 'create', $contentClassID, false, false, $languageCode ) == '1' )
        {
            // Set section of the newly created object to the section's value of it's parent object
            $sectionID = $parentObject->attribute( 'section_id' );

            include_once( "kernel/classes/datatypes/ezuser/ezuser.php" );
            $userID = eZUser::currentUserID();

            $db =& eZDB::instance();
            $db->begin();
            $contentObject = $class->instantiateIn( $languageCode, $userID, $sectionID, false, EZ_VERSION_STATUS_INTERNAL_DRAFT );
            $nodeAssignment = $contentObject->createNodeAssignment( $parentNode->attribute( 'node_id' ),
                                                                    true, $remoteID,
                                                                    $class->attribute( 'sort_field' ),
                                                                    $class->attribute( 'sort_order' ) );
            $db->commit();
            return $contentObject;
        }
        return null;
    }

Line 4622

/* added for 3.10.0 COMPATIBILITY */

    function &allLanguages()
    {
        $languages = isset( $this->LanguageMask ) ? eZContentLanguage::languagesByMask( $this->LanguageMask ) : array();
        return $languages;
    }

Looks to work fine like that.

Jacques-andré

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Milad P

Friday 09 November 2007 4:09:55 am

Hi Kristof,

is there any plan to merge this hack into eZ main release in the soon future?

David Boman

Saturday 15 December 2007 2:39:54 pm

*Bump*

Kristof Coomans

Sunday 16 December 2007 1:30:36 pm

Hi

Sorry for the late answer, must have missed the question. Currently there are no plans to incorporate this into the kernel.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Heath

Sunday 16 December 2007 1:39:41 pm

Hello Kristof,

Are their plans to migrate the existing svn repository for this solution to projects.ez.no (say to support a 3.9, 3.10 or 4.0 specific branches)?

Respectfully,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Kristof Coomans

Sunday 16 December 2007 1:46:20 pm

Sounds fine to me. I'll add it soon on projects.ez.no. If I forget, then kick me ;)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

David Boman

Sunday 16 December 2007 11:25:33 pm

Hi Kristof,

Thanks or the answer. Is there a rationale - other than time constraints - why this shouldn't be incorporated in the kernel? I find the hack very useful and my experience is that the workarounds if one can't set policy on attribute level tends to get very comlex and messy.

Peter Schlund

Thursday 27 March 2008 6:53:18 am

closed

anne martinet

Tuesday 16 September 2008 1:29:53 am

Hello,

Does the hack work with ez publish 4.0.0 ??

thanks,

A Fowler

Friday 10 July 2009 8:11:18 pm

I also would like to know if it works with eZ Publish 4.x.

eZ debug

Timing: Jan 20 2025 23:46:10
Script start
Timing: Jan 20 2025 23:46:10
Module start 'content'
Timing: Jan 20 2025 23:46:10
Module end 'content'
Timing: Jan 20 2025 23:46:11
Script end

Main resources:

Total runtime0.2055 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0079 589.4063180.8438
Module start 'content' 0.00790.0061 770.2500106.3594
Module end 'content' 0.01400.1914 876.6094534.4844
Script end 0.2054  1,411.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00341.6637200.0002
Check MTime0.00140.6703200.0001
Mysql Total
Database connection0.00080.385410.0008
Mysqli_queries0.159977.80251410.0011
Looping result0.00130.61751390.0000
Template Total0.191092.910.1910
Template load0.00080.377010.0008
Template processing0.190292.568210.1902
Override
Cache load0.00050.263810.0005
Sytem overhead
Fetch class attribute can translate value0.00100.496410.0010
XML
Image XML parsing0.00030.122210.0003
General
dbfile0.00492.4001200.0002
String conversion0.00000.003530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs