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

fix code conversion bugs #2069

Merged
merged 2 commits into from Apr 6, 2017
Merged

Conversation

kareila
Copy link
Member

@kareila kareila commented Apr 5, 2017

Fixes #2041: DW::BlobStore->store was being given $data when it wanted \$data.

Also fixes an issue with printing icon keywords on the newly converted editicons page which was revealed during testing. (All of my previous test icons had single keywords, and the bug only happens when an icon has multiple keywords.)

…words

This method uses wantarray to determine whether to return
an array or a string of keywords joined by commas.

Template Toolkit method calls will always request array context,
unless you use the Scalar plugin to force scalar context.

http://mail.template-toolkit.org/pipermail/templates/2008-June/010235.html
Looks like the 'store' method expects a reference to whatever
data it is given - in this case, a frozen hashref.  If it doesn't
get exactly what it expects, it croaks, and any subsequent
processing is aborted.

This fixes the reported problem in my testing, using the case
of not having enough icon slots to import all of the other
account's icons.

Fixes dreamwidth#2041.
kareila added a commit to kareila/dreamwidth that referenced this pull request Apr 5, 2017
I used this to test my fix for dreamwidth#2069 and thought it
would be generally useful for development.
@@ -15,6 +15,8 @@

[%- dw.need_res( "stc/editicons.css", "js/editicons.js" ) -%]

[%- USE Scalar; # needed to force scalar return context for keywords -%]
Copy link
Member

Choose a reason for hiding this comment

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

TIL.

@zorkian zorkian merged commit adf91b1 into dreamwidth:develop Apr 6, 2017
@zorkian
Copy link
Member

zorkian commented Apr 6, 2017

Thanks for finding/fixing the BlobStore issue.

@kareila kareila deleted the 2041-importicons branch April 7, 2017 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

can't import icons from LJ: code error
3 participants