Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
561 views
in Q2A Core by
Phenomenon:

If plugin has set options by page module, initial value of plugin options does not set at all.

How to fix:

https://github.com/q2a/question2answer/pull/138/files

Suggestion:

(Especially my) plugins and themes are likely to malfunction in this problem. There may be other problems in beta version. I have not yet confirmed the compatibility of the beta version and my plugins. I would check the compatibility after stable version has been released. I recommend that you (at least my plugin users) not use the beta version in a public site. I want that users who have development skill try beta energetically in local (safely) environment.
Q2A version: 1.7 beta1 (My formal version is 1.6.3)

1 Answer

+5 votes
by
Extending on sama55's post, if I remember correctly from my tests, this actually affects all modules, not just the page ones. What happens there is that the ones that have an option_default defined, instead of being all called, it only gets called the last one that has been found.
 
EG: If you have page1, page2 and page3 and page1 and page2 have option_default defined then, assuming the core loads them in that order, only page2 option_default will be checked, leaving out page1. So module load order should affect the result and the amount of each modules in each type too. Core's modules are also considered. In my case, and most likely in all user's case, the only option_default run for pages will be the one from the XML Sitemap.
 
This means that it is likely that, if you remove the XML Sitemap plugin out of the qa-plugin directory a different page plugin will be picked up.
 
Note, again, this happens for each plugin type, not just the page one. So one plugin per type is actually given the chance to run its option_default function.
 
The good thing is that it shouldn't affect old time users that have already the settings in the ^options table as if they already have them, then the option_default is not run. This should only affect new plugin users that don't have the settings in there.

 

...