Giter Club home page Giter Club logo

Comments (17)

joebordes avatar joebordes commented on May 28, 2024

I'd say it is a workflow. Do you have any active?

I opened my corebos webservice development tool, pointed it to the corebos demo and loaded the create product test script:

https://github.com/tsolucio/coreBOSwsDevelopment/blob/master/testcode/026_createProduct.php
http://corebos.org/demos/corebos/

The product was created correctly.

http://corebos.org/demos/corebos/index.php?module=Products&parenttab=ptab&action=DetailView&record=27190

Try activating DEBUG log, to see if there is some error reported there that could give us some clue.

from corebos.

reetp avatar reetp commented on May 28, 2024

Not AFAIAA.

Note I am cheating here - using a corebos install to access the original vtiger DB. Note I am only after modifying some basic bits in vTiger via webservices as I know there are lots of other enhancements that I am avoiding.

I added in the RESTChange files to the vtiger DB plus some files in include/Webservices.

Everything else seems quite happy. Just this Product issue.

The error seems to follow from CRMEntity:

$em->triggerEvent("vtiger.entity.aftersave", $entityData);

I just installed the corebos testsuite (Nice !!!!!) and got exactly the same error as I did with my own code:

productcreatefailed

If I use the corebos DB it is OK. Hmmmmm. How odd. ANy bright ideas ?

from corebos.

joebordes avatar joebordes commented on May 28, 2024

The aftersave confirms my suspicions, it is an event handler that is launched after saving the record.
That can be a workflow or any other aftersave event. So that takes you to two places:

  • vtiger_eventshandlers, look for the aftersave events, it is one of those that is failing
  • DEBUG log, there must be some error in there, no?

Glad you like it, I find it VERY useful and use it every time I do something with webservice.

from corebos.

reetp avatar reetp commented on May 28, 2024

Logging - ahhh, you changed that so it won't run on my existing DB. Tried reverting back t the original DB but still no logging so must be another issue there someplace on my test install

Regarding the Create error, I guess it is checking for a key in the DB which is not in the old DB but is in the new.

It's very close, but not quite close enough !

from corebos.

joebordes avatar joebordes commented on May 28, 2024

Logging is the same and not database dependent. The variable that triggers logging, $LOG4PHP_DEBUG is now in config.inc.php. config.performance has been eliminated.

from corebos.

reetp avatar reetp commented on May 28, 2024

Sorry - missed your reply !

Yes, I figured the after_save, but I'm not sure what event handlers (workflows) there would actually be that might affect it. I can't think I have anything much that isn't stock in there.

workflows

from corebos.

joebordes avatar joebordes commented on May 28, 2024

There is no product related workflow in that list. What is in the list of aftersave events?

Have you been able to activate debugging?

from corebos.

Luke1982 avatar Luke1982 commented on May 28, 2024

I think you can check the list of aftersave events in the db. I've had a lot of trouble debugging things I created and then forgot about...

from corebos.

reetp avatar reetp commented on May 28, 2024

Yes I've got debugging running now.
I'll paste some logs later as I'm out and about this morning.

from corebos.

reetp avatar reetp commented on May 28, 2024

Here''s a log of the Create transaction.

I added a bit of logging in CRMEntity.php to show field names and values like this:

		if ($cachedModuleFields) {
			foreach ($cachedModuleFields as $fieldname => $fieldinfo) {
				
				$fieldcolname = $fieldinfo['columnname'];
				$tablename = $fieldinfo['tablename'];
				$fieldname = $fieldinfo['fieldname'];

				$adb->println("FieldcolName $fieldcolname FieldName $fieldname tablename $tablename");
				
				// To avoid ADODB execption pick the entries that are in $tablename
				// (ex. when we don't have attachment for troubletickets, $result[vtiger_attachments]
				// will not be set so here we should not retrieve)
				if (isset($result[$tablename])) {
					$fld_value = $adb->query_result($result[$tablename], 0, $fieldcolname);
				} else {
					$adb->println("There is no entry for this entity $record ($module) in the table $tablename");
					$fld_value = "";
				}
				$adb->println("Fld_value $fld_value");
				$this->column_fields[$fieldname] = $fld_value;
			}
		}
		if ($module == 'Users') {
			for ($i = 0; $i < $noofrows; $i++) {
				$fieldcolname = $adb->query_result($result1, $i, "columnname");
				$tablename = $adb->query_result($result1, $i, "tablename");
				$fieldname = $adb->query_result($result1, $i, "fieldname");
				$fld_value = $adb->query_result($result[$tablename], 0, $fieldcolname);
				$this->$fieldname = $fld_value;
			}
		}

		$this->column_fields["record_id"] = $record;
		$this->column_fields["record_module"] = $module;
		
		
		$adb->println("Record $record Module $module");

I appreciate the assistance... I realise it isn't a bug in corebos per se.... !

vtigercrm.log.txt

from corebos.

joebordes avatar joebordes commented on May 28, 2024

It is all full of these errors:

ADODB error  Query Failed:select 1  FROM vtiger_globalvariable INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_globalvariable.globalvariableid  where vtiger_crmentity.deleted=0 and gvname=?  limit 1::->[1146]Table 'crm.vtiger_globalvariable' doesn't exist

It is because you are missing base coreBOS tables in your vtiger CRM database.
As a quick test you could try adding the vtiger_globalvariable and vtiger_globalvariablecf tables, just the tables to see if it works or not... but you may run into some other mandatory tables.

Add those two tables and try again. If you still get an error, send the debug log again.

from corebos.

reetp avatar reetp commented on May 28, 2024

OK - I did wonder :-) Let you know.

from corebos.

reetp avatar reetp commented on May 28, 2024

Bingo ! That seems to have fixed it.

I took the create vtiger_globalvariable, vtiger_globalvariablecf tables out of corebos_justinstalled_empty.sql in to their own sql file and then imported to my DB.

Seems to run error free now !

Thanks for the help. Looks like I am slowly heading down the CoreBOS path :-)

Joe, is it better if I fork and do pull requests or just paste fixes if I find stuff ?

from corebos.

joebordes avatar joebordes commented on May 28, 2024

PRs are preferred, but mostly to keep a register of where the change came from and give proper credits. I prefer that you send me the fix by whatever means is easier for you than to not have it because I impose some formal path.

Glad that worked :-)

from corebos.

reetp avatar reetp commented on May 28, 2024

No probs - I try to keep the lead dev happy ;-)
Once I have this mess out of the way I'll take a longer look at things.
Thanks again Joe.

from corebos.

reetp avatar reetp commented on May 28, 2024

Quick one on your comment:

"Logging is the same and not database dependent. The variable that triggers logging, $LOG4PHP_DEBUG is now in config.inc.php. config.performance has been eliminated."

I have forked to my own repo and notice that config.performance is still in master, and there are no settings in config.inc.php ?

Just wondered why?

from corebos.

joebordes avatar joebordes commented on May 28, 2024

config.inc.php is empty until you install, so the new contents of this file is in config.template.php:

https://github.com/tsolucio/corebos/blob/master/config.template.php

If you are updating, git doesn't modify config.inc.php, you have to do that one manually.

I haven't eliminated config.performance.php yet because the updater needs it to get the values of each install when it creates the equivalent global variables. I have an event to eliminate that file in about a year when I expect everyone to have updated.

I would like to invite you to join gitter, that is were the developers and some implementors dwell. I think that will be a better environment for your profile:

https://gitter.im/corebos/discuss

from corebos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.