call function getLabel() in joomla 1.6 - joomla-extensions

After upgrading from Joomla 1.5.22 to 1.6 beta 14 I am getting this error when trying to call parameter in the xml file : Fatal error: Call to a member function getLabel() on a non-object
the code is in view.php
form->getLabel('max_chars'); ?>
form->getInput('max_chars'); ?>
the max_chars parameter obtained from models/setting.xml, the code is :
Am I doing wrong thing..? pls help me......

I had a similar problem once I commented the lines out I got an error message
Model class compontentModelUser not found in file
I had accidentally replaced User model with a models for an JModelList instead of JModelAdmin
make sure your using the right model is all I'm saying.
It would be easier to know what the issue is with more of your code.
Hope this helps a little...

Related

include validation service in codeigniter4 failed

i try to make my first form validation in codeigniter4.For that i've create a controller with a function to check the post-vars. At the beginning, ci4 need to load the libary, so i do it like in the docu
$validation = \Config\Services::validation();
For this i recieve the following error.
...
message "Class 'Myth\\Auth\\Authentication\\Passwords\\ValidationRules' not found"
file "mypath/system/Validation/Validation.php"
function "loadRuleSets"
class "CodeIgniter\\Validation\\Validation"
function "run"
class "CodeIgniter\\Validation\\Validation"
....
What i do wrong, or is there something to setup for a new project before it works?
omg
i've found the problem. in the app/config autoload.php and validation.php was a class "Myth" wich is not in use. SO i commet it out and the thinks works fine.

phppgadmin 5.1 Misc has a deprecated constructor

10 minute ago I tried to connect with phppgadmin 5.1 but i found this error message on web server error log :
" Misc has a deprecated constructor in /usr/share/phppgadmin/classes/Misc.php on line 8"
Phppgadmin is out of work.
I use php 7.0.
Someone knows how to fix it?
Thanks so much.
In my own research, in PHP 7, PHP 4 style constructors (methods that have the same name as the class they are defined in) are deprecated, and will be removed in the future. PHP 7 will emit E_DEPRECATED if a PHP 4 constructor is the only constructor defined within a class. Classes that implement a __construct() method are unaffected.
So my fix is open Misc.php, and locate the class Misc, in it there is a function called Misc, rename the function name with anything except for Misc because it will produce that error you've mentioned.
I found the same problem.Just browse and find Misc.php file it is located in classes folder inside your phpPgAdmin folder.Then,open it and search for Misc function and change it to anything except MIsc.In my case i changed it to Misc1.enter image description here
The easiest way to solve is to locate the Misc.php file in phppgadmin/classes/ and search for the the constructor function.You can see the class name is Misc and the constructor is also Misc.
This (notice) message is based on changes to PHP 7,So an old way of using a constructor is still in use, is what that message means.
What is expected is instead of having a class with a constructor like this:
<?php
class Misc{
function Misc() {
echo 'I am the constructor';
}
}
?>
would now be expected to look like this:
<?php
class Misc{
function __construct() {
echo 'I am the constructor';
}
}
?>
See the first section section of this PHP 7 deprecation info.
You can just comment out the old method and change it to the new method.It should work fine.
/* Constructor line : 15*/
Function __construct() {
}

asp.net mvc5 scaffolding Unable to retrive metadata for ...Ambiguous match found

Problem: When I want to create controller from EF codefirst context it give me this error:
There was an error running the selected code generator.Unable to retrieve metadata for Model.class name.Ambiguous match found.
See Error Image
What I did?
As my model data was in seprate assembly I updated all package or downgrade them but nothing happened.
Then I merged my Model assembly in Website project but error doesn't resolved.
After googleing and many tricks, I created clean project and scaffolding for each class but it seems only one class had this problem.
In that class I commented all property and uncomment one by one to find error.
Found it! For this property error occurs public bool ISActive { get; set; }
I surprised so much and found how dot net turture you!!
What do you think about solution?!!
Renaming ISActive property to something else such as IsActivated solved my problem.It seems EF scaffolding has problem with this type of naming while cruding.

Call to a member function model() on a non-object error on opencart 2.0

I am use <?php $this->load->model('tool/image'); ?> this on tpl file
i am getting this error Call to a member function model() on a non-object in /home/host/public_html/site/admin/view/template/module/module_name.tpl
any one please solve my problem
thanks
The error means that $this->load is not what you think it is.
I've looked at the docs briefly and the model property is available only inside the controller. You are trying to access it in the view. You need to pass the model object to the view.
Try this in the controller
$this->data['load'] = $this->load;
Then in the view you should be able to do this:
<?php $load->model('tool/image'); ?>
I solve this suppressing the load call, I believe that now thee tpl is executed in the load, then when you call $this->load, you are calling load in load.
If you put
$this->load->model('tool/image');
it should to work, at least it worked in my code...

Error calling method in java-class 'ClassA' 'org.my.ClassB' is incompatible with 'org.my.ClassB'

I have two classes org.my.ClassA and org.my.ClassB both classes are in the same package org.my in the WEB-INF/src in the same database.
ClassA has the method public add(org.my.ClassB newB){...}.
In SSJS I have a code block in which I call ClassA.add(ClassB) which normally works fine. Until some unknown point where the Server can't see that org.my.ClassB === org.my.ClassB and it returns the error (message translated from German maybe looks different in English version):
error calling method 'add(org.my.ClassB)' in java-class 'ClassA'.
'org.my.ClassB' is incompatible with 'org.my.ClassB'.
and it points to my line in the SSJS: ClassA.add(ClassB);
What I tried so far:
First I added the line importPackage(org.my); to my SSJS Code. No luck.
I tried to add another method add(Object newB) and then cast the object to ClassB but same result. The error does not seem to come from the java class its from the SSJS code because it cant find the method with an argument of the type org.my.ClassB. But if I test the object in the SSJS code it returns org.my.ClassB.
Then I tried to add the classpath to all variables in the SSJS block like: var newB:org.my.ClassB = new org.my.ClassB(). But same result after some time the application breaks with the same error.
From my Point of view it got to do something with the caching of compiled classes, or so because if I clear the database everything works just fine again.
Hope someone has a solution on this.
This is a class loader problem.
You can find more details about the issue in the answer from Frantisek Kossuth:
See here more details: Meaning of java.lang.ClassCastException: someClass incompatible with someClass

Resources