Codeigniter error 500 when attempting to load lang file - php

I've installed Lubuntu 11.10 x86 on my home server. I previously had Win XP. The server runs well. Apache, PHP and MySQL work great except when it comes to CodeIgniter and language files. First of all php works, I've tested with non CI projects and it's fine. I've also tested a brand new CI project and I get the welcome page. I have a couple projects in CI that have 2 languages and those don't work. To isolate the problem I've copied over the home controller, view and language file. Error 500 when viewing it. If I comment out $this->lang->load('home'); it works fine. If I comment out the content of home_lang.php it works.
I've narrowed it down to the anchor helper in the language file: $lang['home.project1.image'] = anchor('portfolio', 'test'); The url helper is loaded. This worked before. Can I have anchors in the language file? How come this is causing a problem?

If you look at CodeIgniter's documentation for their Language class, they provide an overview:
The Language Class provides functions to retrieve language files and
lines of text for purposes of internationalization.
I'm not sure what's causing your server to flip out, but I'd use the language class to load text strings and wrap any links around them in your view rather than in the _lang file.

Related

Drupal 7 rewrite is removing get parameters from query string

I've recently upgraded a site to the latest release of Drupal 7. The site has a view that retrieves a url with query string parameters from the database and then uses the Drupal rewrite functionality to add a class to the link like so:
<a class="purple-button pull-right" href="[field_database_link-url]" target="_blank">View</a>
The issue is, since the upgrade the rewrite now removes the query string parameters. If I modify the view to display a simple link the parameters are there and it works fine. However, the rewrite applies styling to present a button rather than a simple link. I can't find any settings to resolve the issue so I suspect the upgrade overwrote a modification to the Drupal core made by the original developer of the site. Any idea how I can address this issue?
It turns out that there was a bug in the latest release that in /modules/contrib/link/link.module that was causing the query strings to be stripped from the url in the token. I replaced the code in this file with the code from the pre-upgrade version and it began behaving as expected again. This, of course, is not a resolution to the issue, but at least the source of the problem has been identified. For more info: https://www.drupal.org/node/2367069
I later found that there is a patch for this issue in the dev version (7.x-1.x-dev) of this module available here: https://www.drupal.org/project/link. Download this module and replace it in your install and you should be all set.

How to add php code directly into article using Jumi plugin

Hi every one I have installed Jumi plugin version 2.0 in joomla 1.5 and tried to write php code in the article. I'm able to use the code if I store the php source in an external file and call it within the content like {jumi [../../filename.php]}. But I'm not able to write the same code directly into the content using JCE editor. I'm getting an error like 'Jumi is working but the source needts to come under square brackets'. The problem is that I need to use a php variable output for a div tag and js also. I have no clue of how to overcome this.
Never had much luck with JUMI for that and other reasons, so switched to DirectPHP and kept the PHP right in the article itself.

Moving Site has broken CodeIgniter Modules

I had to move my site to another host and now the codeigniter installation is failing. I've fixed a few problems, but some of my modules break when I try to save changes. The end up going to the following url
admin/index.php/admin/index.php
is that right?
Your paths are relative. Put before an / or write using base_url()
It turned out that the person who had origionally implemented the system had used a differnt bit of code to get the base script for each module, so I had to go through and change each module.
For the admin module it turned out it was to do with changes in how the two differnt versions of php dealt with paths.

document.mutate.save is undefined

I'm using the ModX CMS.
And this error, document.mutate.save is undefined keeps coming up if I were to save a chunk.
Assuming it was a faulty install, I deleted the application, and reinstalled it four times. Those included:
Twice from the original working application on my testing remote server.
From the latest version of Evolution on ModX's website
From another working site I maintain that was also created in ModX.
Assuming it was a javascript conflict, I went into my QM, and removed jQuery from the backend, and then eventually removed jQuery all together unsure if it was still being placed in there. I can not view the source of the backend because it is entirely composed out of iFrames.
The document.mutate.save files come from a folder located in: /manager/actions/
This folder is set to 777 as well as all the surrounding golders and the parent manager folder as well.
Anyone have any idea as to why this error is being called, and how to fix it?
I'm a rails guy, but this seems like a simple method not being defined in the controller problem. Unfortunately, I'm not too conscious of PHP's MVC architecture otherwise, I would fix this manually.
Thanks!
Old thread, I know... but I have a possible solution which worked for me.
After a lot of fiddling around, I finally found that I had activated the editor in the configurations, but had uninstalled the TinyMCE Plugin. After deactivating the editor, the error disappeared.

Importing and accessing existing PHP application into XAMPP

I am new to PHP (have been a Java guy all my years :-) but understand the basics of it. For an existing application on which I need to fix some bugs, I need to import it into XAMPP.
I tried putting all the application folders (and files) into the htdocs folder of XAMPP. However, that does not work. The server does list the new project when I navigate to "http://localhost" but when I click on my project (that I copied), the index.php page fails to come up. It simply says page not found.
I would like to know a couple of things as listed below...
1) Is there something wrong I am doing for the project to be hosted on XAMPP?
2) One peculiar thing that I noticed was that when the application browses to http://localhost/MyProject/index.php , it gets redirected to http://www.localhost/index.php . Is there a URLRewriter (or kind) which is doing this? If yes, where I can find the same within my project?
3) How can I identify the framework that the existing code is using? I can see M-V-C named class.php files
Any pointers would be much helpful for me to start debugging and learning PHP.
Thanks!!

Categories