sitrunlab / LearnZF2

Learn ZF2 Website
http://learnzf2.sitrun-tech.com/
BSD 3-Clause "New" or "Revised" License
19 stars 14 forks source link

initial commit of ajax image gallery #136

Closed ghost closed 8 years ago

ghost commented 9 years ago

Ok, so these are the first drafts. There are still a lot of things to be done. Any idea how to stop the page from being automatically refreshed after image upload? This issue is not happening on my own CMS.

Don't mind the display_errors in index.php. I will remove them on next commit.

samsonasik commented 9 years ago

I don't have idea about :

refreshed after image upload

it should be because the javascript is break somewhere, should can be check with firebug

ghost commented 9 years ago

Thanks for the feedback. I learned few new things :). Will fix everything today or tomorrow. As for the test cases, I have no idea why they were deleted from the Ajax folder, since I still have them on my localhost, but ignore them for now.

samsonasik commented 9 years ago

:+1: , anyway, please run

php public/index.php migrations:generate

and add new sql in generated file like this :

<?php

namespace DoctrineORMModule\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20150606222937 extends AbstractMigration
{
    /**
     * @param Schema $schema
     */
    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
        $this->addSql("
            INSERT INTO `module_list` (`module_name`, `module_desc`, `module_route`) VALUES
            ('LearnZF2AjaxImageGallery', 'Learn Ajax Image Gallery with ZF2', 'learn-zf2-ajax-image-gallery');");
    }

    /**
     * @param Schema $schema
     */
    public function down(Schema $schema)
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
        $this->addSql("
            DELETE FROM `module_list` where `module_name` = 'LearnZF2AjaxImageGallery'");
    }
}
samsonasik commented 9 years ago

please add .gitignore to public/userfiles/2015_Jun/images/ or public/userfiles with .gitignore content:

*
!.gitignore

to avoid commited local images upload files.

Thank you ;)

samsonasik commented 9 years ago

please rebase with latest upstream master with the following steps:

$ git remote add upstream https://github.com/sitrunlab/LearnZF2.git
$ git checkout master && git pull upstream master
$ git checkout changelog && git rebase master

you will get some conflict, you need to clean up : <<<<HEAD conflict. After it clean, Don't add a commit, but you can do:

$ rm -rf composer.lock && rm -rf vendor/ && composer install
$ git add .
$ git rebase --continue

Now, you need to force update origin:

$ git push --force origin changelog
ghost commented 9 years ago

I have commited a new code. There are still some bugs to be fixes before I write the unit tests.

samsonasik commented 9 years ago

please do rebase instead of merge like i noted above.

samsonasik commented 9 years ago

@Stanimirdim92 I can see that there is no conflict with master branch now. You can still use this branch. For travis failure, it should will be rebuilt on your next commit. Thanks ;)

samsonasik commented 9 years ago

your composer.lock conflict now with latest master, please try rebase ;)

ghost commented 9 years ago

Hi,

Can someone of you guys have a look at uploadFiles() function? It's inside the controller. I spent like half a day trying to figure out why on earth it doesn't work with return JsonModel([]) nor if I use return Json::encode($uploadStatus), while every other method works, but for this, I couldn't fix the problem.

I'm also working on a image processing library based on GD extension. So far so good, just needs to polishing and filter effects manipulation. After that I will update this PR.

@samsonasik, ok

Regards, Stanimir

ghost commented 9 years ago

Can you confirm that all dependencies were resolved? The main problem was that my composer.lock file from changelog branch was way ahead of the one from master and everytime when I try to rebase it would conflict and ask me to merge or rebase won't be started. For now everything seems to be up to date.

samsonasik commented 9 years ago

It seems your branch already overlapped. I think you can focus on finishing it now, I will take care the composer.lock issue and cs fixes when it ready for merge. Please see my comment before about doctrine migration, and unit tests. You can run unit tests locally so when the unit tests ready, you can ping us ;)

ghost commented 8 years ago

Needs review. @samsonasik @acelaya

samsonasik commented 8 years ago

Thanks, I will try to do it today your time ;)

samsonasik commented 8 years ago

I pulled your branch.

  1. it seems you didn't run php public/index.php migrations:generate and add new sql as I noted above https://github.com/sitrunlab/LearnZF2/pull/136#issuecomment-109604431
  2. I tried upload and got internal server error? any php configuration needed?
ghost commented 8 years ago

I executed the command and commited the modified file. No 500 errors. What's the log saying? Skype is down, but I'm at facebook ad zftalk channel

samsonasik commented 8 years ago

I debugged it and found that directory target doesn't exists, added .gitignore locally for that, and fixes migration issue locally ( redeclare class exists).

samsonasik commented 8 years ago

@Stanimirdim92 merged, thanks!, Next is make unit tests coverage 100% ;), Currently I see still 93.33% for this module.