Skip to content
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

Tags not imported #823

Closed
nbussman opened this issue Sep 1, 2014 · 4 comments
Closed

Tags not imported #823

nbussman opened this issue Sep 1, 2014 · 4 comments
Assignees
Milestone

Comments

@nbussman
Copy link

nbussman commented Sep 1, 2014

When importing an HTML-File from e.g. Pocket no tags are imported. So I just fixed that issue and it worked great.

To fix that add the following in 'inc/poche/Poche.class.php' to the import function :

if ( isset($record['tags']) && trim($record['tags']) ) {
  //@TODO: set tags
  //get all already set tags to preven duplicates
  $already_set_tags = array();
  $entry_tags = $this->store->retrieveTagsByEntry($id);
  foreach ($entry_tags as $tag) {
    $already_set_tags[] = $tag['value'];
  }
  $tags = explode(',',$record['tags']);
  foreach($tags as $key => $tag_value) {
      $value = trim($tag_value);
      if ($value && !in_array($value, $already_set_tags)) {
        $tag = $this->store->retrieveTagByValue($value);
        if (is_null($tag)) {
            # we create the tag
            $tag = $this->store->createTag($value);
            $sequence = '';
            if (STORAGE == 'postgres') {
                $sequence = 'tags_id_seq';
            }
            $tag_id = $this->store->getLastId($sequence);
        }
        else {
            $tag_id = $tag['id'];
        }

        # we assign the tag to the article
        $this->store->setTagToEntry($tag_id, $id);
      }
    }
  }
}

@anarcat
Copy link

anarcat commented Oct 28, 2014

which version is that? this was already reported as a bug in #457 and fixed in #459...

@tcitworld tcitworld self-assigned this Oct 29, 2014
@tcitworld tcitworld removed their assignment Nov 6, 2014
@tcitworld
Copy link
Member

Tags should be imported. Maybe Pocket changed their format. Will look.

@tcitworld tcitworld added this to the 1.9.0 milestone Nov 6, 2014
@tcitworld tcitworld self-assigned this Nov 6, 2014
@nicosomb
Copy link
Member

nicosomb commented Nov 6, 2014

I think Pocket changed their format ... We have several users who can't import pocket data (see http://support.wallabag.org)

@tcitworld
Copy link
Member

This is fixed in dev version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants