Description
This used to be a Drupal site (back in https://github.com/jywarren/plots days!)
This is a complex, multi-part issue which should be broken up into smaller issues, but just to provide an overview:
The legacy Drupal stuff is almost eliminated, but is confusing for new contributors -- mostly at this point it's:
The word Drupal on some models
We could rename DrupalNode
to Node
, for example, and this line in the model would then be unnecessary:
https://github.com/publiclab/plots2/blob/master/app/models/drupal_node.rb#L20-L21
But this would need to be a find/replace throughout the codebase!
The filename here: /app/models/drupal_node.rb
could then become /app/models/node.rb
So, in summary, we've completed:
-
DrupalNode
=>Node
-
DrupalNodeRevision
=>Revision
(DrupalNodeRevision => Revision model renam #1496) -
DrupalComment
=>Comment
(done by @ashleypt in [in-progress]Fix/change drupal comments to comment. Part of #956 #978) -
DrupalTag
=>Tag
(done by @ashleypt in drupal_tag => tag #1178) -
DrupalNodeCommunityTag
=>NodeTag
(not UserTags as that'll be for tags upon users; drupal_node_community_tags => node_tags #1495) -
DrupalNodeCounter
=>NodeCounter
-
drupal_profile_field.rb
- this and the below are used only for storing bios which could be migrated to theUser
model as a text field. - moving to User.bio in bio field now part of User; status moved off of DrupalUser #1497 -
drupal_profile_value.rb
Remaining to refactor
There are a few others, but we should look into how heavily they're even used, as we could start a new project to begin simplifying/deprecating older models:
- Code related to Answer model (not Drupal but we do want to deprecate it): https://github.com/publiclab/plots2/search?q=answer
-
drupal_content_field_image_gallery.rb
- these could be merged into (added before) the body content field of the nodes they're attached to and this "gallery" feature finally dumped (broken out into Refactor legacy gallery code into node revision body #4074) -
drupal_content_field_map_editor.rb
- this and 2 below could be merged into the map node body field and not stored as separate records-
drupal_content_field_mapper.rb
-
drupal_content_type_map.rb
- Begin converting Map nodes into normal note nodes #4072
-
-
drupal_main_image.rb
- currently switching between this and a new one on these lines but could migrate old ones forward- Remaining
DrupalNodeMainImage
records can become plainImage
records -- This could happen with a migration: migrate all DrupalNodeMainImage to native Image records #76
- Remaining
-
drupal_file.rb
- we could (withdrupal_upload
, below) just append files to the content of each node (which would use theImage
model, actually) and get rid of these. Actually so I think we can just take the URL of the file, and add a new section to the bottom of the node, called### Files
and just make a list of the URLs to the files. I think this should work for most or all of these? Then we can delete the records -- the uploaded files themselves will remain! -
drupal_upload.rb
- this last one has no records, as far as I can tell... but linksnode
todrupal_file
so we should be able to get rid of this model and table at the same time asdrupal_file.rb