This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

marcel_k
marcel_k

In an attempt to change Martin M.'s Blog + RJ Gallery to support Light Gallery instead of RJ Gallery I forked Martin's project on GitHub. I meticulously went through the code and changed the line

    $table->integer('rjgallery_id')->unsigned()->nullable();

to

    $table->integer('lightgallery_id')->unsigned()->nullable();

and created a foreign key accordingly. The plugin is recognized correctly after php artisan october:up or a log out and log in. Also, the extra field shows up in the Manage section of a blog post, with the drop down filled with Light Gallery galleries. However, the extra column in the table rainlab_blog_posts doesn't appear, obviously resulting in an error when trying to save a post.

The repository is here, where you can view my attempt. What am I doing wrong?

JeffGoldblum
JeffGoldblum

It's probably because the migration wasn't actually run because the original plugin's migration had already been run. Try running php artisan plugin:refresh MarcelKorpel.BlogGallery and if that throws an error due to your in place modification of the migration file, then remove any references to the plugin from the system_plugin_history and system_plugin_versions db table and try again.

marcel_k
marcel_k

The output of that command looks fine:

Rolled back: MarcelKorpel.BlogGallery
Reinstalling plugin...
MarcelKorpel.BlogGallery
 - v1.0.1:  First version of Blog with Light Gallery

however, the extra column is still not created, even not after removing the lines referring to my plugin in those system_plugin_* tables and rerunning php artisan plugin:refresh MarcelKorpel.BlogGallery, resulting in the same output.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.