if you have no code in the input form

there is a error


Fatal error: Call to a member function init_display() on a non-object in /var/www/dev6/sites/views.dev/modules/views-HEAD/includes/admin.inc on line 798
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
6.41 KB

mh i don't like this patch, but it solves the issue.

there has to be a much easier way to do it, this is not a good style i think

PS: thanks Spartacus for finding the issue.

merlinofchaos’s picture

What if we just set the textarea to #required TRUE?

dawehner’s picture

the Problem is there that the validate function executes the code and does all stuff see

function views_ui_import_validate($form, &$form_state) {

And validate functions are called if there is something in the view import textarea or not, this was my first try to fixing it, perhaps i did something wrong...

merlinofchaos’s picture

Hm ok. Just exit the validation function early if the textarea is empty?

dawehner’s picture

FileSize
1.28 KB

thx wise merlin!

stBorchert’s picture

Status: Needs review » Needs work

If you throw an error if the textarea is empty you should set it to required, too.
Apart from that: +1 and works.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1002 bytes

but then i don't have to throw the error, because required throws a error too.

and this message is rather hard to understand

but here is the patch.

thx for the review!

larsdjohnson’s picture

I had this problem for a different reason. This comes up first on Google search for the error, so I'm going to put my problem here for anyone else who finds this:

If you have TinyMCE enabled for that views import text box, it formats your code funny, and even if you use the HTML button in TinyMCE to paste your code, it still throws "p" and "/p" tags around your text.

So, you have to disable TinyMCE for that page in your TinyMCE configuration.

dawehner’s picture

You cannot have this problem together with the wysiwyg-API Module

There the editor is only used for fields with a input filter attached, and its definitve not one for this textarea.

you have to disable the editor, this cannot/shouldn't by solved by views, thats my personal oppinion

tobiasb’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
FileSize
1.11 KB
tobiasb’s picture

my smaller version :D its time to commit this quick fix

merlinofchaos’s picture

Status: Needs review » Fixed

Works for me. Committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.