Weird: FCK loses first line of formatted text when submitting

Last night (Oct, 28th), I was fixing a very weird problem where text edited using FCK, submitted via jQuery was losing the very first line when it was formatted (color, style) but not every single time… randomly it seemed.

At first, I thought it would be something wrong with FCK editor and checked if there was an updated version. I was using 2.5.x on my site and 2.6.5 is current in the 2.x series (and 3.0.1 was just released, note: checking that for another website [http://thirdgenerationco.com]).

Since I didn’t want to introduce new features (cause my client freaks out when I do without letting him know), I thought I’d give 2.6.5 a try. That did not solved my problem.

My next logical step was checking how jQuery was encoding the text to preserve quotes and double quotes and making sure PHP was getting that right. Which both were.

Next, I tried adding slashes and stripping them down, which also did not work.

At this point, I thought about changing my Ajax approach…..  but before that I’d though I’d give JSON a try.  🙂

So this is the changes I’ve made in my coding:

Javascript side (My text is edited inside a dialog window (created using jQuery-UI) and then posted using Ajax, from the main window.

var new_text = $('#frame_frontpage').contents().find('#previewMyStoreMessageBoard').html();
$("#previewFrontPageText").html(new_text);
$("#frontpage_text").val(new_text);
var str = $("#form_frontpage_text").serialize();
var This = this;
$.post('/member/store_home_page/ajax_save_frontpage_text', str,
$.post('/member/store_home_page/ajax_save_frontpage_text', {frontpage_text: new_text},
  function(text) {
    if (text == "success") {
    alert("Store Description Text submitted successfully.");
    $(This).dialog('close');
  } else {
    alert(text);
  }
}
);

Besides that I just added addslashes() and stripslashes() to preserve double quotes to/from the database.
And it’s now working 😀

Creating a content controller using Kohana v3.0

These are the things I needed to change on .httacess to have kohana default files working before creating my first controller:

 # Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /kohana/

# Protect hidden files from being viewed
<Files .*>
 Order Deny,Allow
 Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)b - [F,L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

My Kohana v3 installation is not inside a folder, so I’m changing "/kohana/" to "/".

I want to use my Content controller to show content for the front page and any other content pages read from the database, so I am doing the following changes to my /application/bootstrap file:

Route::set('default', '(<controller>(/<action>(/<id>)))')
 ->defaults(array(
 'controller' => 'content',
 'action'     => 'index',
 ));

Create the Content controller file /application/classes/controller/content.php

<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Content extends Controller {

 public function action_index()
 {
 $this->request->response = 'This is the content controller!';
 }

 public function action_view()
 {
 $this->request->response = 'This is the content controller [view action]!';
 }

} // End Welcome

Playing around with Kohana v3

New Kohana version is out, grab it from here:

http://dev.kohanaphp.com/projects/kohana3/files

And again, extract to a folder on your web server.

On good thing to do is extract both "Application" and "System" into a folder accessible to the user your webserver runs (usually, apache, nobody, httpd) and change the paths inside index.php

$application = '../application';
$modules = '../../../data/kohanav3/modules';
$system = '../../../data/kohanav3/system';

If you got the paths right on your environment, you should see a message saying your environment passes all requirements and you that you should remove the install.php file

kohanav3_environment_testsIt’s late here…. so this is all I’m gonna do for now.

Working with Kohana PHP Framework v2.3.4

Let’s start working with Kohana (I’ve actually been working with it for a while and thought would be nice to share my experiences)!

First thing you want to do is download it and extract it to a folder on your webserver.

You can read about it and download it at: http://www.kohanaphp.com/

Right after extracting Kohana to your webserver folder, you should see the following when accessing it:

Kohana 2.3.4 - environment tests

Kohana 2.3.4 - environment tests

If you don’t see the output above, check your server settings and logs to help you figure what’s wrong. Feel free to drop me a message, if you need more help after that.

After you remove install.php like required above, refresh the page and you should see this:

Kohana 2.3.4 - Welcome to Kohana

Kohana 2.3.4 - Welcome to Kohana

Please take some time to go over the documentation at http://docs.kohanaphp.com/ so you don’t feel totally lost. 🙂

As time allows me, I will be writing more stuff about Kohana. This is just a first post to get people started.

http://www.kohanaphp.com/You

Little extra money opportunity

Like everyone else out there, I’m always looking for some new ways to make an extra money (or more money, for that matter).

I’ve been using ClixSense on my spare internet time (read multitasking).

All you have to do is log in to the site, click Browse Ad $$ on the side menu and click on the ads (You have to keep each ad open for 30 seconds to get credited)

It’s not a fast way to get millionaire, but I did receive a $10 check 2 years ago, got to another $10 on my account which I used to buy a Premium membership (Which allowed me to view approximately 500 ads which really helped get the investment back.

You pay nothing to sign up as a free member, and can work your way to $10,00 relatively quick. Then my advice would be get a Premium membership, which will allow you to view/click more ads for a whole year.

I already reached the minimum payment amount again, just missed the payment date which is the 10th if I remember right.

Well, again, if you have some spare time and want to make some extra income, follow this link: http://www.clixsense.com/?2145218


(gs)MT- REQUEST ID #680057 / STATUS: Pending Resolution

James S.

Thank you for the phone call. Here is a brief summary of our conversation:

You called because you were unable to access phpMyAdmin and phpPgAdmin from your AccountCenter and could not connect to the databases through a SSH client.

While looking into this issue I found that the migration from the MySQL Grid-Container back into the MySQL SmartPool failed due to a failed SSH connection during the process.  I was able to contact a systems administrator who started the migration process again, as we spoke we were able to verify that the migration had been completed and we had access to both phpMyAdmin and phpPgAdmin.

You mentioned that you thought this script should be updated so that if it fails such as it did earlier today it would automatically be run again.  A note of this has been made and sent to the (mt) Media Temple requests department for further review.

During the course of this call we also reviewed some issues with support requests regarding Account: 144100.  At this time I transferred you to speak with my lead technician to get more information regarding the status of the pg_dump error.

If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best Regards,

James Starbuck
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007
Check out our New User Forums!
http://kb.mediatemple.net/questions/824/

@
2009.10.23 05:54 PM
I’m waiting on this one

(gs)MT- REQUEST ID #670588 / STATUS: Resolved

Rob C.

Thank you for the phone call. Here is a brief summary of our conversation:

You called in to report that your Postgres server was not working. Your web application was displaying error messages, you couldn’g connect via the command-line and phpPgAdmin was not working. I notified an engineer and they are taking a look at it. I’ll be calling you back this evening to let you know the status.

If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best Regards,

Rob C.
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

NEW! User Forums: http://kb.mediatemple.net/questions/824/

@
2009.10.08 09:51 PM
Maurício

I have posted a screen capture here:
http://portnumber53.com/images/alocate_memory.jpg

waiting for your call back

@
2009.10.08 09:54 PM
Rob C.

Thank you for the phone call. Here is a brief summary of our conversation:

You had some concerns you wanted addressed during our call:

1) Regarding support request #657283 you’d like to know if the problem with pg_dump versions has been fixed because you want to move back to the Smart Pool and are concerned about database corruption.

2) Your Container that has both MySQL and Postgres running ran into problems tonight and had to be rebooted. You’ve had the same application error displayed in the Smart Pool, after you were bursted and in a Container. I’m going to see if we have any Postgres server logs available.

3) You’d like someone to call you back about these issues.

If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best Regards,

Rob C.
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

NEW! User Forums: http://kb.mediatemple.net/questions/824/

@
2009.10.08 11:07 PM
Maurício

just a small detail, I had the same issues regardless the application I was using (psql, pg_dump, phpPgAdmin) in both the Smart Pool and the Grid Container.
None of my "Postgresql websites" have big databases (or tables) and they don’t have high traffic usage at the moment.

@
2009.10.08 11:25 PM
Mike M.

The application is giving errors about the environment being out of memory. This message can happen in the Smartpool or the Container because you are exhausting all the resources avaliable. The Postgres error logs have been put in the /backup directory and this information can be viewed via the Account Center File Manager. I would advise to look over this information in regards to optimizing the environment. If you need any further insight please to not hesitate to ask.

Best Regards,

Mike M
Customer Support
Check out the New User Forums: http://kb.mediatemple.net/questions/824/
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

@
2009.10.09 05:41 AM

(gs)MT- REQUEST ID #657010 / STATUS: Resolved

Robert V.

Thank you for the phone call. Here is a brief summary of our conversation:

Due to the repeated inconvenience of your PostgreSQL database running out of memory intermittently since you started this account, I am reassigning this Support Request to our Billing Department to add a database container to your account.  The first month will be free.  If you decide that you do not want to keep the container you will need to close the container before the month is over.  If you do not close the container before the month is over your account will be assessed a fee for the container’s usage.

Thank you for using (mt) Media Temple!  Feel free to let us know if there is anything else we can help you with.

Best Regards,

Robert V.
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

NEW! User Forums: http://kb.mediatemple.net/questions/824
Knowledge base: http://kb.mediatemple.net/

@
2009.09.17 01:40 PM
Shawnte A.

We have added a MySQL Container Lite to your account.  The billing cycle for this service is 10/25/09 at which time you will be charged $20.00.  If you have any additional questions or concerns, please feel free to contact us.

Best Regards,

Shawnte` A.
Billing Administrator
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

@
2009.09.17 03:38 PM
James S.

Thank you for the phone call. Here is a brief summary of our conversation:

You called because your databases were moved into a MySQL GridContainer,and since this has occurred your sites running in a PostgreSQL database are unable to resolve to the database content.  An error occurred when the databases were moved to the container which caused the tables in your PostgreSQL databases not to be added to the databases when they were created.

In order to have this issue resolved I have reassigned this support request to a higher level employee to resolve.  Please anticipate a delay while this support request is reassigned and resolved.

If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best Regards,

James Starbuck
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007
Check out our New User Forums!
http://kb.mediatemple.net/questions/824/

@
2009.09.17 05:32 PM
Maurício

In case I choose not to keep the Container, will my databases be moved automatically to the regular pool?

@
2009.09.17 05:33 PM
Michael H.

You were having a problem with your databases not being populated with tables after the GridContainer move. Our admins were able to recover your data and I restored the tables for you. We don’t currently have an answer for the original issue, but our engineers are working on it. You should receive an email once they have it resolved.

If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best Regards,

Mike H.
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

NEW! User Forums: http://kb.mediatemple.net/questions/824/

@
2009.09.17 08:51 PM
Mike M.

Please refer to your Grid-Service "aliofthevalley.com", Support Request # 657007, for the response to this Support Request. If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best Regards,

Mike M
Customer Support
Check out the New User Forums: http://kb.mediatemple.net/questions/824/
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

@
2009.09.17 11:17 PM
Travis O.

Thank you for the phone call. Here is a brief summary of our conversation:

You called because you were unhappy about the way your PostgreSQL databases were bursted and you lost the complete functionality of your databases.

We have determined that your request requires the assistance of a higher level staff member or system administrator. Please anticipate a short delay while we re-assign your support request to a staff member who is better equipped to service your needs.

Due to the nature of this support request additional time may be needed to provide you with a response. Thank you.

Best Regards,

Travis Oberlander
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

@
2009.09.24 10:54 AM
Nathaniel M.

Thank you for the phone call. You called in because you wanted to speak with a supervisor about an issue related to your pg databases. I asked if you could submit a support request with the exact problem so I could escalate it if necessary and you asked to speak to a supervisor. I then transferred you to TJ.

Best Regards,

Nat M
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007
User Forums: http://kb.mediatemple.net/questions/824/

@
2009.09.24 04:49 PM
Maurício

I understand I received a month credit for a Grid Container because of the allocate memory problems (which happen when trying to connect to the database server; and not white running any query either complex or simple)

I’d like to know if I could get any compensation on the fact that my databases were not moved correctly to the Grid Container.

@
2009.09.24 05:14 PM
Daniel C.

Thank you for the phone call. Here is a brief summary of our conversation:

We spoke today regarding issues connecting to your database externally. I was able to duplicate this issue and explained that an administrator will take a look into this shortly.

If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best Regards,

Daniel C.
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

NEW! User Forums: http://forums.mediatemple.net

@
2009.09.24 06:23 PM
Daniel C.

Please use support request #661555 for further information on the external connection issue.

Best Regards,

Daniel C.
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-564-2007

NEW! User Forums: http://forums.mediatemple.net

@
2009.09.24 08:10 PM

(gs)MT- REQUEST ID #657283 / STATUS: Resolved

Mauricio

Hello,

would it be possible to get pg_dump to be the same version as the server so I don’t get messages like:

"pg_dump: server version: 7.4.23; pg_dump version: 7.4.7″

I’m aware that I can use "–ignore-version"…. but still…

@
2009.09.17 10:08 PM
Michael H.

I was informed that the dumps were failing and the version had to be ignored in order to get them to complete properly. This was done with just "-i".
After evaluating the details of this support request it has been determined that the reported issue will need to be logged into (mt) Media Temple’s product bug and feature request tracking database.  Issues logged to this system will receive high-priority attention and consideration for resolution in future upgrades and product refreshes.

This support request is being marked as "resolved"; however in actuality it is being moved to an internal tracking system.  If you have any additional information to add to this specific issue we ask that you update us as soon as possible so that the full scope and detail of the issue is logged.  Thank you for your understanding in this matter.

Best Regards,
Michael Handa
Customer Support
(mt) Media Temple
<v> 877-578-4000
<f> 310-943-3559
For up to date status information visit
http://status.mediatemple.net

@
2009.09.18 03:28 PM
  • IGlr