Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Update ImagineBlock to use CmfMedia image #72

Closed
wants to merge 1 commit into from

Conversation

rmsint
Copy link
Contributor

@rmsint rmsint commented Jun 18, 2013

See symfony-cmf/cmf-sandbox#189 for related CmfMedia PR's.

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets na
License MIT
Doc PR symfony-cmf/symfony-cmf-docs#191

TODO to merge

  • Needs to be rebased on master and updated after recent mappings update and cleanup
  • Add web test case for image block
  • Doctrine\Phpcr\ImagineBlock
    • use ImageInterface for checks instead of Image document?
    • use configuration parameter for Image document class?
  • imagine block template
    • check how to pass image object to imagine_filter
    • add to changelog if changed
    • document if using image.id

} elseif ($this->image && $this->image->getFile()) {
// TODO: this is needed due to a bug in PHPCRODM (http://www.doctrine-project.org/jira/browse/PHPCR-98)
// TODO: this can be removed once the bug is fixed
$this->image->getFile()->setFileContent($image->getFile()->getFileContent());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure that bug is indeed fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100%. I checked Jira and read the ticket has fixed as status, so I trusted JIRA :-)

Don't know in what test-case it happened, I think we should check. At least I verified that it doesn't solve the current issue with persisting the stream of the Resource.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem happened when you upload a new image to a place that had a
previous image. replacing the child image document failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, also got that error so we need to re-check this once the other is solved. Logged it in the cmfmedia code with a TODO by the way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so do we re-add this workaround for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already fixed it somehow, I do not get errors when testing to replace an image.

@lsmith77
Copy link
Member

what is the status here?

@rmsint
Copy link
Contributor Author

rmsint commented Jul 31, 2013

The code is ready but needs to be rebase once the xml mappings are merged. Then the PR can be merged once we decide to merge all CmfMedia PR's.

} elseif ($this->image) {
// TODO: https://github.com/doctrine/phpcr-odm/pull/262
$this->image->copyContentFromFile($image);
} elseif ($image instanceof Image) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentionally the class and not the interface? if so, please add a comment to the code explaining

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this to the interface

@lsmith77
Copy link
Member

where are we here?

@rmsint
Copy link
Contributor Author

rmsint commented Aug 18, 2013

The code and changelog is ready. A web test case for the image block is to be added.

After that the merge can be done if we find the MediaBundle is ready.

For the MediaBundle I would like to merge symfony-cmf/media-bundle#40 tomorrow. Upload and download tests are also covered then.

After that we have to check the bundle standards of the MediaBundle.

$this->image = $image;
} else {
$this->image = new Image;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we have agreed on not omitting the ()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, will do that in future

@lsmith77 lsmith77 closed this Aug 19, 2013
@lsmith77
Copy link
Member

merged manually

@rmsint rmsint deleted the cmf_media branch August 19, 2013 19:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants