Coldfusion 8 -> 9 update, functions no longer working - variables

HELP!!
Just migrating a site from one server to another, the coldfusion version is changing from cf8 to cf9 [linux/centos]
this code used to work before:
cfinclude('../SQL/contact.sql.cfc');
form.phone = unFormatPhone(form.phone);
contactID = InsertContact(form);
In the included file is:
<cfcomponent output="false" >
<!--- -------------------------------- insert -------------------------------- --->
<cffunction name="InsertContact" returntype="numeric" output="false" access="public" >
now I get an error when browsing the pages:
Variable INSERTCONTACT is undefined.
The error occurred in /var/www/vhosts/xxxxxx.com/httpdocs/Assets/XHTML/buy-my-car.cfm: line 54
Called from /var/www/vhosts/newride.ca/httpdocs/Application.cfc: line 232
Called from /var/www/vhosts/newride.ca/httpdocs/Application.cfc: line 230
Called from /var/www/vhosts/newride.ca/httpdocs/Application.cfc: line 162
52 : cfinclude('../SQL/contact.sql.cfc');
53 : form.phone = unFormatPhone(form.phone);
54 : contactID = InsertContact(form);
55 :
56 : //insert vehicle with app id
What is going on here? the included file is being found, is there some difference between the two versions that is causing this?

Are you sure its being included? try:
include "../SQL/contact.sql.cfc";
form.phone = unFormatPhone(form.phone);
contactID = InsertContact(form);

Well, I'll say first off that I've only worked with CF9, so I can't comment on what you used to be able to do in CF8. But, in CF9 I'm pretty sure you cant use a CFC that way. The closest thing to what you're doing would be transient invocation using <cfinvoke>. See here: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7db3.html
But, also look at instantiating the cfc as an object and then calling methods on that object. I like doing it that way as it reminds me of other languages such as Java and C#.

Related

Error creating Email for addon domain Cpanel

hey guys I need your godly advice I have set up my Webhosting from a NON-cpanel server to a cpanel server and am trying to create an email account for one of my addon domains EG main domain is EG main.com addon new_main.com so I try and create for my addon in cpanel like email#new_main.com and I am met with this error. please note I used to years ago be on cpanel so it may have brought files from the old install over to this new install which is possibly causing the issue but I'm lost trying to figure out what's wrong
fingers crossed you guys can see the error I have been looking at this for a day now and I still can't seem to figure out, I have looked for the files mentioned and some are there 1 of them isn't cant remember which and I don't know how to remedy the situation thanks in advance
The error looks like this
Error: The operation “POST” “/cpsess8393558881/execute/Email/add_pop” failed with a “The system could not create the calendar “Calendar” for “contact#combatprosports.co.uk”: Cpanel::Exception::Database::Error/(XID rg8xc9) The system received an error from “SQLite”: SQLITE_READONLY (attempt to write a readonly database) at /usr/local/cpanel/Cpanel/DBI.pm line 200. Cpanel::DBI::_create_exception(Cpanel::DBI::db=HASH(0x2b39d20), "DBD::SQLite::db do failed: attempt to write a readonly database", undef) called at /usr/local/cpanel/Cpanel/DBI.pm line 188 Cpanel::DBI::_error_handler("DBD::SQLite::db do failed: attempt to write a readonly database", Cpanel::DBI::db=HASH(0x2b39d20), undef) called at /usr/local/cpanel/Cpanel/DAV/Backend/DB/Horde.pm line 79 eval {...} called at /usr/local/cpanel/Cpanel/DAV/Backend/DB/Horde.pm line 79 Cpanel::DAV::Backend::DB::Horde::do(Cpanel::DBI::db=HASH(0x2b39d20), " INSERT INTO kronolith_shares\x{a} (share_name, share_owner"..., "14a47cf5-a4b7-b2f9-5d71-7e972f886226", "contact\#combatprosports.co.uk", "Calendar", "This is your personal calendar.", "#641f76") called at /usr/local/cpanel/Cpanel/DAV/Backend/HordeCalendar.pm line 82 Cpanel::DAV::Backend::HordeCalendar::create_calendar(Cpanel::DAV::Principal=HASH(0x281d938), "Calendar", "This is your personal calendar.") called at /usr/local/cpanel/Cpanel/DAV/Calendars.pm line 59 Cpanel::DAV::Calendars::create_calendar(Cpanel::DAV::Principal=HASH(0x281d938), "Calendar", "This is your personal calendar.") called at /usr/local/cpanel/Cpanel/DAV/Defaults.pm line 55 Cpanel::DAV::Defaults::create_calendar(Cpanel::DAV::Principal=HASH(0x281d938)) called at /usr/local/cpanel/Cpanel/DAV/Defaults.pm line 142 Cpanel::DAV::Defaults::create_calendars_and_address_books("contact\#combatprosports.co.uk") called at /usr/local/cpanel/Cpanel/API/Email.pm line 1478 Cpanel::API::Email::add_pop(Cpanel::Args=HASH(0x2451f80), Cpanel::Result=HASH(0x244a6d8)) called at /usr/local/cpanel/Cpanel/API.pm line 366 eval {...} called at /usr/local/cpanel/Cpanel/API.pm line 368 Cpanel::API::_run_module_function(Cpanel::Args=HASH(0x2451f80), Cpanel::Result=HASH(0x244a6d8), "Email", "add_pop") called at /usr/local/cpanel/Cpanel/API.pm line 243 Cpanel::API::execute("Email", "add_pop", HASH(0x244a588)) called at /usr/local/cpanel/Cpanel/API.pm line 651 Cpanel::API::run_api_mode(HASH(0x244a588)) called at uapi.pl line 307 main::script() called at uapi.pl line 139 ” error.```
The error message contains the following:
SQLITE_READONLY (attempt to write a readonly database)
This is not normal and suggests that there is a problem with the server's disks. You should reach out to your hosting provider, or if you are the owner of the server, a systems administrator that has the skills, training, and experience required to check the status of the disks, and/or determine why the SQLITE database is readonly.

READ REPORT for global classes?

I tried READ REPORT for global class but it's not working. I need to read global class' source code into table.
I found SEO_METHOD_* FM, but those only returned metadata about class, not its source code.
Is there any FM or method similar to READ REPORT but for global classes ?
Thank you for your help.
All ABAP code is stored in the table REPOSRC, reports, function modules, class pools, etc., in "include programs". This table may only be read via the ABAP statement READ REPORT.
You need to know what are the names of these include programs for a class pool.
For a class pool named ZCL_X, the ABAP source code is stored in these include programs:
ZCL_X=========================CS : this include contains the whole source code, but only if it has been changed via the source-based editor or via Eclipse ADT.
ZCL_X=========================CP : main code, which lists all or most of next include programs
** NB: CP starts always at the 31st character, all characters between class name and 31st character are to be replaced with =. Example: if the class pool is named ZCL_XXXXX, the include is named ZCL_XXXXX=====================CP.
ZCL_X=========================CU : public section
ZCL_X=========================CI : private section
ZCL_X=========================CO : protected section
ZCL_X=========================CM+++ : methods
** +++ is a 3-characters code corresponding to a method as defined in table TMDIR. The column METHODNAME contains the method name and METHODINDX contains an integer used to build +++, examples:
** 1 to 9 : 001 to 009
** 10 to 35 : 00A to 00Z
** 36 to 45 : 010 to 019
** 46 to 71 : 01A to 01Z
** 72 to 81 : 020 to 02Z
** etc.
ZCL_X=========================CCDEF : local class definitions
ZCL_X=========================CCMAC : macros
ZCL_X=========================CCIMP : local class implementations
ZCL_X=========================CCAU : local test classes
and more ...
Use CL_RECA_RS_SERVICES, method GET_SOURCE like this:
CALL METHOD cl_reca_rs_services=>get_source
EXPORTING
id_objtype = 'CLAS'
id_objname = 'CL_SALV_BS_RUNTIME_INFO'
IMPORTING
et_source = DATA(source)
EXCEPTIONS
not_found = 1
others = 2
.

CF9 Error Executing Database Query

I am getting this error and don't understand why:
Error Executing Database Query. [Macromedia][SQLServer JDBC
Driver][SQLServer]Invalid column name 'buildno'. The error occurred
in C:/data/wwwroot/webappsdev/cfeis/redbook/redbook_bio_load.cfm: line
10
8 : select *
9 : from redbook_bio
10 : where build_num = '#session.build_num#'
11 : </cfquery>
12 :
VENDORERRORCODE: 207 SQLSTATE: 42S22 SQL: select * from
redbook_bio where buildno = '4700' DATASOURCE: xxxx
******"
It is saying buildno is an invalid column name, but I do not have that name in my query. I used to, but changed both the column in the database and the column name in the query to build_num. You can see my exact code with line numbers, and that there is no 'buildno' in there. But looking at the SQL statement below that, it is still trying to use 'buildno'.
I had my editor check the directory for anywhere it says buildno and no results came back. I have restarted the CF Service and cleared the cache. Why would it still be trying to run it with buildno instead of build_num like the code says?
There was a cfquery cache setting in the Administrator. We had it set to 100. Apparently clearing the cache template and component cache doesn't clear the cfquery cache. I changed the query name and it fixed the problem. It most likely could have been fixed by setting the cfquery cache value to 0.

Drupal is looking for a field that no longer exists

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/superallan.com/public_html/includes/common.inc:2561) in drupal_send_headers() (line 1040 of /home/sites/superallan.com/public_html/includes/bootstrap.inc).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'web247-sa_admin.field_data_field_embedcode' doesn't exist: SELECT field_data_field_embedcode0.entity_type AS entity_type, field_data_field_embedcode0.entity_id AS entity_id, field_data_field_embedcode0.revision_id AS revision_id, field_data_field_embedcode0.bundle AS bundle FROM {field_data_field_embedcode} field_data_field_embedcode0 WHERE (field_data_field_embedcode0.deleted = :db_condition_placeholder_0) AND (field_data_field_embedcode0.bundle = :db_condition_placeholder_1) LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => blog ) in field_sql_storage_field_storage_query() (line 569 of /home/sites/superallan.com/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).
As I understand it Drupal is looking for a data field that I deleted. I thought maybe it had got corrupted and Drupal couldn't find it to delete it properly. In phpMyAdmin it doesn't exist so how can I get Drupal to recognize it's not longer there and stop it showing this error at the bottom of every page?
You can see it on this page: http://superallan.com/404
Have you tried clearing the site cache, or uninstalling the module that provides the field? It looks like a reference to the field's SQL data is sticking around in your database, which is of course causing the error you posted.
This worked for me:
DELETE FROM field_config WHERE deleted = 1;
DELETE FROM field_config_instance WHERE deleted = 1;
I received no adverse effect from removing all the things that were already deleted.
Source:
http://digcms.com/remove-field_deleted_data-drupal-database/

Element RECORDCOUNT is undefined in "yyReslt"

I have a query that is being used in a coldfusion file (MX)( on the Production since 10 yrs ).
I have used this application/files since 4 months,successfully.
But now ,Suddenly I am getting the error
Element RECORDCOUNT is undefined in "yyReslt"
Will this occur if the Database connection is slow/improper?
Are there any conditionals around the cfquery? Are you sure it is being ran? You should turn on debugging for your IP address to make sure the query is running.
Also, you would get a different error if the connection timed out.
Sounds like your query might have some cfif statements in/around it, and nothing is being done. In addition to what Jason mentioned, you can also use cfdump to view the query object on your screen without turning on the debug data.
<cfdump var="#yyReslt#">
This also could be a concurrency issue combined with unscoped variables if happening within the context of a component that exists in the application scope, but the query variable was not scoped within the component.
<cfcomponent>
<cffunction name="foo">
<cfquery name="yyReslt" datasource="DB">
SELECT ...
</cffunction>
<cfif yyReslt.RecordCount GT 1>
.... DO SOME WORK ....
</cfif>
</cfcomponent>
simply scoping yyReslt at the before the query would fix this.
<cfset var yyReslt = "" />
All variables need to be scoped, varscoper is helpful in checking components for scoping omissions.
http://varscoper.riaforge.org/