I have a problem that only occurs with users who have just signed up for the site and are trying to add a product on my site for the first time. Adding a product is done in two parts. The first is The Product Description. The Second is Product Screen Shots.
After a new user fills out the Product Description and clicks submit, they are taken to the page to upload their product images. However, between the header and the body of the site there is the error
dir occ/54
(This number changes per product)
The solution has been to return to the menu screen, go to the “All Products” view and delete the failed entry. Once you go back to “Add Products” and repeat the process of adding the product description on the first page, the error no longer occurs on the second page.
Apparently for new users, the first time they try to add an item to the database, it is trying to write to a product ID that already exists in the MySQL Database and the OCC folder.
<?
if ($this->tank_auth->is_logged_in())
{
$id = $this->tank_auth->get_user_id();
$user = $this->users_m->get_user_by_id($id);
$profile = $this->users_m->get_user_profile($id);
$fresh = $this->dev->get_fresh_app_id($id);
$app = $this->dev->get_app_by_id($fresh);
$user_dir = 'occ/' . $id;
$is_it = file_exists($user_dir);
if($is_it != TRUE)
{
$dir = 'occ/' . $id;
echo 'dir ' . $dir;
mkdir ($dir);
}
else
{
$new_dir = 'occ/' . $id . '/' . $app->id;
$is_itt = file_exists($new_dir);
if($is_itt != TRUE)
{
$dirr = 'occ/' . $id . '/' . $app->id;
mkdir ($dirr);
}
}
$logo_path = '../occ/'. $id . '/' . $app->id ;
?>
Any help would be appreciated!
Remove this line: