-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import tags from v1 (#1657) #1658
Conversation
if ($importedEntry['tags'] != '') { | ||
$tags = explode(',', $importedEntry['tags']); | ||
foreach ($tags as $tagv1) { | ||
$tag = new Tag(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should check if tag exist first. See https://github.com/wallabag/wallabag/blob/v2/src/Wallabag/ImportBundle/Import/PocketImport.php#L180
Todo: We need this method to be called from (almost) everywhere since we already use it in ContentProxy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: We need this method to be called from (almost) everywhere since we already use it in ContentProxy.
assignTagsToEntry ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I once set a todo but I guess @nicosomb removed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a followup #1667
1f3f493
to
cb2c3ee
Compare
Yeah we might need one more test in You should retrieve with that url |
9b44032
to
2e63554
Compare
$tag = $client->getContainer() | ||
->get('doctrine.orm.entity_manager') | ||
->getRepository('WallabagCoreBundle:Tag') | ||
->findOneByTagLabel('Framabag'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try with findOneByLabel
instead ? I guess this magic method exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does indeed.
2e63554
to
fca2b05
Compare
Great ! 👍 |
#1657
Maybe a few more tests ?