Trying to use MAX(): "Fatal error: Undefined class constant" - sql

$c = new Criteria();
$c->addSelectColumn('MAX('.Moto::matricula.')');
But i get this error:
Fatal error: Undefined class constant
'matricula' in /opt/lampp/htdocs/
prueba/lib/model/MotoPeer.php on line
25.
Any idea?
I'm using symfony 1.4 and propel 1.4.
Regards
Javi

It means that the class "Moto" doesn't have a variable "matricula" in it. This does not seem to have anything to do with (my)sql, but more with the (php?) class you are using.
Check out the source of that Moto class, and look if you have made a typo in the constant name?

Related

Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock"

I am upgrading the dependencies of my react-native application from 0.53 to 0.59.
But I am facing the below error while trying to build it using ./gradlew assembleRelease.
#babel/template placeholder "$1": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock".
#babel/template placeholder "$1": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock"
at Object.validate (C:\vs-code-upgraded\node_modules#babel\types\lib\definitions\utils.js:132:11)
at validateField (C:\vs-code-upgraded\node_modules#babel\types\lib\validators\validate.js:24:9)
at validate (C:\vs-code-upgraded\node_modules#babel\types\lib\validators\validate.js:17:3)
at builder (C:\vs-code-upgraded\node_modules#babel\types\lib\builders\builder.js:38:27)
at Object.expressionStatement (C:\vs-code-upgraded\node_modules#babel\types\lib\builders\generated\index.js:316:31)
at applyReplacement (C:\vs-code-upgraded\node_modules#babel\template\lib\populate.js:86:27)
I would like to know if there is possiblity to solve this build error.
thank you in advance.
This might probably due to a namespace being exported which only contain interfaces/types (Not actual classes/functions/objects but type declarations).
A quick fix is to add declare to the exported namespace.
export declare namespace SomeNameSpace
instead of
export namespace SomeNameSpace

Typo3 Extension: Injection of repository doesn't work anyway

I followed the official Guide from Typo3 for creating a new extension (https://docs.typo3.org/m/typo3/book-extbasefluid/9.5/en-us/4-FirstExtension/Index.html). But when I finished, the page with the plugin gives me only an ERROR 500. No Error-Log anyway.
When I enabled ErrorDisplay I found, that there was a problem with boolean values. So I deleted them and tried again. Again all I got was ERROR 500. ErrorDisplay said the constructor cannot have a return value - hu?? Found inline 7 - but the declaration is in line 22 -??
public function __construct(int $j = 0, int $n = 0, int $i = 0, int $p = 0, int $y = 0, int $a = 0): void {...}
So I tried to delete the return value. But then it told me, that the class couldn't be found. Next, I tried to find anything about that error but found even less than nothing.
I wasn't even able to find extensions that are implementing the way explained by the official guide. Is there anybody who can tell me, what is going wrong and where I can find a solution - I have no idea anymore.
After hours and hours trial and error I found the solution. The Problem is, that Typo3 doesn't give a proper error message due to failing with the exception handling. You have to enable normal PHP Errors to get a clue what is wrong. If there is any php error, Typo3 fails and gives an reflection error, because it thinks the class isn't available.
First Error was: following the official guide instructions for first extension. Compiler ist failing if you try to give the constructor a return value.
Second Error: Typo3 doesn't recognize if a parameter in constructor is missing. It tries to take the next parameter and fails by comparing the parameters type.
Third Error: If the class is missing the instructions for underlying symphony framework the reflection also fails with registering the class without giving any error message.
After I found and corrected all the errors, all worked fine.

grammar.y error happended when compiled Cobalt

When compile Cobalt, the following error happend, is there anyone who knows why?
It said the 'ShadowType' is not a class or namespace in grammy.y:3421, I did not know what is used for grammy.y, and try to trace and modify the code, it does not work.
grammar.y error details
Your issue is that C++ version before C++0x does not support ShadowType::kBoxShadow(member in enum type) use at all, you can change the cflags_cc from "-std=gnu++98" to "-std=gnu++0x"in third_party/starboard/linux/shared/gyp_configuration.gypi, and try again.

XAMARIN the call is ambiguous between the following methods

How can i fix this problem, I have tried everything but always the same error:
I am using this API: https://github.com/xamarin/google-apis
Convert it to explicit call to the extension:
var attribute =
Google.Apis.Util.Utilities.
GetCustomAttribute<Google.Apis.Util.RequestParameterAttribute>
(property);

Append database record in HTML5 builder fatal error

I have some code in my application:
$dmMain->tblOrgList->append();
This code written with auto-completion, so everything is correct.
But, when I trying to execute this code, I have error:
Fatal error: Call to a member function append() on a non-object in
C:\Users\ASAP\Documents\HTML5 Builder\Projects\VitoOrgList\index.php
on line 18
Can somebody advice, where I can find a trouble?
Thanks
I found the solution.
Really, I have no big PHP experience :-]
I just added before calling $dmMain methods in function body:
global $dmMain;