[Vtigercrm-developers] Possible vtlib bug in vtiger 6.1 SVN 14162 (latest)
Holbok István
holbok at gmail.com
Sat Jul 5 12:34:35 GMT 2014
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 Handler
229: <http://vtigerdoc.holbok.hu/source-class-Vtiger_PackageExport.html#229> * @access private
230: <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 information
263: <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 tables
266: <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 blocks
269: <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 filters
272: <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 Access
275: <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 Events
278: <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 Actions
281: <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 Lists
284: <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 Links
287: <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 cronTasks
290: <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140705/632ee2ac/attachment-0001.html>
More information about the vtigercrm-developers
mailing list