Pages

Showing posts with label not. Show all posts
Showing posts with label not. Show all posts

Monday, January 4, 2016

Symfony-Error-Annotation not Imported

[Semantical Error] The annotation "@Template" in method AppBundle\Controller\DefaultController::indexAction() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /var/www/symfony_learn_2_6/src/AppBundle/Controller/ (which is being imported from "/var/www/symfony_learn_2_6/app/config/routing.yml"). 

Recently while working on symfony I encountered above error.The resolution is simple we just need to add Sensio annotation handler for the above annotation.So in this case since annotation handler for template is missing we need to add 

Sensio\Bundle\FrameworkExtraBundle\Configuration\Template

above the controller.Similerly if annotation handler for route is missing then we can add 

Sensio\Bundle\FrameworkExtraBundle\Configuration\Route

Sunday, December 27, 2015

Symfony-Generate Bundle Option not working in app/console

Recently in One of the symfony dumps I gathered from my IT team had an issue due to some reason "Generate Bundle" option was not working from app/console list -- raw

Solution :

Add following lines in File composer.json

"required-dev":{
"sensio/generator-bundle": "~2.3"
}

File AppKernal.php should have

new Sensio\Bundle\GeneratorBundle\SensioGenerator();

That's it

Thursday, July 30, 2015

Cakephp 2.0-Validations not working

Many a times Our custom Validations do not work in cakephp due to very tiny small errors.Here is a piece of my research and development which might help you
 In the controller
       if (!empty($this->data))   
       {  
         $this->User->set($this->data);  
         if ($this->User->validates())   
         {  
           // it validated logic  
           echo "Yes we can proceed";  
         }   
         else   
         {  
           // didn't validate logic  
           $errors = $this->User->validationErrors;  
           pr($errors);  
         }  
       }  

See the line in Bold this must be done to get errors set

In the view
   <?php   
       if($this->Form->isFieldError('User.username'))  
       {  
         echo $this->Form->error('User.username', null, array('class' => 'message'));   
       }  
       ?>  
Now set the class to taste and you will get error message in view in desired color.

Wednesday, March 25, 2015

Configuring External Apache Tomcat in Netbeans/Ubuntu or error : specify the server location (Catalina Home)) and error : could not read server-config.xml

Hi This posts counters the problem of configuration of external Apache Tomcat Server to Ubuntu..

It also deals with the errors
1. specify the server location (Catalina Home))
2. could not read server-config.xml

To Counter all this we need to do as follows

For First Problem create and link directories as follows.This will only occur if Netbeans thinks if you are using and older version of Tomcat Server.

cd /usr/share/tomcat7
sudo mkdir common
cd common
sudo ln -s ../lib lib

For Second Problem create and link directories as follows

cd /usr/share/tomcat7
sudo mkdir conf 
cd conf
sudo ln -s /etc/tomcat7/server.xml server.xml
sudo chmod o+rx /usr/share/tomcat7/conf 
 
Thats it give a username and Password and Apache server is configured on your Netbeans  


Sunday, September 15, 2013

Cakephp-Data Validation Not Working-Resolution workflow

Recently while working on a Linux Machine I faced an issue where cake's default validation was not working.Here is the walkthrough of steps which you must ensure to make it work if it still doesn't let me know

1. First things first-If you are working on linux server File Name Casing is an issue.Make sure your model File name,Class name matches the name of your first parameter in form.


 //File name  
 Task.php  
 //Model Class  
 class Task extends AppModel  
 {  
 }  
 //Form Start  
 <?php echo $this->Form->create('Task');?>  

2. Check Validation rule's format they should match cake convention's

     public $validate = array(
        'title'=>array(
            'alphaNumeric' => array(
                'rule'     => 'alphaNumeric',
                'required' => true,
                'message'  => 'Alphanumeric only'
            ))); 

I was doing everything right but my file name was incorrect I was using a lowercase filename which caused the error

Sunday, August 18, 2013

Authroize .Net-Error:E00044 [text]=>Customer Information Manager is not Enabled

This error I faced using Authorize .Net CIM.My only mistake was I signed up with an account with credit card present in Authorize .net developers

Sign up with an account with "Card Not Present option" and it will give you a different admin panel where you can enable disable CIM.


Sunday, June 9, 2013

Cakephp-Sort by custom made field in MYSQL not working in pagination

Recently in one of my cakephp projects.I came across a issue in pagination and sorting of data on basis of a custom made field..

Case:
I had a MYSQL field "video_length" in STRING which should have been in TIME(DB was not created by me)...

My requirement was sort on basis of this field so in my find function of Model I used

"TIME_TO_SEC(UserVideo.video_length)" AS vid_len and sorted by the same

It was working fine in normal scenario but was not showing sorted results under pagination may be because it was not permanent column of table

Solution:

I did some tricky thing here..I needed the column in format TIME_TO_SEC so in my fields property in my find function I customized fields and added concerned field in name of old field sth like

$this->UserVideo->find('all',array('fields'=>array("TIME_TO_SEC(UserVideo.video_length)" AS video_length)))

See words marked in bold

And finally all was coming well under pagination as well

Tuesday, April 2, 2013

Magento-Home Page-Store or Store View is not showing up-404 error: Page not found

Checklist :

1. Make sure the default store view of your defaut store of your default website is not disabled.
2. Flush your cache's
3. Reindex Data
4. Set Main website as default and and then set back your website as default.

The last option worked me with once I changed the Default store for my default website and did every thing till 7th point untill I hit and tried 8th one and it worked for me.

If this is not helping you need to debug the issue since it may either be your .htaccess issue or issue from index.php
Open the index.php in root directory of the Magento installation and comment the line
Mage::run($mageRunCode, $mageRunType);
 (you will find this line near the end)
 Run your website if you still find a 404 page not found error its an .htaccess issue try renaming the same

Else try this hardcode in index.php

Just above the code mentioned above type in the following code

/* Store or website code */
$mageRunCode = 'code of store view to load';

/* you will find the code field when you edit your store view type the same code exactly here */

/* Run store or run website */
$mageRunType ='store';


(make sure you type this just before the code line "Mage::run($mageRunCode, $mageRunType);" ) inorder to override default value of these variables

If you are able to open your store view here you need to go back and check store Management.

Post here if you further have any issues

Magento-Home Page-Language drop down not showing up

Checklist:

1. To show a language bar in the header of your website you should have multiple stores(or store views).

If I peek into languages.phtml we get the following code

"getStores())>1): ?>"

which clearly states that the number of stores should be greater than 1

2. Make sure in case you are using 2 websites the "Main Website" default one and the other one(your's) then your's should be default one.

3. Make sure System>>Configuration>>General>>Locale is set to local languages for your respective store views.

4. Make sure language files are installed perfectly and correctly.If not download them from

http://www.magentocommerce.com/translations

and added them in accordance to the folder sequence as in zip file

5. Make sure it is called correctly in page.xml in respective block

6. Flush your cache's

7. Reindex Data

Saturday, December 15, 2012

Wordpress Theme Not Updating Or Cache Issue

Wordpress Theme Not Updating Or Cache Issue:

Sometimes we get a wordpress installation and have to work on the same.I recently faced this theme not updating issue when I had to customize the functionality of a Preinstalled theme by creating a child theme from the same.


If you installed WordPress yourself and you did not install a cache plugin then WordPress itself is not caching. If you are you using a preinstall then check the plugins to look for anything that could resemble a caching plugin. One of the better known one's is WP Super Cache for example.


Thursday, December 13, 2012

Buddypress-User registration is currently not allowed

Buddypress Error:

Buddypress Error:User Registration is currently not allowed on registration page is simple caused because Membership for anyone is disabled in wordpress.

To resolve this issue simple do 1 thing

In admin panel go to

Settings->General

and in front of Membership section check mark "Anyone can register Check box"

Wednesday, November 28, 2012

Configure Eclipse for Android Dev/Tools not found Error

Just started up with my first development with Android here is the link to how to setup Android ADT Package in Eclipse...
 
http://developer.android.com/sdk/eclipse-adt.html#installing
 
Here is the link for complete guide.
 
http://developer.android.com/sdk/installing.html#Installing
 
And if you are still getting an error like tools not found in android sdk in Eclipse
  
Run Android SDK Manager from start menu 
 
On the top you will see SDK Path

copy that path(you won't be able to copy it practically.I meant just take a note of that path)

run eclipse 
 
it will show an error that tools not found in a given directory

click on window menu select preferences

select Android from the list on left hand side 
 
on the right hand side you will find "SDK Location". Copy that path next to that and Bingo issue resolved 

Sunday, November 25, 2012

PHP Fatal error: Class 'CTestCase' not found Yii

PHP Fatal error:  Class 'CTestCase' not found

Running the command from the folder where bootstarp.php for testcases resolves this issue

Try running the tests from \protected\tests

Tuesday, October 2, 2012

Chrome Error-Uncought TypeError:string is not a function

Occurs when you assign a same name to function as of variable in js

elements have a download attribute in HTML5 as explained here, with a default value of "" (an empty string).
This means that download === this.download in the onclick handler (this is the element in onevent attributes), and therefore the download attribute of the element is superior to the download property of window.
This fiddle lists all string attributes that are present by default. You can see download is an attribute just like innerHTML, which also fails with the exact same reason when used as a function (i.e. trying to refer to window.innerHTML, but instead executing elem.innerHTML()).
As said in the comments, using window makes for no confusion as to what property/attribute variables will evaluate to.
 
This scope behaviour does actually not seem to due to the this value but rather a specific "scope chain" that is being constructed. As per the HTML5 specification:
Lexical Environment Scope
Let Scope be the result of NewObjectEnvironment(the element's Document, the global environment).
If the element has a form owner, let Scope be the result of NewObjectEnvironment(the element's form owner, Scope).
Let Scope be the result of NewObjectEnvironment(the element's object, Scope).
I.e. what is happening is the scope chain is window -> document -> element (increasing superiority). This means that download evaluates to element.download and not window.download. What also can be concluded from this is that getElementById will bubble up to document.getElementById (given elem.getElementById does not exist).
I set up a systematic example so that you can see how variables bubble up the scope chain:
window.a   = 1;
document.a = 2;
elem.a     = 3;

window.b   = 4;
document.b = 5;

window.c   = 6;
Then, logs 3, 5, 6 when clicked.

Sunday, July 8, 2012

HTML5 Placeholder crack

Placeholder does not works  with IE's since its HTML 5 property...here is the crack
//javascript
function defaultval(ele,e)
{
    if(e.type==="blur"winking smiley
    {
        if(ele.value===""winking smiley
        ele.value=ele.title;
    }
    else if(e.type==="focus"winking smiley
    {
        if(ele.value==ele.title)
        ele.value="";
    }
}

//HTML
input id="right_block_name" onfocus="defaultval(this,event)" onblur="defaultval(this,event)" class="right_block_form_name" type="text" name="full_name" title="Enter your name" value="Enter your name"

Wednesday, August 10, 2011

Element.dispatchEvent(event) is not a function

Occurs when we use jquery and prototype framework at the same time.These 2 frameworks conflict
use the following code

$$=jquery.noConflict()

and then in each jquery code use $$ instead of $

Thursday, February 24, 2011

Fatal error: Class 'Debugger' not found in when debug level set to 2 in core.php

Just started off with another RAD platform Cake PHP..and faced an issue so decided to share this fresh hard nut of my cake...

As I downloaded the version 2.0.0 of the Cake PHP RAD platform and copied it to my Apache's root...

And then there was a welcome message awaiting for me

Fatal error: Class 'Debugger' not found

I altered the Debugger value in php.ini file to 0 this problem went away..But I wanted the debugger level to be 2 so I started peeping into the websites for a solution and got a one liner

Add this:

App::import('Core', 'Debugger');

in app/config/bootstrap.php

I am still studying so will let you know more on this statement as I get back till now its a mere copy paste