Menu

#2229 AttributeBlob & method OnInsert()

Extensions
assistance
None
Extension
Critical
2.6.0
defect
2024-02-09
2024-02-07
No

When creating new Class (Say "MyNewClass") having field Attribute "AttributeBlob",

            <field id="report" xsi:type="AttributeBlob">
                <is_null_allowed>true</is_null_allowed>
                <always_load_in_tables>true</always_load_in_tables>
            </field>

In that same class :

            <method id="OnInsert">
              <comment>/**
                *
                > * @author Benjamin LAURENCE
                */
              </comment>
              <static>false</static>
              <access>public</access>
              <code><![CDATA[
                            public function OnInsert()
                            {
                                parent::OnInsert();
                                $this->Set('report', '../myfile.pdf');
                                 $this->SetIfNull('creation_date', time());   
                            }
                    ]]></code>
            </method>

Created profile for that Class :

<user_rights>
    <profiles>
        <profile id="2050" _delta="define">
          <name>MyProfileName</name>
          <description>Users Allowed to manage XXXXX</description>
          <groups>

            <group id="MyNewClass">
              <actions>
                <action id="action:read">allow</action>
                <action id="action:write">allow</action>
                <action id="action:delete">allow</action>
                <action id="action:bulk read">allow</action>
                <action id="action:bulk write">allow</action>
                <action id="action:bulk delete">allow</action>
              </actions>
            </group>
          </groups>
        </profile>
    </profiles>
    <groups>
      <group id="MyNewClass" _delta="define">
        <classes>
          <class id="MyNewClass"/>
        </classes>
      </group>  
    </groups>
</user_rights>

Pdf is successfully stored only when using "Admin profile"

Discussion

  • Pierre Goiffon

    Pierre Goiffon - 2024-02-09

    Hello,
    Please use tickets for qualified bugs and enhancement requests only.
    For anything like like this assistance request, please create a new topic on the forums ("discussion" tab)

     
  • Pierre Goiffon

    Pierre Goiffon - 2024-02-09
    • status: new --> assistance
    • assigned_to: Pierre Goiffon
     
  • Pierre Goiffon

    Pierre Goiffon - 2024-02-09

    The topic was created : [9572a0ac4f]
    Thanks :)

     

    Related

    Discussion: 9572a0ac4f


Log in to post a comment.