[Vtigercrm-developers] Possible vtlib bug in vtiger 6.1 SVN 14162 (latest)

Uma S uma.s at vtiger.com
Sun Jul 6 14:02:40 GMT 2014


Hi Holbok,

Yes, i agree with you when we run the bootstrap vtlib script to create
entity module. we are missing this following piece of code, which we are
using in our import_Module() api of (vtlib/Vtiger/PackageImport.php) file.

if(!empty($parenttab)) {
  $menuInstance = Vtiger_Menu::getInstance($parenttab);
  $menuInstance->addModule($moduleInstance);
}

Which is used to insert entry to vtiger_parenttabrel, if parent tag has a
value in manifest.xml.

I have raised a trac <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8131>for
same. where we will be updating our vtlib script. Please leave your
observation here.


On Sat, Jul 5, 2014 at 6:04 PM, Holbok István <holbok at gmail.com> wrote:

>  Dear Vtiger Team,
>
> Running the bootstrap vtlib script to create entity module I have found an
> other issue:
>
> When we export the created module to crate install package, the
> *<parent></parent>* field in the *manifest.xml *will be empty.
>
> The bootstrap vtlib script of course contains the parent name.
>
>         $moduleInstance = new Vtiger_Module();
>         $moduleInstance->name = $MODULENAME;
>         $moduleInstance->parent= '*Tools*';
>         $moduleInstance->save();
>
> The parent name is stored into the *vtiger_tab* table *parent* field as
> 'Tools' in the record with a new ID. This is OK.
>
> *But no one record* was created (during the module creating process) in
> the table *vtiger_parenttabrel *. Even so the Custom module was listed
> under the Parent Tab (Tools), it looks like by getting data from an other
> place.
>
> The Class Vtiger_PackageExport responsible for the package creation. It is
> located at vtlib/Vtiger/PackageExport.php file.
>
> Looking at the function export_Module()  (line 231) we can see that the
> parent name is searching from the table vtiger_parenttabrel , where no
> records about it.
>
>     /**228:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#228>     * Export Module Handler229:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#229>     * @access private230:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#230>     */231:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#231>    function export_Module <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#_export_Module>($moduleInstance) {232:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#232>        global $adb;233:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#233>234:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#234>        $moduleid = $moduleInstance->id;235:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#235>236:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#236>        $sqlresult = $adb->pquery("SELECT * FROM vtiger_parenttabrel WHERE tabid = ?", array($moduleid));237:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#237>        $parenttabid = $adb->query_result($sqlresult, 0, 'parenttabid');238:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#238>        $menu = Vtiger_Menu::getInstance($parenttabid);239:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#239>        $parent_name = $menu->label;240:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#240>241:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#241>        $sqlresult = $adb->pquery("SELECT * FROM vtiger_tab WHERE tabid = ?", array($moduleid));242:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#242>        $tabresultrow = $adb->fetch_array($sqlresult);243:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#243>244:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#244>        $tabname = $tabresultrow['name'];245:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#245>        $tablabel= $tabresultrow['tablabel'];246:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#246>        $tabversion = isset($tabresultrow['version'])? $tabresultrow['version'] : false;247:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#247>248:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#248>        $this->openNode('module');249:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#249>        $this->outputNode(date('Y-m-d H:i:s'),'exporttime');250:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#250>        $this->outputNode($tabname, 'name');251:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#251>        $this->outputNode($tablabel, 'label');252:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#252>        $this->outputNode($parent_name, 'parent');253:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#253>254:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#254>        if(!$moduleInstance->isentitytype) {255:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#255>            $this->outputNode('extension', 'type');256:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#256>        }257:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#257>258:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#258>        if($tabversion) {259:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#259>            $this->outputNode($tabversion, 'version');260:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#260>        }261:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#261>262:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#262>        // Export dependency information263:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#263>        $this->export_Dependencies($moduleInstance);264:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#264>265:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#265>        // Export module tables266:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#266>        $this->export_Tables($moduleInstance);267:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#267>268:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#268>        // Export module blocks269:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#269>        $this->export_Blocks($moduleInstance);270:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#270>271:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#271>        // Export module filters272:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#272>        $this->export_CustomViews($moduleInstance);273:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#273>274:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#274>        // Export Sharing Access275:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#275>        $this->export_SharingAccess($moduleInstance);276:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#276>277:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#277>        // Export Events278:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#278>        $this->export_Events($moduleInstance);279:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#279>280:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#280>        // Export Actions281:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#281>        $this->export_Actions($moduleInstance);282:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#282>283:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#283>        // Export Related Lists284:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#284>        $this->export_RelatedLists($moduleInstance);285:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#285>286:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#286>        // Export Custom Links287:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#287>        $this->export_CustomLinks($moduleInstance);288:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#288>289:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#289>        //Export cronTasks290:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#290>        $this->export_CronTasks($moduleInstance);291:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#291>292:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#292>        $this->closeNode('module');293:  <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#293>    }
>
>
>
>
> Kindest regards:
> Istvan
>
> --
> üdvözlettel:
>
> *Holbok István*
>
> +3670-342-0900
> *e-mail:* holbok at gmail.com
> *SkyPe:* holboki
>
>
> _______________________________________________
> http://www.vtiger.com/
>



-- 
With
Best Regards
Uma.S
Vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140706/b190a8fc/attachment-0001.html>


More information about the vtigercrm-developers mailing list