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

Fixes to improved categories #1747

Merged
merged 9 commits into from
May 25, 2017
Merged

Fixes to improved categories #1747

merged 9 commits into from
May 25, 2017

Conversation

rjmackay
Copy link
Contributor

@rjmackay rjmackay commented May 19, 2017

This pull request makes the following changes:

  • Only add tags type attributes to the "post fields" not tasks.
  • Remove any 'tags' attributes from tasks
  • Don't allow making tags attributes private

Test these changes by:

  • Run migrations
  • Run tests

Fixes #1397

Ping @ushahidi/platform


This change is Reviewable

@rjmackay rjmackay mentioned this pull request May 19, 2017
@rjmackay rjmackay force-pushed the fixes-to-improved-categories branch from a820d97 to e09837e Compare May 19, 2017 05:31
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling e09837e on fixes-to-improved-categories into ** on develop**.

@rjmackay rjmackay requested review from willdoran and Angamanga May 22, 2017 09:25

use Phinx\Migration\AbstractMigration;

class JoinPostsTagsTableToAttribute extends AbstractMigration
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@willdoran can you sanity check this migration?

* @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License Version 3 (AGPL3)
*/

class Ushahidi_Repository_Post_Tags extends Ushahidi_Repository_Post_Value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Angamanga have a look at this. This allows us to have an attribute type that loads from the posts_tags table ... I've just added a form_attribute_id to the existing table. Still working on changes to the posts repo though

@rjmackay rjmackay force-pushed the fixes-to-improved-categories branch from 5b8add9 to 72ae137 Compare May 22, 2017 09:47
'update' => 'CASCADE',
])
->update();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@rjmackay my understanding is that this will:

Add form_attribute to post_tags
Change tag attribute type to tags
Copy all Form Attributes of type tags
For each attribute use From === a give post_tags's post's from_id, update the post_tag form_attribute_id
Add foreign key constraints for posts_tags form_attribute_id

If that flow is the desired one then this code works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy all Form Attributes of type tags
For each attribute use From === a give post_tags's post's from_id, update the post_tag form_attribute_id

Something like that. It grabs the first tag attribute for each form, and uses that to set form_attribute_id for existing posts_tags values.

@rjmackay rjmackay force-pushed the fixes-to-improved-categories branch 4 times, most recently from 96fc128 to a17c129 Compare May 25, 2017 01:24
@rjmackay rjmackay force-pushed the fixes-to-improved-categories branch from 9c10223 to 138e5cc Compare May 25, 2017 01:45
@rjmackay rjmackay force-pushed the fixes-to-improved-categories branch from 52ce8b5 to 77046c6 Compare May 25, 2017 02:58
@rjmackay rjmackay merged commit d00019d into develop May 25, 2017
@tuxpiper tuxpiper deleted the fixes-to-improved-categories branch March 24, 2021 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants